sql.py first draft for bamboodirt