A python db layer with sql compiler