kodexa 7.0.8591373231__py3-none-any.whl → 7.0.8599605129__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kodexa/model/persistence.py +8 -5
- {kodexa-7.0.8591373231.dist-info → kodexa-7.0.8599605129.dist-info}/METADATA +1 -1
- {kodexa-7.0.8591373231.dist-info → kodexa-7.0.8599605129.dist-info}/RECORD +5 -5
- {kodexa-7.0.8591373231.dist-info → kodexa-7.0.8599605129.dist-info}/LICENSE +0 -0
- {kodexa-7.0.8591373231.dist-info → kodexa-7.0.8599605129.dist-info}/WHEEL +0 -0
kodexa/model/persistence.py
CHANGED
@@ -114,15 +114,18 @@ class SqliteDocumentPersistence(object):
|
|
114
114
|
disk_cursor = disk_conn.cursor()
|
115
115
|
|
116
116
|
# Load the contents of the disk database into memory
|
117
|
-
disk_cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
|
117
|
+
disk_cursor.execute("SELECT name, sql FROM sqlite_master WHERE type='table';")
|
118
118
|
tables = disk_cursor.fetchall()
|
119
|
-
for
|
120
|
-
|
119
|
+
for table_name, create_table_sql in tables:
|
120
|
+
# Create the table structure in the in-memory database
|
121
|
+
mem_cursor.execute(create_table_sql)
|
122
|
+
|
123
|
+
# Populate the table with data from the disk database
|
121
124
|
disk_cursor.execute(f"SELECT * FROM {table_name}")
|
122
125
|
rows = disk_cursor.fetchall()
|
123
|
-
mem_cursor.execute(f"CREATE TABLE {table_name} AS SELECT * FROM {table_name}", [])
|
124
126
|
for row in rows:
|
125
|
-
|
127
|
+
placeholders = ', '.join('?' * len(row))
|
128
|
+
mem_cursor.execute(f"INSERT INTO {table_name} VALUES ({placeholders})", row)
|
126
129
|
|
127
130
|
# Commit changes and close disk connection
|
128
131
|
mem_conn.commit()
|
@@ -7,7 +7,7 @@ kodexa/model/__init__.py,sha256=rtLXYJBxB-rnukhslN9rlqoB3--1H3253HyHGbD_Gc8,796
|
|
7
7
|
kodexa/model/base.py,sha256=CaZK8nMhT1LdCpt4aLhebJGcorjq9qRID1FjnXnP14M,521
|
8
8
|
kodexa/model/model.py,sha256=vVdz2W1LVXIZEtXFjdIZ3L4wxcGiQB--dQRUkN2VsRw,115491
|
9
9
|
kodexa/model/objects.py,sha256=tDIRVfDCiIKKoRV7K5ctAF94Lg7L4YgwmQRFTN_VtDQ,174772
|
10
|
-
kodexa/model/persistence.py,sha256=
|
10
|
+
kodexa/model/persistence.py,sha256=8VV3keo1otGZhc3YDDvcGJPpUq4nXzXRZWW4ahKnusU,61967
|
11
11
|
kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
|
12
12
|
kodexa/pipeline/pipeline.py,sha256=ZYpJAWcwV4YRK589DUhU0vXGQlkNSj4J2TsGbYqTLjo,25221
|
13
13
|
kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
|
@@ -35,7 +35,7 @@ kodexa/testing/test_components.py,sha256=g5lP-GY0nTHuH5cIEw45vIejEeBaWkPKQGHL36j
|
|
35
35
|
kodexa/testing/test_utils.py,sha256=DrLCkHxdb6AbZ-X3WmTMbQmnVIm55VEBL8MjtUK9POs,14021
|
36
36
|
kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
|
37
37
|
kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
|
-
kodexa-7.0.
|
39
|
-
kodexa-7.0.
|
40
|
-
kodexa-7.0.
|
41
|
-
kodexa-7.0.
|
38
|
+
kodexa-7.0.8599605129.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
39
|
+
kodexa-7.0.8599605129.dist-info/METADATA,sha256=rsFcs2UBq6u1X2t43lGUKPNhpP0GF80WcPGWCZhNweA,3493
|
40
|
+
kodexa-7.0.8599605129.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
41
|
+
kodexa-7.0.8599605129.dist-info/RECORD,,
|
File without changes
|
File without changes
|