Search code examples
pythonsql

Build SQL queries in Python


Are there any python packages that help generating SQL queries from variables and classes?

For example, instead of writing create query manually, the developer will create a create table (as an object maybe), with desired columns in a list for instance. Then the object will return a string that will be used as a query. It would be a plus if such package can support multiple language syntax (SQLite, Oracle, MySQL, ...)


Solution

  • Probably the best Object-Relational mapper package for Python today is the popular SqlAlchemy.