Re: How to delete with order_by and limit in core?

2015-11-07 Thread vitaly numenta
Thank you Michael. I was hoping to do it the native sqlalchemy way, because my function takes an sqlalchemy-based predicate that needs to be used in this and another query, so I was hoping to be able to do things natively using pure sqlalchemy constructs in order to share this predicate.

How to delete with order_by and limit in core?

2015-11-06 Thread vitaly numenta
Hi, I am using sqlalchemy core with the mysql dialect. Mysql supports DELETE with ORDER BY and LIMIT: DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name [PARTITION (partition_name,...)] [WHERE where_condition] [ORDER BY ...] [LIMIT row_count] However, I can't seem to figure

Re: How to delete with order_by and limit in core?

2015-11-06 Thread vitaly numenta
I also tried to do this via subquery, but MySQL apparently doesn't support subqueries with LIMIT: NotSupportedError: (NotSupportedError) (1235, "This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'") 'DELETE FROM twitter_tweets WHERE twitter_tweets.uid IN (SELECT

Re: [sqlalchemy] What's the idiomatic way of writing INSERT... ON DUPLICATE KEY UPDATE

2015-08-07 Thread vitaly numenta
Has support for MySQL INSERT... ON DUPLICATE KEY UPDATE been integrated into sqlalchemy more recently? Thanks, Vitaly -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: mysql datetime column containing the value 0000-00-00 00:00:00 is retrieved incorrectly as None

2015-08-06 Thread vitaly numenta
I understand that -00-00 00:00:00 would be an invalid datetime, but there is presently no way in sqlalchemy to distinguish between actual Null and the -00-00 00:00:00 value that mysql substitutes when it gets an invalid datetime -- You received this message because you are subscribed

mysql datetime column containing the value 0000-00-00 00:00:00 is retrieved incorrectly as None

2015-08-06 Thread vitaly numenta
platform = mac os x yosemtite sqlalchemy version = '0.9.4' mysql version = 5.6.23 table definition: CREATE TABLE `twitter_tweets` ( `uid` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `created_at` datetime NOT NULL, `retweet` tinyint(1) NOT NULL, `lang` varchar(10) COLLATE utf8_unicode_ci

Re: Progress reporting during a lengthy alembic migration

2015-02-11 Thread vitaly numenta
Thank you, your recommendation worked out great. -- You received this message because you are subscribed to the Google Groups sqlalchemy-alembic group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alembic+unsubscr...@googlegroups.com. For more