File "../python3.7/site-packages/csvs_to_sqlite/cli.py", line 198, in cli
if replace_tables and table_exists(conn, df.table_name):
File "../python3.7/site-packages/csvs_to_sqlite/utils.py", line 260, in table_exists
[table],
sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.
How the error is resolved
If the input CSV's table_name header is changed to anything else, e.g. tbl_name, then csvs-to-sqlite works as expected
Suggested fix
Haven't looked at the code yet, but my initial thought is that it'd be nice if csvs-to-sqlite silently handled this somehow, maybe changing table_name (and any other reserved words), to a string with a specified prefix/suffix, e.g. table_name__fixed__. Then again, maybe silently handling this kind of thing can lead to messy usecases later?
(This is for
csvs-to-sqlite=1.0
, usingPython 3.7
)How to reproduce the error
Given a CSV that has
table_name
as one of its column headers, e.g. this OSHA data dictionary.csvcsvs-to-sqlite
throws an error:How the error is resolved
If the input CSV's
table_name
header is changed to anything else, e.g.tbl_name
, then csvs-to-sqlite works as expectedSuggested fix
Haven't looked at the code yet, but my initial thought is that it'd be nice if csvs-to-sqlite silently handled this somehow, maybe changing
table_name
(and any other reserved words), to a string with a specified prefix/suffix, e.g.table_name__fixed__
. Then again, maybe silently handling this kind of thing can lead to messy usecases later?