update sql definition slightly
flesh out a few more data methods, fix imports