Customizing connection behavior
You can execute some queries to specify your connection (i.e. pragmas) using db.on_connect()
decorator.
db = Database()
# entities declaration
@db.on_connect(provider='sqlite')
def sqlite_case_sensitivity(db, connection):
cursor = connection.cursor()
cursor.execute('PRAGMA case_sensitive_like = OFF')
db.bind(**options)
db.generate_mapping(create_tables=True)
With following code each new sqlite connection will call this function. This example shows how to restore old case insensitive like for sqlite.