add this: db.transaction() 2011/6/17 Anand Chitipothu <[email protected]>
> 2011/6/17 [email protected] <[email protected]>: > > I need to migrate a large scientific database app to PostgreSQL > > ("PG"). I'm trying to determine if web.py is the way to go. > > > > It appears that web.py's "db" module is mostly for simple SQL, such > > as SELECT, UPDATE, DELETE, etc. I will need to work with UNION > > queries, create tables on-the-fly, and deal with PG-specific date/time > > types, not to mention use elaborate JOINs. Basically, I will need to > > feed custom SQL to PG, and have complete control. > > > > Forgive me if I don't have all this terminology right. I am hacking > > this fast, for an overview. It looks like the only way to send a raw > > query to a web.py DB connection is with the hidden "_db_execute" > > method, which I don't think is good practice. Is there an upfront > > method to send raw SQL and get whatever PG sends back? > > > > If this is not what web.py is for, any suggestions? > > You can use db.query. Here is a sample usage. > > db.query("SELECT * FROM foo JOIN bar ON bar.id=foo.id WHERE foo.name > in $names", vars={"names": ["a", "b"]}) > > Anand > > -- > You received this message because you are subscribed to the Google Groups > "web.py" 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/webpy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "web.py" 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/webpy?hl=en.
