mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-14 20:44:11 +02:00
--stop-after option, closes #561
This commit is contained in:
parent
9d38925cde
commit
8c739558f7
4 changed files with 43 additions and 0 deletions
|
|
@ -276,6 +276,7 @@ See :ref:`cli_inserting_data`, :ref:`cli_insert_csv_tsv`, :ref:`cli_insert_unstr
|
|||
--no-headers CSV file has no header row
|
||||
--encoding TEXT Character encoding for input, defaults to utf-8
|
||||
--batch-size INTEGER Commit every X records
|
||||
--stop-after INTEGER Stop after X records
|
||||
--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
|
||||
|
|
@ -330,6 +331,7 @@ See :ref:`cli_upsert`.
|
|||
--no-headers CSV file has no header row
|
||||
--encoding TEXT Character encoding for input, defaults to utf-8
|
||||
--batch-size INTEGER Commit every X records
|
||||
--stop-after INTEGER Stop after X records
|
||||
--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
|
||||
|
|
|
|||
|
|
@ -1237,6 +1237,12 @@ Data is expected to be encoded as Unicode UTF-8. If your data is an another char
|
|||
|
||||
sqlite-utils insert dogs.db dogs dogs.tsv --tsv --encoding=latin-1
|
||||
|
||||
To stop inserting after a specified number of records - useful for getting a faster preview of a large file - use the ``--stop-after`` option:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sqlite-utils insert dogs.db dogs dogs.csv --csv --stop-after=10
|
||||
|
||||
A progress bar is displayed when inserting data from a file. You can hide the progress bar using the ``--silent`` option.
|
||||
|
||||
By default every column inserted from a CSV or TSV file will be of type ``TEXT``. To automatically detect column types - resulting in a mix of ``TEXT``, ``INTEGER`` and ``FLOAT`` columns, use the ``--detect-types`` option (or its shortcut ``-d``).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue