Command-line interface ====================== .. warning:: This project is **no longer maintained** as of February 2023. It is recommended that you use a proper ORM like `SQLAlchemy `_ or `Django's ORM `_ instead. The isqlite Python library comes with a command-line program called ``isqlite`` that allows you to query and change SQLite databases from the command line. This page describes the basics of each command supported by ``isqlite``. For full information, run ``isqlite --help`` or ``isqlite --help``. ``add-column`` -------------- Usage:: isqlite add-column ``alter-column`` ---------------- Usage:: isqlite alter-column
``count`` --------- Usage:: isqlite count
--where ``create`` ---------- Usage:: isqlite create
= = ... ``isqlite insert`` is an alias for this subcommand. ``create-table`` ---------------- Usage:: isqlite create-table
... ``delete`` ---------- Usage:: isqlite delete
Unlike ``Database.delete``, the ``delete`` subcommand only supports deletion by primary key. ``drop-column`` --------------- Usage:: isqlite drop-column
``drop-table`` -------------- Usage:: isqlite drop-table
``get`` ------- Usage:: isqlite get
Unlike ``Database.get``, the ``get`` subcommand only supports fetching by primary key. ``icreate`` ----------- Usage:: isqlite icreate
The ``icreate`` subcommand will interactively prompt for each column in the table. ``iupdate`` ----------- Usage:: isqlite iupdate
The ``iupdate`` subcommand will interactively prompt for each column in the table, displaying the current value of the column if it is already set. ``list`` ---------- Usage:: isqlite list
isqlite list
--where isqlite list
--search ``isqlite select`` is an alias for this subcommand. ``migrate`` ----------- Usage:: isqlite migrate The Python file at ``schema`` must define the schema in a variable named ``SCHEMA``. See the :doc:`schema docs ` for details. ``rename-column`` ----------------- Usage:: isqlite rename-column
``rename-table`` ---------------- Usage:: isqlite rename-table ``reorder-columns`` ------------------- Usage:: isqlite reorder-columns
... ``schema`` ---------- Usage:: isqlite schema isqlite schema
If ``table`` is passed, the ``CREATE TABLE`` statement for that table is printed. Otherwise, the list of tables in the database is printed. ``search`` ---------- Usage:: isqlite search
Alias of ``isqlite list
--search `` ``sql`` ------- Usage:: isqlite sql ``update`` ---------- Usage:: isqlite update
= = ...