sample of how to interact with db in a pythonic way