Re: [Sqlalchemy-users] Getting mappers back out of SA

2006-05-30 Thread Jamie Wilkinson
This one time, at band camp, Jamie Wilkinson wrote: Is there a way to query SA for the current set of mappers, and get the mapper for a particular class? Yes! It's object_mapper, in sqlalchemy.orm. mapper = object_mapper(instance) --- All

[Sqlalchemy-users] Transaction Error Message

2006-05-30 Thread Ed Suominen
File build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py, line 372, in commit sqlalchemy.exceptions.InvalidRequestError: This transaction is inactive What could be causing this error after trying to do a single transaction.commit() on a transaction object obtained from

[Sqlalchemy-users] Re: bugs...

2006-05-30 Thread Vladimir Iliev
Michael Bayer wrote: vladimir - changeset 1515 fixes both these issues. keep them coming. it fixes the deferred property bug, but the other is still there -- see the attachment. anyways, i think i'm finally ready to switch to sa from our homegrown orm. thanks for your responsiveness!

Re: [Sqlalchemy-users] Rough firebird.py diff for 0.21

2006-05-30 Thread Brad Clements
On 29 May 2006 at 18:38, Michael Bayer wrote: python test/query.py --dburi=firebird://some_firebird_url --verbose All I get is: E:\prj\src\sqlalchemypython test\query.py --dburi=firebird://sysdba:[EMAIL PROTECTED]/e:/temp/p2p.gdb --verbose ERROR test_column_accessor (__main__.QueryTest) ...

Re: [Sqlalchemy-users] Multiple metadata-instances

2006-05-30 Thread Michael Bayer
sure. On May 30, 2006, at 7:34 AM, Arnar Birgisson wrote: Hi there, In 0.2, a metadata instance can be bound to multiple engines. Is the converse also true, i.e. can multiple metadata-instances be bound to the same engine? The case here is TurboGears. TG specifies a schema for

Re: [Sqlalchemy-users] Multiple metadata-instances

2006-05-30 Thread Arnar Birgisson
On 5/30/06, Michael Bayer [EMAIL PROTECTED] wrote: sure. Brilliant, thanks. I tried this and had no problems, just wanted to make sure. Arnar --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained

Re: [Sqlalchemy-users] Re: bugs...

2006-05-30 Thread Michael Bayer
vladimir - changeset 1554 fixes this. the whole concept of how inheritance is dealt with upon a flush() has been morphing into something completely different from what it was in 0.1, so thats why theres continued glitches with this. im hoping itll be solid within a couple of weeks (esp.

[Sqlalchemy-users] suggestion for threadlocal docs

2006-05-30 Thread Brad Clements
regarding http://www.sqlalchemy.org/docs/plugins.myt#plugins_threadlocal The example shown uses a locally declared BoundMetaData object in table declaration. I could not get that to work with my setup, instead I had to use: from sqlalchemy.schema import default_metadata Tregion =

[Sqlalchemy-users] Class relationship diagram, howto write an Engine .. DB2

2006-05-30 Thread Brad Clements
So I am still chipping away on the Firebird engine by just blindly poking it with a stick. But I will need DB2 support in the future. It would be nice to have a diagram that shows how the different classes relate with each other. Execution, Dialect, Connection, Transaction, etc.. Anyway, I

Re: [Sqlalchemy-users] suggestion for threadlocal docs

2006-05-30 Thread Michael Bayer
um yeah the docs for global_connect got whacked, and also the "default metadata" behavior did too, the way thats supposed to work is you make the Table with no metadata at all, and it would fall back on the "default_metadata"so you wouldnt need to import it.ill get that into SVN soon.On May

Re: [Sqlalchemy-users] suggestion for threadlocal docs

2006-05-30 Thread Brad Clements
On 30 May 2006 at 14:26, Michael Bayer wrote: um yeah the docs for global_connect got whacked, and also the default metadata behavior did too, the way thats supposed to work is you make the Table with no metadata at all, and it would fall back on the default_metadataso you wouldnt

Re: [Sqlalchemy-users] suggestion for threadlocal docs

2006-05-30 Thread Michael Bayer
right, i meant, i have to restore that functionality in the trunk. its not there right now. On May 30, 2006, at 2:27 PM, Brad Clements wrote: On 30 May 2006 at 14:26, Michael Bayer wrote: um yeah the docs for global_connect got whacked, and also the default metadata behavior did too, the

Re: [Sqlalchemy-users] Unit of work error?

2006-05-30 Thread Michael Bayer
Hey Nick - I ran this test (which is well-written, youve understood the docs very well) with my favorite constraint checker, Postgres, and it does in fact fail on 0.2.1. Fortunately, it does not fail when testing with the fixes I have just made today, i think its the same issue someone

[Sqlalchemy-users] Re: Unit of work error?

2006-05-30 Thread Nick Joyce
Hey Michael, rev 1554 worked for me - thanks for the quick reply. Cheers, Nick Michael Bayer wrote: Hey Nick - I ran this test (which is well-written, youve understood the docs very well) with my favorite constraint checker, Postgres, and it does in fact fail on 0.2.1. Fortunately, it

[Sqlalchemy-users] getting extra engine params from url

2006-05-30 Thread Brad Clements
I am trying to figure out how to get extra engine specific params from the db url. What I'd like is a url object that populates the standard attributes: self.drivername = drivername self.username = username self.password = password self.host = host

Re: [Sqlalchemy-users] getting extra engine params from url

2006-05-30 Thread Michael Bayer
usually additional params that are specific to a certain database implementation are passed through as keyword arguments to create_engine(): x = create_engine('driver://user:[EMAIL PROTECTED]/db', do_this=True, do_that=False) the **kwargs of create_engine are passed to the constructor of the

[Sqlalchemy-users] possible bug in db.execute handling of positional args

2006-05-30 Thread Brad Clements
in tests/query/QueryTest.test_len r = db.execute('select user_name from query_users', {}).fetchone() What happens is do_execute gets statement 'select user_name, user_id from query_users' params {} notice that params is type dict, not type [] so, kinterbasdb complains

[Sqlalchemy-users] decimal type support in sqlalchemy

2006-05-30 Thread Yuan HOng
I got the schema reflected from a PostgreSQL table, where some fields are defined as numeric type. In sqlalchemy the column type is shown as sqlalchemy.databases.postgres.PGNumeric. It seems that contents of these fields are returned by sqlalchemy as a float instead of a decimal.Decimal object.

Re: [Sqlalchemy-users] getting extra engine params from url

2006-05-30 Thread Luís Bruno
Brad Clements wrote: Michael Bayer wrote: this keeps the URLs completely consistent and provides a nice separation of db-specific vs. db-agnostic. Yeah, but then there's no way I can use sqlalchemy in a generic and non-database specific way via WSGI using PasteDeploy Well, maybe I'm giving

[Sqlalchemy-users] test_column_accessor_shadow

2006-05-30 Thread Brad Clements
Firebird now passes all tests in Query except for test_column_accessor_shadow. It fails probably because __ is not allowed in column names. Is the purpose of this test to test allowed column names, or to test hiding columns that have been declared private? If the later, is there some other

Re: [Sqlalchemy-users] test_column_accessor_shadow

2006-05-30 Thread Michael Bayer
just mark that test as @unsupported('firebird') (in addition to oracle), its to test columns with two underscores in their names and that the RowProxy object allows access to themnot needed for a database which cant have column names with __. keep crankin away ! :) On May 30, 2006,

[Sqlalchemy-users] mapper / testcount

2006-05-30 Thread Brad Clements
Firebird treats the word 'count' as a keyword, so mapper / testcount does this: mapper(User, users) q = create_session().query(User) self.assert_(q.count()==3) self.assert_(q.count(users.c.user_id.in_(8,9))==2) self.assert_(q.count_by(user_name='fred')==1)

[Sqlalchemy-users] Better Firebird patch and test patches

2006-05-30 Thread Brad Clements
The attached firebird engine passes 14 query tests and 48 mapper tests. It also passes some reflection tests, but doesn't extract foreign keys or indexes yet. Attached are some minor changes to tests. The reflection diff changes 'value' to 'val', since 'value' is a keyword for firebird.

Re: [Sqlalchemy-users] Better Firebird patch and test patches

2006-05-30 Thread Michael Bayer
On May 30, 2006, at 8:55 PM, Brad Clements wrote: However I really want to change this so that url.py can parse out extra engine specific params. ok what do you want here, dbengine://user:[EMAIL PROTECTED]:port/database? opt=valopt=val ? as long as its good with RFC1738. did you send

Re: [Sqlalchemy-users] Better Firebird patch and test patches

2006-05-30 Thread Brad Clements
On 30 May 2006 at 21:05, Michael Bayer wrote: Copies to: sqlalchemy-users sqlalchemy-users@lists.sourceforge.net From: Michael Bayer [EMAIL PROTECTED] Subject:Re: [Sqlalchemy-users] Better Firebird patch and test patches Date sent:

Re: [Sqlalchemy-users] Better Firebird patch and test patches

2006-05-30 Thread Michael Bayer
On May 30, 2006, at 9:20 PM, Brad Clements wrote: I did not send a patch. I'm looking at the regex in url._parse_rfc1738_args and trying to decide if I can just change it to.. pattern = re.compile(r''' (\w+):// (?: ([^:]*)