Database abstraction improvements