emmental/db/__init__.py
Anna Schumaker 2822a9ac35 db: Add initial SQL connection object
And set the row_factory to use the built-in sqlite3.Row so we can access
columns by name in search results

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-22 07:33:43 -04:00

13 lines
282 B
Python

# Copyright 2021 (c) Anna Schumaker.
import lib
import sqlite3
File = lib.data.emmental_data / "emmental.sqlite3"
Connection = sqlite3.connect(File)
Connection.row_factory = sqlite3.Row
commit = Connection.commit
execute = Connection.execute
executemany = Connection.executemany