mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-01 23:14:12 +02:00
sqlite-utils insert/upsert --type colunm-name type option, closes #131
This commit is contained in:
parent
092f0919c3
commit
d2ac3765ed
5 changed files with 102 additions and 1 deletions
|
|
@ -246,6 +246,9 @@ See :ref:`cli_inserting_data`, :ref:`cli_insert_csv_tsv`, :ref:`cli_insert_unstr
|
|||
- Use --lines to write each incoming line to a column called "line"
|
||||
- Use --text to write the entire input to a column called "text"
|
||||
|
||||
Use --type column-name type to override the type automatically chosen when the
|
||||
table is created.
|
||||
|
||||
You can also use --convert to pass a fragment of Python code that will be used
|
||||
to convert each input.
|
||||
|
||||
|
|
@ -306,6 +309,7 @@ See :ref:`cli_inserting_data`, :ref:`cli_insert_csv_tsv`, :ref:`cli_insert_unstr
|
|||
--alter Alter existing table to add any missing columns
|
||||
--not-null TEXT Columns that should be created as NOT NULL
|
||||
--default <TEXT TEXT>... Default value that should be set for a column
|
||||
--type <TEXT CHOICE>... Column types to use when creating the table
|
||||
--no-detect-types Treat all CSV/TSV columns as TEXT
|
||||
--analyze Run ANALYZE at the end of this operation
|
||||
--load-extension TEXT Path to SQLite extension, with optional :entrypoint
|
||||
|
|
@ -335,6 +339,9 @@ See :ref:`cli_upsert`.
|
|||
|
||||
If the table already exists and has a primary key, --pk can be omitted.
|
||||
|
||||
Use --type column-name type to override the type automatically chosen when the
|
||||
table is created.
|
||||
|
||||
Example:
|
||||
|
||||
echo '[
|
||||
|
|
@ -366,6 +373,7 @@ See :ref:`cli_upsert`.
|
|||
--alter Alter existing table to add any missing columns
|
||||
--not-null TEXT Columns that should be created as NOT NULL
|
||||
--default <TEXT TEXT>... Default value that should be set for a column
|
||||
--type <TEXT CHOICE>... Column types to use when creating the table
|
||||
--no-detect-types Treat all CSV/TSV columns as TEXT
|
||||
--analyze Run ANALYZE at the end of this operation
|
||||
--load-extension TEXT Path to SQLite extension, with optional :entrypoint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue