[sqlalchemy] Re: Creating a custom Visitable

2010-07-20 Thread Mike Lewis
I figured that I need to extend a dialect. Would having something similar to (still a rough version) added to the postgresql dialect be an option?: def post_create_table(self, table): Build table-level CREATE options like TABLESPACE. table_opts = [] inherits =

Re: [sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-20 Thread Harry Percival
I'm clear on that. I'm only using session.add to do an insert when I know i definitely want to. But you'll see I used session.merge on the composite object, yet it still attempts to do an insert for rows that already exist in its constituent tables... On Mon, Jul 19, 2010 at 5:19 PM, Michael

Re: [sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 6:05 AM, Harry Percival wrote: I'm clear on that. I'm only using session.add to do an insert when I know i definitely want to. But you'll see I used session.merge on the composite object, yet it still attempts to do an insert for rows that already exist in its

Re: [sqlalchemy] Re: Creating a custom Visitable

2010-07-20 Thread Michael Bayer
why not use the compiler extension ? On Jul 20, 2010, at 3:07 AM, Mike Lewis wrote: I figured that I need to extend a dialect. Would having something similar to (still a rough version) added to the postgresql dialect be an option?: def post_create_table(self, table): Build

Re: [sqlalchemy] Using the declarative base across projects

2010-07-20 Thread thatsanicehatyouhave
Hi, Just wanted to say thanks to those who helped me with this. Simon's solution was exactly what I was looking for (though I have to admit I don't exactly understand *how* it works!). But that's no longer an SQLAlchemy question... Cheers, Demitri On Jul 8, 2010, at 5:49 AM, King Simon-NFHD78

Re: [sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 11:51 AM, Harry Percival wrote: attached. feel free to ignore the 'sqlite' folder, which is only needed for ironpython. the error definitely occurs in cpython 2.6.3. 1. Merging MoviesAndDirectorsAndGenres, with no primary key identifiers set, sets it as pending in the

[sqlalchemy] Lazy load on a column basis?

2010-07-20 Thread thatsanicehatyouhave
Hi, Is lazy loading supported on a column by column basis, or only through relationships? Cheers, Demitri -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this

Re: [sqlalchemy] Lazy load on a column basis?

2010-07-20 Thread Michael Bayer
deferred(), defer() On Jul 20, 2010, at 1:58 PM, thatsanicehatyouh...@mac.com wrote: Hi, Is lazy loading supported on a column by column basis, or only through relationships? Cheers, Demitri -- You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Re: Creating a custom Visitable

2010-07-20 Thread Mike Lewis
I'm not familiar with the compiler extension. Could you elaborate? (my temporary solution is monkey patching that function into PGDDLCompiler (it feels dirty, like ruby programming)) Thanks, Mike On Jul 20, 7:47 am, Michael Bayer mike...@zzzcomputing.com wrote: why not use the compiler

[sqlalchemy] mismatched parameter markers when running on Mac OS X

2010-07-20 Thread fulv
I have the following stack, which works fine on two different Linux systems, but produces the error below on a Mac OS X 10.6.4 machine: - Ubuntu 10.04 / Fedora 8 (works) - Mac OS X 10.6.4 (does not work) - freeTDS 0.82 - unixODBC 2.3.0 - pyodbc 2.1.7 - collective.lead 1.0 - SQLAlchemy 0.4.8 -

Re: [sqlalchemy] mismatched parameter markers when running on Mac OS X

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 3:34 PM, fulv wrote: I have the following stack, which works fine on two different Linux systems, but produces the error below on a Mac OS X 10.6.4 machine: - Ubuntu 10.04 / Fedora 8 (works) - Mac OS X 10.6.4 (does not work) - freeTDS 0.82 - unixODBC 2.3.0 -

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
Session.execute() accepts strings that are converted to text(): a=session.execute(assp_ReportDailyTransactions @start_date=:start,@end_date=:end, params={'start':20100701,'end':20100719}) Thanks, That does work. Is it possible to get each record to be returned as object instead of

Re: [sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 4:44 PM, Lukasz Szybalski wrote: Session.execute() accepts strings that are converted to text(): a=session.execute(assp_ReportDailyTransactions @start_date=:start,@end_date=:end, params={'start':20100701,'end':20100719}) Thanks, That does work. Is it possible

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
On Jul 20, 3:46 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 4:44 PM, Lukasz Szybalski wrote: Session.execute() accepts strings that are converted to text(): a=session.execute(assp_ReportDailyTransactions @start_date=:start,@end_date=:end,

Re: [sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 5:10 PM, Lukasz Szybalski wrote: On Jul 20, 3:46 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 4:44 PM, Lukasz Szybalski wrote: Session.execute() accepts strings that are converted to text():

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
On Jul 20, 4:55 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 5:10 PM, Lukasz Szybalski wrote: On Jul 20, 3:46 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 4:44 PM, Lukasz Szybalski wrote: Session.execute() accepts strings that are

Re: [sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 6:19 PM, Lukasz Szybalski wrote: On Jul 20, 4:55 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 5:10 PM, Lukasz Szybalski wrote: On Jul 20, 3:46 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 4:44 PM, Lukasz

[sqlalchemy] Problem with alias in SQL

2010-07-20 Thread Mariano Mara
Hi there, I have these two tables (with very long column names and most of them with the same names in both tables) I want to join. Since I will be processing the results afterwards, I would like to have shorten names to type less and clearly differentiated names to avoid conflicts. So I pass the

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
On Jul 20, 6:02 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 6:19 PM, Lukasz Szybalski wrote: On Jul 20, 4:55 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 5:10 PM, Lukasz Szybalski wrote: On Jul 20, 3:46 pm, Michael Bayer

Re: [sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 9:39 PM, Lukasz Szybalski wrote: Instead of typing manually column names (column1,column2,...column38 inside the query() I would like to use previous query .keys() to list them there Instead doing:

Re: [sqlalchemy] Re: Creating a custom Visitable

2010-07-20 Thread Michael Bayer
have you found it yet ? http://www.sqlalchemy.org/docs/reference/ext/compiler.html?highlight=compiler#module-sqlalchemy.ext.compiler On Jul 20, 2010, at 2:12 PM, Mike Lewis wrote: I'm not familiar with the compiler extension. Could you elaborate? (my temporary solution is monkey

Re: [sqlalchemy] Problem with alias in SQL

2010-07-20 Thread Michael Bayer
On Jul 20, 2010, at 8:24 PM, Mariano Mara wrote: Hi there, I have these two tables (with very long column names and most of them with the same names in both tables) I want to join. Since I will be processing the results afterwards, I would like to have shorten names to type less and clearly