Re: [sqlalchemy] making bindparms required by default

2012-08-27 Thread alex bodnaru
thanks michael, On 08/27/2012 07:49 PM, Michael Bayer wrote: > Here's a patch: > > diff -r 594b0162e8a5 lib/sqlalchemy/sql/expression.py > --- a/lib/sqlalchemy/sql/expression.pyMon Aug 27 12:33:10 2012 -0400 > +++ b/lib/sqlalchemy/sql/expression.pyMon Aug 27 12:43:48 2012 -0400 >

Re: [sqlalchemy] Session query on different server is not returning an object

2012-08-27 Thread Jakob D.
Shouldn't open transactions within the session close when I issue a session.remove() I've also tried combinations of close, rollback and commit. I do not work towards the cacheing in this service. Does an open transaction mean I cannot issue any queries at all before closing them? Because when

[sqlalchemy] is this a sqlalchemy memory leak?

2012-08-27 Thread hackie chain
When I was using sqlalchemy 0.7.8 to manipulate database, it look's like the query have some memory leak..I have googled this problem for a long time, but no gains. I have tried run this snippet in a while loop. The code eat 1M every 5 second. environment is Python 2.7.3, mysql 5.5.25a, fedora

Re: [sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 5:16 PM, Jacob Biesinger wrote: > On Mon, Aug 27, 2012 at 4:57 PM, Michael Bayer > wrote: > > On Aug 27, 2012, at 4:43 PM, Jacob Biesinger wrote: > >> >> Is the use case of having nested collections really all that out of >> mainstream? > > I would think just about any

Re: [sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Jacob Biesinger
On Mon, Aug 27, 2012 at 4:57 PM, Michael Bayer wrote: > > On Aug 27, 2012, at 4:43 PM, Jacob Biesinger wrote: > > > Is the use case of having nested collections really all that out of > mainstream? > > > I would think just about any non-trivial application winds up having > "nested collections".

Re: [sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 4:43 PM, Jacob Biesinger wrote: > > Is the use case of having nested collections really all that out of > mainstream? I would think just about any non-trivial application winds up having "nested collections".In relational databases this just means you have one-to-many

Re: [sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Jacob Biesinger
On Mon, Aug 27, 2012 at 4:16 PM, Jacob Biesinger wrote: > On Mon, Aug 27, 2012 at 3:56 PM, Michael Bayer > wrote: > >> >> On Aug 27, 2012, at 3:54 PM, Michael Bayer wrote: >> >> >> On Aug 27, 2012, at 3:50 PM, Jacob Biesinger wrote: >> >> Hi all, >> >> Re-asking a question from stackoverflow here

Re: [sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Jacob Biesinger
On Mon, Aug 27, 2012 at 3:56 PM, Michael Bayer wrote: > > On Aug 27, 2012, at 3:54 PM, Michael Bayer wrote: > > > On Aug 27, 2012, at 3:50 PM, Jacob Biesinger wrote: > > Hi all, > > Re-asking a question from stackoverflow here. > http://stackoverflow.com/questions/12148503/arbitrary-collections-in

Re: [sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 3:54 PM, Michael Bayer wrote: > > On Aug 27, 2012, at 3:50 PM, Jacob Biesinger wrote: > >> Hi all, >> >> Re-asking a question from stackoverflow here. >> http://stackoverflow.com/questions/12148503/arbitrary-collections-in-sqlalchemy-with-referential-integrity >> >> I'm

Re: [sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 3:50 PM, Jacob Biesinger wrote: > Hi all, > > Re-asking a question from stackoverflow here. > http://stackoverflow.com/questions/12148503/arbitrary-collections-in-sqlalchemy-with-referential-integrity > > I'm converting a library to use SA as the datastore. I like the flex

[sqlalchemy] PickleType collections of rows?

2012-08-27 Thread Jacob Biesinger
Hi all, Re-asking a question from stackoverflow here. http://stackoverflow.com/questions/12148503/arbitrary-collections-in-sqlalchemy-with-referential-integrity I'm converting a library to use SA as the datastore. I like the flexibility of the PickleType column, but it doesn't seem to work we

Re: [sqlalchemy] making bindparms required by default

2012-08-27 Thread Michael Bayer
I'm super-hot to get the first betas of 0.8 out the door, and as this is a backwards-compatability-sensitive change, I was in a super rush to get this in, so it's in tip. On Aug 27, 2012, at 12:49 PM, Michael Bayer wrote: > Here's a patch: > > diff -r 594b0162e8a5 lib/sqlalchemy/sql/expressi

Re: [sqlalchemy] sort/compare in synonym_for

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 10:59 AM, Michael Bayer wrote: > > On Aug 27, 2012, at 4:29 AM, jeetu wrote: > >> >> As for hybrid_property, its really the thing. But it requires an explicit >> join statement in query. And as you rightly pointed out, most probably tw2 >> query do not support joins. > >

Re: [sqlalchemy] making bindparms required by default

2012-08-27 Thread Michael Bayer
Here's a patch: diff -r 594b0162e8a5 lib/sqlalchemy/sql/expression.py --- a/lib/sqlalchemy/sql/expression.py Mon Aug 27 12:33:10 2012 -0400 +++ b/lib/sqlalchemy/sql/expression.py Mon Aug 27 12:43:48 2012 -0400 @@ -3110,7 +3110,7 @@ typemap[key] = sqltypes.to_instance(typemap[key

[sqlalchemy] making bindparms required by default

2012-08-27 Thread alex bodnaru
hello friends, for a migrated system, i'm using textual queries in the form: dbsession.execute("select name from table where id=:id", dict(id=1)) to my surprise, "select ... id=:idd" would still "work", asuming idd is null, despite 'idd' is not in bindparms. a 'required' argument to bindparam

[sqlalchemy] modeling a has-a relationship

2012-08-27 Thread Littlefield, Tyler
Hello all: I'm looking at how to model this setup. I have objects in a game, that are called entities. Each entity has a list of components, which inherit the component class. A living component might have attributes like hp, max_hp, etc along with the component properties. So: I'm trying to f

Re: [sqlalchemy] sort/compare in synonym_for

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 4:29 AM, jeetu wrote: > > As for hybrid_property, its really the thing. But it requires an explicit > join statement in query. And as you rightly pointed out, most probably tw2 > query do not support joins. no, this isn't accurate. a hybrid can emit a correlated subquery

Re: [sqlalchemy] Session query on different server is not returning an object

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 4:00 AM, Jakob D. wrote: > Hi! > > I have a problem and I cannot figure out whats wrong. I thought might get > some ideas here. > > On one server a Project instance is committed, and I know for sure it's in > the db. > > But on another server querying that object returns

Re: [sqlalchemy] sort/compare in synonym_for

2012-08-27 Thread Michael Bayer
On Aug 27, 2012, at 4:29 AM, jeetu wrote: > > Thanks Michael. I'll go through your solutions one by one and will try to > understand them. > > For synonym_for as per I understood from the examples it just provides a > convenient name (sort of alias) for querying. I have the spin off advantage

Re: [sqlalchemy] sort/compare in synonym_for

2012-08-27 Thread jeetu
Thanks Michael. I'll go through your solutions one by one and will try to understand them. For synonym_for as per I understood from the examples it just provides a convenient name (sort of alias) for querying. I have the spin off advantage using it that it shows up in toscawidget sqlajqgrid as

[sqlalchemy] Session query on different server is not returning an object

2012-08-27 Thread Jakob D.
Hi! I have a problem and I cannot figure out whats wrong. I thought might get some ideas here. On one server a Project instance is committed, and I know for sure it's in the db. But on another server querying that object returns None: Project.query.filter_by(id=project_id).first() The scoped