mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-02 23:44:12 +02:00
Docs now live at sqlite-utils.datasette.io
This commit is contained in:
parent
8ca35dfb64
commit
6a34426b12
5 changed files with 13 additions and 13 deletions
|
|
@ -427,7 +427,7 @@ You can delete all the existing rows in the table before inserting the new recor
|
|||
|
||||
$ sqlite-utils insert dogs.db dogs dogs.json --truncate
|
||||
|
||||
You can also import newline-delimited JSON using the ``--nl`` option. Since `Datasette <https://datasette.readthedocs.io/>`__ can export newline-delimited JSON, you can combine the two tools like so::
|
||||
You can also import newline-delimited JSON using the ``--nl`` option. Since `Datasette <https://datasette.io/>`__ can export newline-delimited JSON, you can combine the two tools like so::
|
||||
|
||||
$ curl -L "https://latest.datasette.io/fixtures/facetable.json?_shape=array&_nl=on" \
|
||||
| sqlite-utils insert nl-demo.db facetable - --pk=id --nl
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
.. |PyPI| image:: https://img.shields.io/pypi/v/sqlite-utils.svg
|
||||
:target: https://pypi.org/project/sqlite-utils/
|
||||
.. |Changelog| image:: https://img.shields.io/github/v/release/simonw/sqlite-utils?include_prereleases&label=changelog
|
||||
:target: https://sqlite-utils.readthedocs.io/en/stable/changelog.html
|
||||
:target: https://sqlite-utils.datasette.io/en/stable/changelog.html
|
||||
.. |CI| image:: https://github.com/simonw/sqlite-utils/workflows/Test/badge.svg
|
||||
:target: https://github.com/simonw/sqlite-utils/actions
|
||||
.. |License| image:: https://img.shields.io/badge/license-Apache%202.0-blue.svg
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ Specifying foreign keys
|
|||
|
||||
Any operation that can create a table (``.create()``, ``.insert()``, ``.insert_all()``, ``.upsert()`` and ``.upsert_all()``) accepts an optional ``foreign_keys=`` argument which can be used to set up foreign key constraints for the table that is being created.
|
||||
|
||||
If you are using your database with `Datasette <https://datasette.readthedocs.io/>`__, Datasette will detect these constraints and use them to generate hyperlinks to associated records.
|
||||
If you are using your database with `Datasette <https://datasette.io/>`__, Datasette will detect these constraints and use them to generate hyperlinks to associated records.
|
||||
|
||||
The ``foreign_keys`` argument takes a list that indicates which foreign keys should be created. The list can take several forms. The simplest is a list of columns:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue