I've been doing this in my test scripts to 'clear the ground' before I
do real work.

for foo in Foo.query.filter_by(bar_id=1):
    foo.delete()
elixir.session.clear()

But that's painfully slow.  What I want is the equivalent of sending
"delete from foo where bar_id = 1" directly to the database server.

I know I can do it with SQLAlchemy:

engine = sqlalchemy.engine.create_engine("postgres://...")
conn = engine.connect()
conn.execute(Foo.table.delete(Foo.c.bar_id == 1))

but is there a way for me to get a connection or engine staring from
elixir.metadata or elixir.session?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to