[sqlalchemy] TypeError: synonym() got an unexpected keyword argument

2010-04-14 Thread jose soares
Hi all, seems synonym in version 0.6 don't have proxy parameter. 'user_name' : synonym('logname', proxy=True), TypeError: synonym() got an unexpected keyword argument 'proxy' j -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this

[sqlalchemy] Re: TypeError: synonym() got an unexpected keyword argument

2010-04-14 Thread GHZ
Hi, http://www.sqlalchemy.org/changelog/CHANGES_0_6beta3 * 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the proxy generation behavior is now automatic. On 14 apr, 13:16, jose soares jose.soa...@sferacarta.com wrote: Hi all, seems

Re: [sqlalchemy] Re: TypeError: synonym() got an unexpected keyword argument

2010-04-14 Thread jose soares
Yes I see, now, thank you, Williams. j GHZ wrote: Hi, http://www.sqlalchemy.org/changelog/CHANGES_0_6beta3 * 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the proxy generation behavior is now automatic. On 14 apr, 13:16, jose

[sqlalchemy] KeyError when reflecting mssql tables that contains indexes with non alphanumeric chars in field names

2010-04-14 Thread ogg...@gmail.com
Hi, I'm just testing version 0.6 beta 3 with mssql and I've discovered that reflecting tables with indexes that contains fields with blank spaces raises a KeyError. To correct this I've changed sqlalchemy.dialects.mssql.base: --- sqlalchemy/dialects/mssql/base.py.orig2010-04-14

Re: [sqlalchemy] Inserting comments into SQL queries

2010-04-14 Thread Michael Bayer
Conor wrote: George V. Reilly wrote: I'm at the MySQL conference. A couple of speakers have recommended adding SQL comments to queries for debugging; e.g., attributing a query to a higher-level operation, or that can be parsed by a slave during replication. Is there a way to do this in

Re: [sqlalchemy] KeyError when reflecting mssql tables that contains indexes with non alphanumeric chars in field names

2010-04-14 Thread Michael Bayer
ogg...@gmail.com wrote: Hi, I'm just testing version 0.6 beta 3 with mssql and I've discovered that reflecting tables with indexes that contains fields with blank spaces raises a KeyError. To correct this I've changed sqlalchemy.dialects.mssql.base: ---

[sqlalchemy] deleting

2010-04-14 Thread Sebastian Elsner
Hello, I am unsure on how to delete correctly. Lets say I have a query's result, which is a list. del list[5] does not seem to do anything, right? I would always have to do session.delete(list[5])? But what about when I created a mapped object, which is not yet persistent, how would I

Re: [sqlalchemy] deleting

2010-04-14 Thread Alexandre Conrad
2010/4/14 Sebastian Elsner sebast...@risefx.com: I am unsure on how to delete correctly. Lets say I have a query's result, which is a list. del list[5] does not seem to do anything, right? I would always have to do session.delete(list[5])? Correct. del list[5] only delete the instance in

[sqlalchemy] copy database from MS SQL Server database to PostgreSQL database

2010-04-14 Thread Tan Yi
So what I want to do is to reflect all the tables in an existing MS SQL Server database, and use for loop on sorted_tables list and tometadata() function to create a new PostgreSQL database. However, there are some datatype incompatibility. Got an exception about collation on MS SQL server tables.

[sqlalchemy] drop all keys, indexes, permissions, views, etc.

2010-04-14 Thread Gerry Reno
I would like to be able to drop all foreign keys, then drop all indexes, drop all permissions, drop all views then drop all tables. I went looking for methods like DropForeignKeys, DropView, DropPermissions but there are no such method names. How can I perform all these actions in a batch

Re: [sqlalchemy] drop all keys, indexes, permissions, views, etc.

2010-04-14 Thread Michael Bayer
dropping tables implicitly drops indexes and foreign keys.For views we have a recipe at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Views . For permissions, those vary wildly across backends and we have no support for that built in, however you can again roll that yourself using the

[sqlalchemy] Re: drop all keys, indexes, permissions, views, etc.

2010-04-14 Thread Gerry Reno
Thanks Mike. I'll check out the links. -Gerry -- 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 group, send email to

[sqlalchemy] DropConstraint exception

2010-04-14 Thread Gerry Reno
Ok, I tried this: from sqlalchemy.schema import DropConstraint for table in metadata.tables.keys(): for con in metadata.tables[table].constraints: if isinstance(con, PrimaryKeyConstraint): engine.execute(DropConstraint(con)) but I'm getting an exception:

[sqlalchemy] Concrete table inheritance without a master table

2010-04-14 Thread WDyk
I've got a legacy database that I need to work through the following scenario with. There are four types of objects, completions, meters, tanks and equipment. Each has its own table. There is no master table representing all the entities. There is a connection table that describes the

Re: [sqlalchemy] DropConstraint exception

2010-04-14 Thread Michael Bayer
seems like a bug, actually. does that PrimaryKeyConstraint have a name ? we don't usually issue a DropConstraint on a PK constraint like that. On Apr 14, 2010, at 7:35 PM, Gerry Reno wrote: Ok, I tried this: from sqlalchemy.schema import DropConstraint for table in

Re: [sqlalchemy] Concrete table inheritance without a master table

2010-04-14 Thread Michael Bayer
On Apr 14, 2010, at 7:51 PM, w...@nobleenergyinc.com wrote: I've got a legacy database that I need to work through the following scenario with. There are four types of objects, completions, meters, tanks and equipment. Each has its own table. There is no master table representing all

[sqlalchemy] Re: DropConstraint exception

2010-04-14 Thread Gerry Reno
The PrimaryKeyConstraints were created like this: category = Table('category', metadata, Column('name', String (64), nullable=False ), ... PrimaryKeyConstraint('name'), ) -Gerry -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

Re: [sqlalchemy] Re: DropConstraint exception

2010-04-14 Thread Michael Bayer
PrimaryKeyConstraint(name='name') On Apr 14, 2010, at 8:22 PM, Gerry Reno wrote: category = Table('category', metadata, Column('name', String (64), nullable=False ), ... PrimaryKeyConstraint('name'), ) -- You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: DropConstraint exception

2010-04-14 Thread Gerry Reno
What do I do then for a composite primary key? PrimaryKeyConstraint('col1','col2') -Gerry On Apr 14, 9:13 pm, Michael Bayer mike...@zzzcomputing.com wrote: PrimaryKeyConstraint(name='name') On Apr 14, 2010, at 8:22 PM, Gerry Reno wrote: category = Table('category', metadata,    

[sqlalchemy] Re: DropConstraint exception

2010-04-14 Thread Gerry Reno
Ok, I tried with the keyword but I get this using 0.6beta1: PrimaryKeyConstraint(id='id'), File /usr/lib/python2.5/site-packages/sqlalchemy/schema.py, line 1391, in __init__ super(ColumnCollectionConstraint, self).__init__(**kw) TypeError: __init__() got an unexpected keyword argument

Re: [sqlalchemy] Re: DropConstraint exception

2010-04-14 Thread Michael Bayer
don't know why you'd be using beta1 when we're up to beta3.heres a fully working example: from sqlalchemy import * from sqlalchemy.schema import * metadata = MetaData() c1 = Table('category', metadata, Column('name', String (64), nullable=False ), PrimaryKeyConstraint('name',