converted to SQLalchemy

Tests fail :-(