Spaces:
Sleeping
Sleeping
Commit
·
f3d26e4
1
Parent(s):
d3ef38f
chore: hardcoded to first three rows
Browse files
utils_get_db_tables_info.py
CHANGED
@@ -62,7 +62,8 @@ def _get_schema_entries(cursor, sql=None, get_insert_into=False):
|
|
62 |
column_names = [description[0] for description in cursor.description]
|
63 |
|
64 |
# Generate INSERT INTO statements for each row
|
65 |
-
|
|
|
66 |
values = ', '.join(f"'{str(value)}'" if isinstance(value, str) else str(value) for value in row)
|
67 |
insert_stmt = f"INSERT INTO {table} ({', '.join(column_names)}) VALUES ({values});"
|
68 |
entries.append(insert_stmt)
|
|
|
62 |
column_names = [description[0] for description in cursor.description]
|
63 |
|
64 |
# Generate INSERT INTO statements for each row
|
65 |
+
# TODO now hardcoded to first 3
|
66 |
+
for row in rows[:3]:
|
67 |
values = ', '.join(f"'{str(value)}'" if isinstance(value, str) else str(value) for value in row)
|
68 |
insert_stmt = f"INSERT INTO {table} ({', '.join(column_names)}) VALUES ({values});"
|
69 |
entries.append(insert_stmt)
|