str, int, bytes aliases for column types, closes #606

This commit is contained in:
Simon Willison 2023-12-06 10:49:21 -08:00
commit 88bd372205
5 changed files with 32 additions and 3 deletions

View file

@ -1157,7 +1157,7 @@ See :ref:`cli_add_column`.
::
Usage: sqlite-utils add-column [OPTIONS] PATH TABLE COL_NAME
[[integer|float|blob|text|INTEGER|FLOAT|BLOB|TEXT]]
[[integer|int|float|text|str|blob|bytes]]
Add a column to the specified table

View file

@ -2310,7 +2310,14 @@ You can add a column using the ``add-column`` command:
sqlite-utils add-column mydb.db mytable nameofcolumn text
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.
The last argument here is the type of the column to be created. This can be one of:
- ``text`` or ``str``
- ``integer`` or ``int``
- ``float``
- ``blob`` or ``bytes``
This argument is optional and defaults to ``text``.
You can add a column that is a foreign key reference to another table using the ``--fk`` option: