SQLite

La shell di SQLite: database SQL locali sulla scheda SD, con JSON e funzioni matematiche. Scrivi sqlite3 note.db.

versione 3.53.4.1 · Licenza: Public domain · Sito del progetto

SQLite

A cosa serve

La shell ufficiale di SQLite: crei e interroghi database SQL veri, salvati come file sulla scheda SD. Utile per note, inventari, registri, esperimenti di SQL. Ci sono le funzioni JSON e matematiche.

Come si usa

sqlite3 note.db

Apre (o crea) note.db nella cartella home. Poi scrivi SQL, terminando ogni istruzione con ;:

CREATE TABLE note(id INTEGER PRIMARY KEY, testo TEXT, quando TEXT DEFAULT CURRENT_TIMESTAMP);
INSERT INTO note(testo) VALUES ('comprare il latte');
SELECT * FROM note;

Comandi utili

Comando Cosa fa
.tables elenca le tabelle
.schema mostra come sono fatte
.mode box risultati in una tabella leggibile
.headers on nomi delle colonne
.import file.csv t importa un CSV (con .mode csv)
.help tutti i comandi
.quit esce (oppure EOF)

Limiti

Versione ridotta per la scheda: niente WAL, mmap, thread, estensioni caricabili e FTS5. Senza nome di file (sqlite3 da solo) il database sta in memoria e si perde all'uscita.

Nel Terminale

SQLite

The SQLite shell: local SQL databases on the SD card, with JSON and math functions. Type sqlite3 notes.db.

version 3.53.4.1 · License: Public domain · Project site

SQLite

What it is

The official SQLite shell: create and query real SQL databases stored as files on the SD card. Handy for notes, inventories, logs, learning SQL. JSON and math functions are included.

How to use it

sqlite3 notes.db

Opens (or creates) notes.db in the home folder. Then type SQL, ending each statement with ;:

CREATE TABLE notes(id INTEGER PRIMARY KEY, text TEXT, at TEXT DEFAULT CURRENT_TIMESTAMP);
INSERT INTO notes(text) VALUES ('buy milk');
SELECT * FROM notes;

Useful commands

Command What it does
.tables lists the tables
.schema shows their structure
.mode box results as a readable table
.headers on column names
.import file.csv t imports a CSV (with .mode csv)
.help every command
.quit quits (or EOF)

Limits

Trimmed for the board: no WAL, mmap, threads, loadable extensions or FTS5. Without a file name (sqlite3 alone) the database lives in memory and is lost on exit.

In the Terminal