Skip to content

SQL: what Basthon adds ​

This page describes what Basthon adds to SQL. To discover the kernel through examples, see SQL in Basthon.

The SQL kernel is SQLite (through sql.js): SQLite's whole syntax is available, and foreign key constraints are on.

Special commands ​

As in SQLite's command line tool, commands that start with a dot (dot commands) act on the database. .help lists them.

CommandRole
.helpshows the help
.tableslists the tables
.schemashows the CREATE statements of the database
.export, .save or .backupdownloads the database in SQLite's binary format (.db)
.dumpdownloads the database as an SQL script

Display of the results ​

The result of a query is shown as a table, that of the last query of the cell. A query that returns no row still shows the names of the columns.

Databases and scripts ​

The open button (or the module URL parameter) loads a database (*.db, *.sqlite), which is opened, or a script (*.sql), which is run (see Files and modules).