> > > http://www.sqlalchemy.org/docs/04/sqlexpression.html
yes, I've already been read that, but I am using TurboGears and using session if you mean that youd like to execute using the "Session" itself, use > the execute() method on Session and you probably want to bind your > Session to the engine directly: > > http://www.sqlalchemy.org/docs/04/session.html#unitofwork_sql I see at documentation that Session.execute() is deprecated and now we need to use Session.query(Class/Mapper).from_statement(stmt) instead so it requires a mapper or a Class as parameter, and I don“t have sucess trying to do it witout a class. like a flat SQL file ? just read the file and execute each > line....for line in file('myfile.txt'): engine.execute(line) Yes like a flat SQL file, and for simple inserts and/or updates I do exactly this, but it is not so usefull if I need to execure multiline statements, like: CREATE OR REPLACE FUNCTION..... $ function body .. .. $... to do it properly I think I need to write all in one line. otherwise I already no tried to create any database function using this method. if that is no way to do similar thigs I will maintain my old flat sql files and execute direct to database, I just ask it because if I have this feature, I can do things like, create a single sql file to each database object related to one table, like an after insert trigger, or any other kind of object I need. for now, to perform default data inserts I will import my model and use session.query(Class).from_statement(stmt).all(), it is working properly thank you very much for reply Alexandre --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
