Spaces:
Paused
Paused
Update openspace/skill_engine/store.py
Browse files
openspace/skill_engine/store.py
CHANGED
|
@@ -226,7 +226,15 @@ class SkillStore:
|
|
| 226 |
if read_only:
|
| 227 |
conn.execute("PRAGMA query_only=ON")
|
| 228 |
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
return conn
|
| 231 |
|
| 232 |
@contextmanager
|
|
|
|
| 226 |
if read_only:
|
| 227 |
conn.execute("PRAGMA query_only=ON")
|
| 228 |
|
| 229 |
+
# libsql-experimental doesn't have a Row factory built-in like sqlite3
|
| 230 |
+
# conn.row_factory = sqlite3.Row
|
| 231 |
+
|
| 232 |
+
# We need a custom row factory to return dict-like objects
|
| 233 |
+
def dict_factory(cursor, row):
|
| 234 |
+
fields = [column[0] for column in cursor.description]
|
| 235 |
+
return {key: value for key, value in zip(fields, row)}
|
| 236 |
+
|
| 237 |
+
conn.row_factory = dict_factory
|
| 238 |
return conn
|
| 239 |
|
| 240 |
@contextmanager
|