sqlite
Description
A standalone SQLite database containing one selected table. sqlite_read_table chooses an input table; sqlite_write_table names the exported table, default table. This is an exchange format, not a copy of the active CoordinatorDB database.
Input and output. Select it with FORMAT sqlite. Names ignore ASCII case; use the snake_case name shown here.
Input selects one user table by sqlite_read_table, or the first table in catalog order by default. Target names match without regard to ASCII case, and missing requested columns are errors. Other tables, indexes and triggers are not imported.
Output writes one standalone table named by sqlite_write_table. Signed integers and Bool use INTEGER, floating-point values use REAL, and many other native values use TEXT. Supply a standalone committed input database: external WAL or journal contents are not part of the exchange file.
SELECT expressions FORMAT sqlite;
INSERT INTO table [(columns)] [SETTINGS ...] FORMAT sqlite
<data>Example usage
Use the native client's --query mode to preserve binary output bytes. The server must be running, the executable available as ./coordinator, and database data selected.
./coordinator client --database data --query "SELECT CAST(7 AS Int64) AS id FORMAT sqlite" > sample.sqlite
./coordinator client --database data --query "CREATE TABLE format_import(id Int64)" > /dev/null
./coordinator client --database data --query "INSERT INTO format_import FORMAT sqlite" < sample.sqlite > /dev/null
./coordinator client --database data --query "SELECT id FROM format_import FORMAT csv"7Create format_import in a fresh database before running this example.
Format settings
Use a statement SETTINGS clause; these options are not persisted by SET.
| Setting | Type | Default | Meaning |
|---|---|---|---|
snappy_mode |
String |
basic |
Read Snappy client files as basic (Hadoop blocks) or framed (standard streaming format). |
sqlite_read_table |
String |
'' |
Read this table from the input database; empty selects its first user table. |
sqlite_write_table |
String |
table |
Name of the single table written to the output database. |