mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-15 04:54:23 +02:00
alter=True/--alter option to automatically add missing columns
Closes #18
This commit is contained in:
parent
8ab7dcb4f9
commit
eff52023c6
6 changed files with 204 additions and 9 deletions
|
|
@ -232,6 +232,15 @@ You can add a column using the ``add-column`` command::
|
|||
|
||||
The last argument here is the type of the column to be created. You can use one of ``text``, ``integer``, ``float`` or ``blob``. If you leave it off, ``text`` will be used.
|
||||
|
||||
.. _cli_add_column_alter:
|
||||
|
||||
Adding columns automatically on insert/update
|
||||
=============================================
|
||||
|
||||
You can use the ``--alter`` option to automatically add new columns if the data you are inserting or upserting is of a different shape::
|
||||
|
||||
$ sqlite-utils insert dogs.db dogs new-dogs.json --pk=id --alter
|
||||
|
||||
.. _cli_add_foreign_key:
|
||||
|
||||
Adding foreign key constraints
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue