4.1 KiB
4.1 KiB
Summary
**No review yet**Minimized query
CREATE TABLE T (
A VARCHAR(json_remove(15, '$.key')) PRIMARY KEY,
B VARCHAR(30) NOT NULL,
C BIGINT UNIQUE
);
INSERT INTO T VALUES ('a', 'x', -9223372036854775808);
INSERT INTO T VALUES ('b', 'y', -1000000);
INSERT INTO T VALUES ('c', 'y', 0);
INSERT INTO T VALUES ('d', 'y', 42);
INSERT INTO T VALUES ('e', 'x', 9223372036854775807);
INSERT INTO T VALUES ('f', 'z', 2147483648);
SELECT * FROM T WHERE C > 0 ORDER BY C DESC;
.log OFF
PRAGMA vdbe_listing = 0;
PRAGMA quick_check(20);
PRAGMA vdbe_debug = FALSE;
PRAGMA query_only = OFF;
PRAGMA user_version = -1.0;
.recover
CREATE TABLE t1(a);
INSERT INTO t1 VALUES(1);
ALTER TABLE t1 ADD COLUMN b TEXT DEFAULT -123.0;
SELECT b, typeof(b) FROM t1;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT -123.5;
ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'hello';
SELECT c, typeof(c) FROM t1;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(*) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_t1_3250 BEFORE DELETE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
SELECT COUNT(a) FROM t1;
PRAGMA read_uncommitted = 1;
INSERT INTO t1 VALUES (NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a;
SELECT SUM(a) FROM t1;
ALTER TABLE t1 RENAME TO t1_r1831;
DELETE FROM t1 WHERE a > (SELECT AVG(a) FROM t1);
WITH RECURSIVE r AS (SELECT a FROM t1 UNION ALL SELECT a FROM t1 LIMIT 5) SELECT * FROM r;
ALTER TABLE T RENAME TO T_r4664;
PRAGMA cache_size;
WITH cte(x) AS (VALUES(1),(2),(3)) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte a, cte b WHERE a.a = b.a;
SELECT * FROM T AS a INNER JOIN T AS b ON a.rowid = b.rowid;
SELECT NTH_VALUE(C, 2) OVER (ORDER BY C ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
Actual output
Usage: /home/test/sqlite3-src/build/sqlite3 [OPTIONS] FILENAME [SQL]
FILENAME is the name of an SQLite database. A new database is created
if the file does not previously exist.
OPTIONS include:
-append append the database to the end of the file
-ascii set output mode to 'ascii'
-bail stop after hitting an error
-batch force batch I/O
-box set output mode to 'box'
-column set output mode to 'column'
-cmd COMMAND run "COMMAND" before reading stdin
-csv set output mode to 'csv'
-deserialize open the database using sqlite3_deserialize()
-echo print commands before execution
-init FILENAME read/process named file
-[no]header turn headers on or off
-help show this message
-html set output mode to HTML
-interactive force interactive I/O
-json set output mode to 'json'
-line set output mode to 'line'
-list set output mode to 'list'
-lookaside SIZE N use N entries of SZ bytes for lookaside memory
-markdown set output mode to 'markdown'
-maxsize N maximum size for a --deserialize database
-memtrace trace all memory allocations and deallocations
-mmap N default mmap size set to N
-newline SEP set output row separator. Default: '\n'
-nofollow refuse to open symbolic links to database files
-nonce STRING set the safe-mode escape nonce
-nullvalue TEXT set text string for NULL values. Default ''
-pagecache SIZE N use N slots of SZ bytes each for page cache memory
-quote set output mode to 'quote'
-readonly open the database read-only
-safe enable safe-mode
-separator SEP set output column separator. Default: '|'
-stats print memory stats before each finalize
-table set output mode to 'table'
-tabs set output mode to 'tabs'
-version show SQLite version
-vfs NAME use NAME as the default VFS
Expectation
Flag
-help