[sqlalchemy] Re: Default data and table related database objects

2007-12-21 Thread Michael Bayer
On Dec 21, 9:48 am, simpsomboy [EMAIL PROTECTED] wrote: I need to create some database objects(like a trigger) and insert some initial data into table after creation, so I need to know if have some way to do it transparent on sqlalchemy database trigger syntax is pretty database specific

[sqlalchemy] Re: Default data and table related database objects

2007-12-21 Thread Michael Bayer
On Dec 21, 2007, at 11:09 AM, Alexandre da Silva wrote: it would be just a Method like after_create_execute(SOME DATABASE SPECIFIC SQL), and this method should be called after creation of table, but just on creation... would be usefull have an before_drop_execute(SOME STATEMENT) to make

[sqlalchemy] Re: Default data and table related database objects

2007-12-21 Thread Alexandre da Silva
database trigger syntax is pretty database specific so we dont have a generic DDL construct for that right now. you can issue the DDL using a textual execute like engine.execute(CREATE TRIGGER ...). for inserting of data you usually would use a table.insert() construct. ok, it helps if I

[sqlalchemy] Re: Default data and table related database objects

2007-12-21 Thread Alexandre da Silva
we have a ticket in the works for this: http://www.sqlalchemy.org/trac/ticket/903 ok, I will look at this ticket. note that this feature applies to Table objects, not ORM mapped classes. A central tenet of SQLAlchemy is that the object relational mapper is an optional package which