[sqlalchemy] Guaranteeing same connection for scoped session

2015-03-23 Thread Kent
In cases where we interact with the database session (a particular Connection) to, for example, obtain an application lock which is checked out from database for the lifetime of the database session (not just the duration of a transaction), it is important that I guarantee future scoped

[sqlalchemy] auto column naming (declarative)

2015-03-23 Thread Richard Gerd Kuesters | Pollux
hi all! i remember bumping into this somewhere, but now that i need it, i can't find. Murphy ... well, here's the question: * the company i work have a certain convention on naming columns in the database level, like dt_ for datetime, u_ for unicode, ut_ for unicodetext, and so on. the

Re: [sqlalchemy] sqlalchemy (0.9.7) double quoting python list items when used in where in statement

2015-03-23 Thread Simon King
On Mon, Mar 23, 2015 at 2:45 PM, Edgaras Lukoševičius edgaras.lukosevic...@gmail.com wrote: Hello, as I'm not receiving any responses in stackoverflow I wil try here. Can someone help me with this issue? http://stackoverflow.com/questions/29195825/sqlalchemy-double-quoting-list-items For

[sqlalchemy] sqlalchemy (0.9.7) double quoting python list items when used in where in statement

2015-03-23 Thread Edgaras Lukoševičius
Hello, as I'm not receiving any responses in stackoverflow I wil try here. Can someone help me with this issue? http://stackoverflow.com/questions/29195825/sqlalchemy-double-quoting-list-items -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

[sqlalchemy] Re: Is there any potential problem to store datetime as strings in one column?

2015-03-23 Thread Jonathan Vanasco
On Sunday, March 22, 2015 at 7:01:35 PM UTC-4, Bao Niu wrote: Also because sql datetime datatype doesn't persist timezone information. Therefore, I tried to store all the time information as strings. If your database doesn't support timezones, I think it would be easiest to convert

[sqlalchemy] Re: sqlalchemy (0.9.7) double quoting python list items when used in where in statement

2015-03-23 Thread Edgaras Lukoševičius
This query is copied from another python script and if I'm right it's working on older sqlalchemy versions (although I didn't try), but it's not working in my environment. Are you saying it should not work at all? Then how do I workaroud this? What I need is a text sql query, that can be

Re: [sqlalchemy] auto column naming (declarative)

2015-03-23 Thread Richard Gerd Kuesters | Pollux
thanks Mike! i'll be hooking up to this event. i remember using a working example of this a while ago, that's why i questioned :) but there's no problem creating one from scratch :) best regards, richard. On 03/23/2015 01:39 PM, Michael Bayer wrote: the before_parent_attach() event could do

[sqlalchemy] Re: sqlalchemy (0.9.7) double quoting python list items when used in where in statement

2015-03-23 Thread Edgaras Lukoševičius
A quick script with SQL table schema. If tuple is a hack, then how should I it work with the same logic, but without tuple? Construct a string from tuple? I'm afraid that will be double quoted (sanitized) too. from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker

Re: [sqlalchemy] sqlalchemy (0.9.7) double quoting python list items when used in where in statement

2015-03-23 Thread Michael Bayer
Edgaras Lukoševičius edgaras.lukosevic...@gmail.com wrote: A quick script with SQL table schema. won’t work with MySQL. The ability to send a pure string SQL statement directly to execute() in conjunction with a straight tuple, and have it magically expand out to an IN, is a psycopg2 /

Re: [sqlalchemy] Is there any potential problem to store datetime as strings in one column?

2015-03-23 Thread Simon King
On Sun, Mar 22, 2015 at 11:01 PM, Bao Niu niuba...@gmail.com wrote: Hi, Is there any potential disadvantages in using string as the datatype to store datetime plus timezone in one column? In my application the time information is not uniform. Some rows are datetime while others just date. I

Re: [sqlalchemy] auto column naming (declarative)

2015-03-23 Thread Michael Bayer
the before_parent_attach() event could do this, sure. Might be a little tricky: http://docs.sqlalchemy.org/en/rel_0_9/core/events.html?highlight=before_parent_attach#sqlalchemy.events.DDLEvents.before_parent_attach Richard Gerd Kuesters | Pollux rich...@pollux.com.br wrote: hi all! i