mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 01:44:31 +02:00
Don't detect types on JSON input to memory, closes #283
This commit is contained in:
parent
ec5174ed40
commit
dc94f4bb8c
3 changed files with 19 additions and 16 deletions
|
|
@ -1241,9 +1241,9 @@ def memory(
|
|||
csv_path = pathlib.Path(path)
|
||||
csv_table = csv_path.stem
|
||||
csv_fp = csv_path.open("rb")
|
||||
rows = rows_from_file(csv_fp, format=format, encoding=encoding)
|
||||
rows, format_used = rows_from_file(csv_fp, format=format, encoding=encoding)
|
||||
tracker = None
|
||||
if not no_detect_types:
|
||||
if format_used in (Format.CSV, Format.TSV) and not no_detect_types:
|
||||
tracker = TypeTracker()
|
||||
rows = tracker.wrap(rows)
|
||||
db[csv_table].insert_all(rows, alter=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue