[sqlalchemy] Re: creating a database through SQLAlchemy

2007-09-03 Thread Marco Mariani
Travis Kriplean ha scritto: However, this seems a bit ugly. Is there a way to obtain a non- transactional connection from an engine in 0.3.10? If not, is it possible in 0.4? I use this with SA 0.3.10 and Postgres:

[sqlalchemy] SA does implicit cascading

2007-09-03 Thread Anton V. Belyaev
Hello, here is a sample: children_table = Table('children', metadata, Column('id', Integer, primary_key=True)) child2group_table = Table('child2group', metadata, Column('child_id', Integer, ForeignKey('children.id'),

[sqlalchemy] Re: sql executemany and postgresql - probably bug

2007-09-03 Thread che
Hi, this issue (#759) seems fixed with the SA0.4b5. Thanks, Michael. One additional question concerning last_inserted_ids() - is it supposed to work below: ... isql = Insert( table_Manager, values= {'name':bindparam('name'), 'duties':bindparam('duties r2 = con.execute( isql, [

[sqlalchemy] A question about shard strategy

2007-09-03 Thread 黄毅
I have read about hibernate's shard strategyhttp://www.hibernate.org/hib_docs/shards/reference/en/html/shards-shardstrategy.html , and sqlalchemy's shard implementation. which remind me of a system in my company which implemented similar function, but both hibernate and sqlalchemy only separate

[sqlalchemy] Re: sql executemany and postgresql - probably bug

2007-09-03 Thread Michael Bayer
On Sep 3, 2007, at 4:38 AM, che wrote: Hi, this issue (#759) seems fixed with the SA0.4b5. Thanks, Michael. One additional question concerning last_inserted_ids() - is it supposed to work below: ... isql = Insert( table_Manager, values= {'name':bindparam('name'),

[sqlalchemy] Re: A question about shard strategy

2007-09-03 Thread Michael Bayer
i think multiple tables within one database is not that common since you get all the downside of a sharded approach but not so much of the performance enhancement of moving the load over to a new server. also a lot of DBAs would be skeptical that one big table is so much slower than

[sqlalchemy] Self referencing keys

2007-09-03 Thread voltron
Excuse the newbie question, how does one declare a sef-referencing key? I would like to have fields modified_by and created_by in my users table, the field should refer back to the user id or user name in the same table. Thanks --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: Self referencing keys

2007-09-03 Thread voltron
would this work? users = Table(users, metadata, Column(id,Integer,primary_key=True), Column(username, String(50),unique=True, nullable=False), Column(password, String(255)), Column(email, String(255),unique=True, nullable=False),

[sqlalchemy] Re: Self referencing keys

2007-09-03 Thread sdobrev
On Monday 03 September 2007 19:57:54 voltron wrote: would this work? users = Table(users, metadata, Column(id,Integer,primary_key=True), Column(username, String(50),unique=True, nullable=False), Column(password, String(255)), Column(email,

[sqlalchemy] insert of a sequence of dictionaries

2007-09-03 Thread Moshe C.
The following line: r = cnnctn.execute(insert(t), {'xkey': 'k1','yval':1}, {'xkey': 'k2','yval':2}, {'xkey': 'k3'}) Cause the following : INSERT INTO `A` (xkey, yval) VALUES (%s, %s) [['k1', 1], ['k2', 2], ['k3', 1]] i.e. the unspecified value in the

[sqlalchemy] Re: Self referencing keys

2007-09-03 Thread sdobrev
A pointing to A, is cyclical dependency. same as A - B - A. but in latter case u must choose one of the links to be added later, that is use_later=True for ForeignKey. in former case the table declaration may or may not work without use_alter. in both cases u need post_update=True for the