[mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911
Sent: 21 August 2009 07:30
To: sqlalchemy
Subject: [sqlalchemy] Re: index in SA
i want to add a composite index to the class inherited from
declarative_base
I tried this,
class MyClass:
__tablename__ = 'my_table'
id
i want to add a composite index to the class inherited from
declarative_base
I tried this,
class MyClass:
__tablename__ = 'my_table'
id = Column(Integer, primary_key=True)
name = Column(String, nullable=False)
type = Column(String, nullable=False)
__table_args__ = (
...@motorola.com
wrote:
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911
Sent: 21 August 2009 07:30
To: sqlalchemy
Subject: [sqlalchemy] Re: index in SA
i want to add a composite index to the class inherited
...@googlegroups.com] On Behalf Of rajasekhar911
Sent: 21 August 2009 07:30
To: sqlalchemy
Subject: [sqlalchemy] Re: index in SA
i want to add a composite index to the class inherited from
declarative_base
I tried this,
class MyClass:
__tablename__ = 'my_table'
id = Column
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911
Sent: 21 August 2009 10:25
To: sqlalchemy
Subject: [sqlalchemy] Re: index in SA
i tried
class MyClass:
__tablename__ = 'my_table'
id = Column
exactly
On Aug 21, 2:33 pm, King Simon-NFHD78 simon.k...@motorola.com
wrote:
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911
Sent: 21 August 2009 10:25
To: sqlalchemy
Subject: [sqlalchemy] Re: index in SA
If you need to use some SQL is that is not supported by UniqueConstraint,
PrimaryKeyConstraint and friends, you can use the DDL statement:
# DDL to only run on postgres, incorporating declarative style
from sqlalchemy.schema import DDL
DDL('''ALTER TABLE orgdata ADD
this is usually accomplished using Index(). see the metadata docs
for details.
On Aug 20, 2009, at 12:35 PM, rajasekhar911 wrote:
Hi
Is it possible to add index to my table using sqlalchemy?
Or should i do it directly on the database?
Thanks..