Re: [sqlalchemy] Implementation of params for textual SQL prevents its use in column names (use Python format as workaround)

2016-07-27 Thread Andrew M
Okay, thanks Mike for your comprehensive reply. There is still so much to learn ... *sigh*. Perhaps it's worth including a sentence or two in the docs, helping overconfident people like myself to understand the benefits / importance of params (that it's not just .format)? -- You received

Re: [sqlalchemy] Implementation of params for textual SQL prevents its use in column names (use Python format as workaround)

2016-07-27 Thread Mike Bayer
On 07/27/2016 10:11 PM, Andrew M wrote: FYI, there seems to be a limitation of the implementation of params for textual SQL - params appears to silently insert single quotes, preventing the use of params to describe column names in the SQL query. that's SQL . Bound parameters are not Python

Re: [sqlalchemy] Associating select columns to original tables

2016-07-27 Thread Mike Bayer
On 07/27/2016 05:29 PM, T Johnson wrote: I am generating select queries that include alias tables, literal columns, renamed columns via label, multiple joins etc. The queries can be somewhat complex and as a debugging feature, I'd like be able to know which columns came from which

[sqlalchemy] Re: Implementation of params for textual SQL prevents its use in column names (use Python format as workaround)

2016-07-27 Thread Andrew M
My recommendation is to leave params unchanged in the code but update the SQLAlchemy documentation so that .format is recommended over params (or, at least, is recommended for this particular case). On Thursday, July 28, 2016 at 12:11:13 PM UTC+10, Andrew M wrote: > > FYI, there seems to be a

Re: [sqlalchemy] Inner Joins in sqlalchemy example?

2016-07-27 Thread Mike Bayer
On 07/26/2016 04:13 PM, Lukasz Szybalski wrote: Hello, I'm trying to make this inner join in sqlalchemy. MSSql. Is there an example of this? or a guide how to reproduce this. AutoLoad All tables. I need to know how to create this in sqlalchemy, then I'm going to loop the csv file with 1000

[sqlalchemy] Implementation of params for textual SQL prevents its use in column names (use Python format as workaround)

2016-07-27 Thread Andrew M
FYI, there seems to be a limitation of the implementation of params for textual SQL - params appears to silently insert single quotes, preventing the use of params to describe column names in the SQL query. The workaround is to use a conventional string with Python .format (which in my mind

[sqlalchemy] Associating select columns to original tables

2016-07-27 Thread T Johnson
Using base_columns() gets me pretty close but it doesnt indicate when a column has multiple base columns due to an equality join clause. It only returns a single base column for each column. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To

[sqlalchemy] Associating select columns to original tables

2016-07-27 Thread T Johnson
I am generating select queries that include alias tables, literal columns, renamed columns via label, multiple joins etc. The queries can be somewhat complex and as a debugging feature, I'd like be able to know which columns came from which tables...but I don't want to store this information