An Abstraction of SQL variants
⇒ git clone https://github.com/GochoMugo/sql-string-templating.git
⇒ cd sql-string-templating
⇒ python setup.py installimport sqlstr
mysql_builder = sqlstr.MySQL()
sqlite3_builder = sqlstr.SQLite3()
print("showing tables in mysql: {}".format(mysql_builder.build("show_tables")))
print("showing tables in sqlite3: {}".format(sqlite3_builder.build("show_tables")))All SQL variants inherit from the Base class (sqlstr.Base).
Sample SQL variant:
from sqlstr import *
blue_sql_pack = {
"show_tables": "awesome tables come here;"
}
@lang_pack(blue_sql_pack)
@language
class BluSQL(Base):
passEnsure to add any appropriate tests in the test/ directory.
The MIT License (MIT)
Copyright (c) 2014 Gocho Mugo mugo@forfuture.co.ke