Type-Safe framework for defining, modifying, and querying SQL databases