Utility functions for working with raw database connections