simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.58k stars 106 forks source link

str and int as aliases for text and integer #606

Closed simonw closed 7 months ago

simonw commented 7 months ago

I keep making this mistake:

sqlite-utils add-column content.db assets _since int
Usage: sqlite-utils add-column [OPTIONS] PATH TABLE COL_NAME [[integer|float|b
                               lob|text|INTEGER|FLOAT|BLOB|TEXT]]
Try 'sqlite-utils add-column -h' for help.

Error: Invalid value for '[[integer|float|blob|text|INTEGER|FLOAT|BLOB|TEXT]]':
  'int' is not one of 'integer', 'float', 'blob', 'text', 'INTEGER', 'FLOAT', 'BLOB', 'TEXT'.
simonw commented 7 months ago

I'll add bytes too - float already works. This makes sense because when you are working with the Python API you use str and float and bytes and int to specify column types.

simonw commented 7 months ago

Updated documentation: