Re: [sqlalchemy] proper use of reserved_words for new dialect

2013-01-29 Thread jank
thank you for your time and patience. Again the hints were very useful. The dialect I am implementing is syntactically very similar to Oracle (this was done on purpose) but the semantics are quite different. For example, schema changing operations are transactional. Thus, a rollback will also

Re: [sqlalchemy] inheritied table with related field as discriminator?

2013-01-29 Thread Michael Bayer
it doesn't produce as efficient of a SQL query, and requires that you set Type manually on the object, but you can use a correlated subquery using this form: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base()

Re: [sqlalchemy] proper use of reserved_words for new dialect

2013-01-29 Thread jank
ok, it is worse thank I thought :) In the connection string in setup.cfg I pass the schema 'SQLA_TEST'. The DB instance happen to have a bunch of other integration test schemas. One of them contains a table named 'TEST_TABLE'. The test case calls has_table('TEST_TABLE', schema=None) which

[sqlalchemy] how can i use bind parameters with an ilike ?

2013-01-29 Thread Jonathan Vanasco
i need to search something like this: select name from users where name ilike '%jonathan%'; i know i could do this: dbSession.query( models.User )\ .filter( models.User.name.ilike( %%%s%% % 'jonathan' ) but the name is coming from the web, so i want treat it with a bind, like

Re: [sqlalchemy] how can i use bind parameters with an ilike ?

2013-01-29 Thread Audrius Kažukauskas
On Tue, 2013-01-29 at 10:08:28 -0800, Jonathan Vanasco wrote: i need to search something like this: select name from users where name ilike '%jonathan%'; i know i could do this: dbSession.query( models.User )\ .filter( models.User.name.ilike( %%%s%% % 'jonathan' ) but

Re: [sqlalchemy] how can i use bind parameters with an ilike ?

2013-01-29 Thread Audrius Kažukauskas
On Tue, 2013-01-29 at 20:19:45 +0200, Audrius Kažukauskas wrote: How about using dbSession.query(models.User).filter(models.User.contains(name)) Scratch that, this generates LIKE, while you need ILIKE. -- Audrius Kažukauskas http://neutrino.lt/ pgpWASdq7rqCV.pgp Description: PGP

[sqlalchemy] Sqlite and datetime storage

2013-01-29 Thread Steven Robinson
Hello, As you may know, SQLite is a bit special when it comes to store date- like data. One can use Strings, integers and floats in order to store dates. Right now sqlalchemy uses ISO-style strings by default which is great if the database is only used by sqlalchemy. Unfortunately, I also want

[sqlalchemy] Re: how can i use bind parameters with an ilike ?

2013-01-29 Thread Jonathan Vanasco
How about using   dbSession.query(models.User).filter(models.User.contains(name)) That generates a LIKE statement , not an ILIKE. I need to case- insensitive match. as a stopgap, i might be able to chain a lower() in there, but something like this should be support. also i'm not so sure

Re: [sqlalchemy] Sqlite and datetime storage

2013-01-29 Thread Michael Bayer
On Jan 29, 2013, at 1:28 PM, Steven Robinson wrote: Hello, As you may know, SQLite is a bit special when it comes to store date- like data. One can use Strings, integers and floats in order to store dates. Right now sqlalchemy uses ISO-style strings by default which is great if the

Re: [sqlalchemy] Re: how can i use bind parameters with an ilike ?

2013-01-29 Thread Michael Bayer
On Jan 29, 2013, at 1:31 PM, Jonathan Vanasco wrote: How about using dbSession.query(models.User).filter(models.User.contains(name)) That generates a LIKE statement , not an ILIKE. I need to case- insensitive match. as a stopgap, i might be able to chain a lower() in there, but

Re: [sqlalchemy] Custom Dialect - recommendations needed for handling of Sequences/lastrowid

2013-01-29 Thread jank
I did a lot of progress. Fine tuning the dialect and the dialect specific requirements.py helped a lot. I am still not ready to provide a minimal test case for the auto_increment behavior. At the current stage I do not trust my dialect implementation. While completing this a question again

Re: [sqlalchemy] Custom Dialect - recommendations needed for handling of Sequences/lastrowid

2013-01-29 Thread Michael Bayer
On Jan 29, 2013, at 5:36 PM, jank wrote: I did a lot of progress. Fine tuning the dialect and the dialect specific requirements.py helped a lot. I am still not ready to provide a minimal test case for the auto_increment behavior. At the current stage I do not trust my dialect

[sqlalchemy] Re: how can i use bind parameters with an ilike ?

2013-01-29 Thread Jonathan Vanasco
On Jan 29, 2:04 pm, Michael Bayer mike...@zzzcomputing.com wrote: ilike is available using column.ilike(some string).   You can turn it into a contains by adding in the appropriate % signs manually.  If you want to do lower() manually, then you can say func.lower(column).contains('some

Re: [sqlalchemy] Re: how can i use bind parameters with an ilike ?

2013-01-29 Thread Michael Bayer
On Jan 29, 2013, at 7:01 PM, Jonathan Vanasco wrote: On Jan 29, 2:04 pm, Michael Bayer mike...@zzzcomputing.com wrote: ilike is available using column.ilike(some string). You can turn it into a contains by adding in the appropriate % signs manually. If you want to do lower()

[sqlalchemy] Re: how can i use bind parameters with an ilike ?

2013-01-29 Thread Jonathan Vanasco
On Jan 29, 7:25 pm, Michael Bayer mike...@zzzcomputing.com wrote: User.name.ilike('%%' + literal(name) + '%%') though even if you are saying 'ilike(%%%s%% % name)', that string value is still converted to a bound parameter, so there's no SQL injection here. i didn't know that was converted

[sqlalchemy] Docs in PDF are not being generated

2013-01-29 Thread Vraj Mohan
Hi, I noticed that documents in PDF for 0.8 and development are not being generated in readthedocs.org. I tried to build these myself with a development snapshot and had the same failures. I then noticed that if a pickled environment was already created, the PDF would be generated fine. In