diff --git a/nomen/db.py b/nomen/db.py index c9baabc..6eb708d 100644 --- a/nomen/db.py +++ b/nomen/db.py @@ -96,6 +96,11 @@ aiosqlite.Connection.fetch_exists = fetch_exists aiosqlite.Connection.fetch_unpacked = fetch_unpacked +class Row(sqlite3.Row): + def __repr__(self): + return f"Row<{repr(dict(self))}>" + + async def setup_db(db_file): log.debug(f"Connecting to {db_file}") db = await aiosqlite.connect(db_file) @@ -108,7 +113,7 @@ async def setup_db(db_file): """) log.debug("Setting row factory") - db.row_factory = sqlite3.Row + db.row_factory = Row log.debug("Adding contains function") await db.create_function("contains", 3, contains, deterministic=True)