insert-files can now read from stdin, closes #127

This commit is contained in:
Simon Willison 2020-07-29 20:08:12 -07:00
commit 8fe1e6d1be
3 changed files with 47 additions and 8 deletions

View file

@ -459,6 +459,14 @@ The full list of column definitions you can use is as follows:
``size``
The integer size of the file in bytes
You can insert data piped from standard input like this::
cat dog.jpg | sqlite-utils insert-files dogs.db pics - --name=dog.jpg
The ``-`` argument indicates data should be read from standard input. The string passed using the ``--name`` option will be used for the file name and path values.
When inserting data from standard input only the following column definitions are supported: ``name``, ``path``, ``content``, ``sha256``, ``md5`` and ``size``.
.. _cli_create_table:
Creating tables