sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
| 1 | #!sqlite3 |
| 2 | # |
| 3 | # 2026-10-20 |
| 4 | # |
| 5 | # The author disclaims copyright to this source code. In place of |
| 6 | # a legal notice, here is a blessing: |
| 7 | # |
| 8 | # May you do good and not evil. |
| 9 | # May you find forgiveness for yourself and forgive others. |
| 10 | # May you share freely, never taking more than you give. |
| 11 | # |
| 12 | #*********************************************************************** |
| 13 | # |
| 14 | # Test cases for the .dump CLI command |
| 15 | # |
| 16 | .open :memory: |
| 17 | .mode -reset test |
| 18 | |
| 19 | .if NOT capable('fkey') OR NOT capable('vtab') |
| 20 | .testcase setup |
| 21 | .check '' |
| 22 | .exit |
| 23 | .endif |
| 24 | |
| 25 | .open :memory: |
| 26 | .testcase 100 |
| 27 | CREATE TABLE customer(RowID TEXT, name TEXT); |
| 28 | INSERT INTO customer VALUES('C-1001','Ann'); |
| 29 | .dump --preserve-rowids |
| 30 | .check <<END |
| 31 | PRAGMA foreign_keys=OFF; |
| 32 | BEGIN TRANSACTION; |
| 33 | CREATE TABLE customer(RowID TEXT, name TEXT); |
| 34 | INSERT INTO customer(_rowid_,RowID,name) VALUES(1,'C-1001','Ann'); |
| 35 | COMMIT; |
| 36 | END |