SQLAlchemy integration

(if you'll be deleting this as part of the switch to using the sqlalchemy query API, it's of course a moot point and you can ignore me)