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. Thanks,

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 twitter

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 ou

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

2015-08-06 Thread vitaly numenta
Thank you Michael, the CAST works as you suggested. Best, Vitaly -- 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...@googlegrou

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

Re: Bundle multiple column changes in single mysql ALTER TABLE

2015-02-10 Thread vitaly numenta
Thank you Michael. I will do that in the future, until there is a supported alembic way for it. Best, Vitaly On Tuesday, February 10, 2015 at 11:35:37 AM UTC-8, Michael Bayer wrote: > > > > vitaly numenta > wrote: > > > On Tuesday, February 10, 2015 at 7:38:10 AM UT

Progress reporting during a lengthy alembic migration

2015-02-10 Thread vitaly numenta
During a recent particularly lengthy *single-version* migration that took about 17 hours, my IT colleague asked to enable some periodic progress reporting from alembic to be able to tell roughly how far along the migration is. Even if it was just to enable echoing of the SQL commands as the are

Re: Bundle multiple column changes in single mysql ALTER TABLE

2015-02-10 Thread vitaly numenta
I filed an issue for this here: https://bitbucket.org/zzzeek/alembic/issue/271/add-support-for-mysql-alter-table-with -- 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

Bundle multiple column changes in single mysql ALTER TABLE

2015-02-10 Thread vitaly numenta
Alembic 0.7.4, mysql, MacOS X Last time I needed to add eight columns to a 10 million-row table using alembic migration, it took about 17 hours because each add_column was executed individually. With mysql, each individual ALTER TABLE command results in a full copy of the entire table. So, in m

NotImplementedError when calling batch_op.create_primary_key within batch_alter_table context

2015-02-10 Thread vitaly numenta
Using alembic 0.7.4 with mysql on Mac OS X I get a NotImplementedError exception when calling batch_op.create_primary_key within batch_alter_table context -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and