[sqlalchemy] Distribute Source for Debugging?

2015-01-09 Thread Lycovian
I'm attempting to debug a custom dialect using pudb. Once my custom create_connect_args function returns to strategies.py pudb stops showing me the source. I assume this is because SQLAlchemy is installed as a bdist. Is there a way to install SQLAlchemy such that the source is part of the di

[sqlalchemy] Slow commit after large select

2015-01-09 Thread Ed Rahn
I have the following bit of code: horses = (data.session.query(data.Horse). filter(or_(data.Horse.sire == None, data.Horse.dam == None)). filter(data.Horse.skip_pedigree == False, data.Horse.foaled != None)) data.session.commit() f

Re: [sqlalchemy] Difficulty pre-populating session without using .get

2015-01-09 Thread Michael Bayer
Jon Nelson wrote: > On Fri, Jan 9, 2015 at 2:42 PM, Jon Nelson wrote: >> On Fri, Jan 9, 2015 at 2:21 PM, Michael Bayer >> wrote: >>> Jon Nelson wrote: >>> > so you could use either merge() or merge_result() but to avoid any SQL > set load=False. When I tried with load=F

Re: [sqlalchemy] Difficulty pre-populating session without using .get

2015-01-09 Thread Jon Nelson
On Fri, Jan 9, 2015 at 2:42 PM, Jon Nelson wrote: > On Fri, Jan 9, 2015 at 2:21 PM, Michael Bayer > wrote: >> >> >> Jon Nelson wrote: >> >>> so you could use either merge() or merge_result() but to avoid any SQL set load=False. >>> >>> When I tried with load=False, I got an error. I

Re: [sqlalchemy] Difficulty pre-populating session without using .get

2015-01-09 Thread Jon Nelson
On Fri, Jan 9, 2015 at 2:21 PM, Michael Bayer wrote: > > > Jon Nelson wrote: > >> >>> so you could use either merge() or merge_result() but to avoid any SQL set >>> load=False. >> >> When I tried with load=False, I got an error. I am using 0.9.8. > > care to be more specific Absolutely. It to

Re: [sqlalchemy] Difficulty pre-populating session without using .get

2015-01-09 Thread Michael Bayer
Jon Nelson wrote: > >> so you could use either merge() or merge_result() but to avoid any SQL set >> load=False. > > When I tried with load=False, I got an error. I am using 0.9.8. care to be more specific -- You received this message because you are subscribed to the Google Groups "sqla

Re: [sqlalchemy] Difficulty pre-populating session without using .get

2015-01-09 Thread Jon Nelson
On Fri, Jan 9, 2015 at 1:19 PM, Michael Bayer wrote: > > > Jon Nelson wrote: > >> I'm having a bit of trouble. >> Let's say I have N primary key IDs for a set of objects. >> I want to load all of those objects into the session, but I'd like that to >> happen all in one query. >> >> dbsess.query(

Re: [sqlalchemy] Difficulty pre-populating session without using .get

2015-01-09 Thread Michael Bayer
Jon Nelson wrote: > I'm having a bit of trouble. > Let's say I have N primary key IDs for a set of objects. > I want to load all of those objects into the session, but I'd like that to > happen all in one query. > > dbsess.query(object_type).filter(object_type.primary_key.in_(some_list_of_ids

[sqlalchemy] Difficulty pre-populating session without using .get

2015-01-09 Thread Jon Nelson
I'm having a bit of trouble. Let's say I have N primary key IDs for a set of objects. I want to load all of those objects into the session, but I'd like that to happen all in one query. dbsess.query(object_type).filter(object_type.primary_key.in_(some_list_of_ids)).all() # then I made (one or mo

Re: [sqlalchemy] DefaultClause

2015-01-09 Thread Michael Bayer
you can use DefaultClause if you give it a text() object so that the quoting behavior is defined. server_default is a shortcut for that. jo wrote: > Do you suggest to use server_default instead of DefaultClause in all cases? > j > Il giorno giovedì 8 gennaio 2015 15:17:20 UTC+1, Michael Bayer

Re: [sqlalchemy] DefaultClause

2015-01-09 Thread jo
Do you suggest to use server_default instead of DefaultClause in all cases? j Il giorno giovedì 8 gennaio 2015 15:17:20 UTC+1, Michael Bayer ha scritto: > > use server_default with text() as documented at > http://docs.sqlalchemy.org/en/rel_0_9/core/defaults.html#server-side-defaults. > > > > >