Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support passing row_factory parameter to SQLite provider. #495

Open
wants to merge 2 commits into
base: orm
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pony/orm/dbproviders/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ class SQLitePool(Pool):
def __init__(pool, filename, create_db, **kwargs): # called separately in each thread
pool.filename = filename
pool.create_db = create_db
pool.row_factory = kwargs.pop("row_factory", None)
pool.kwargs = kwargs
pool.con = None
def _connect(pool):
Expand All @@ -643,6 +644,7 @@ def _connect(pool):
throw(IOError, "Database file is not found: %r" % filename)
pool.con = con = sqlite.connect(filename, isolation_level=None, **pool.kwargs)
con.text_factory = _text_factory
con.row_factory = pool.row_factory

def create_function(name, num_params, func):
func = keep_exception(func)
Expand Down