Introduction¶
sqlstring is a Python library for creating SQL query strings. sqlstring has four query string building classes: SelectBuilder, InsertBuilder UpdateBuilder, and DeleteBuilder.
Here is an an example of crating select query string using SelectBuilder:
from sqlstring.sql_builder import SelectBuilder
builder = SelectBuilder()
builder.from_table('address').where('state_code', '=', " 'CA' ")
builder.where('city', '=', " 'Oakland' ", 'AND')
query_string = builder.get_query_string()
# SELECT * FROM address WHERE state_code = 'CA' AND city = 'Oakland';
Credits¶
sqlstring uses
- sqlize to creat the query strings.
- generator-python-lib to scaffold the project.
- jupyter, nbsphinx, sphinx, sphinx-rtd-theme for documentation.
- ReadTheDocs to host the document.