-
-
Notifications
You must be signed in to change notification settings - Fork 121
Description
I've touched on this before in #179 - but now that I've added sqlite-utils memory
this is much more important - because unlike with sqlite-utils insert
the in-memory command doesn't give you the opportunity to fix any types you imported from CSV, so queries like select * from stdin where age > 3
are never going to work correctly against these temporary in-memory tables.
Teaching sqlite-utils insert
to detect types for columns in a CSV file would be a backwards-compatibility breaking change. Teaching sqlite-utils memory
that trick would not be, since it hasn't been included in a release yet.
It's a little inconsistent, but I'm going to have sqlite-utils memory
default to detecting types while sqlite-utils insert
does not. In each case this can be controlled by a new command-line option:
cat file.csv | sqlite-utils memory - --no-detect-types
To opt-in for sqlite-utils insert
:
cat file.csv | sqlite-utils insert blah.db blah - --detect-types
I'll have short options for these too: -n
for --no-detect-types
and -d
for --detect-types
.