mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-15 22:39:05 +00:00
ad79ef48a2
* add tests * add bench
65 lines
1.7 KiB
Plaintext
65 lines
1.7 KiB
Plaintext
|
|
CREATE TABLE t1(a, b, c);
|
|
ATTACH 'test.db2' AS aux;
|
|
CREATE TABLE aux.t2(d, e, f);
|
|
|
|
PRAGMA table_info = t1
|
|
PRAGMA table_info = t2
|
|
|
|
PRAGMA table_info(t1)
|
|
|
|
PRAGMA table_info(t2)
|
|
|
|
CREATE TABLE t1(a, b, c);
|
|
ATTACH 'test.db2' AS aux;
|
|
CREATE TABLE aux.t2(d, e, f);
|
|
|
|
SELECT * FROM pragma_table_info('t1')
|
|
SELECT * FROM pragma_table_info('t2')
|
|
SELECT * FROM pragma_table_info('t1')
|
|
SELECT * FROM pragma_table_info('t2')
|
|
|
|
CREATE TABLE t1(a, b, c);
|
|
CREATE INDEX i1 ON t1(b);
|
|
ATTACH 'test.db2' AS aux;
|
|
CREATE TABLE aux.t2(d, e, f);
|
|
CREATE INDEX aux.i2 ON t2(e);
|
|
|
|
SELECT * FROM pragma_index_info('i1')
|
|
SELECT * FROM pragma_index_info('i2')
|
|
SELECT * FROM pragma_index_info('i1')
|
|
SELECT * FROM pragma_index_info('i2')
|
|
|
|
CREATE INDEX main.i1 ON t1(b, c);
|
|
CREATE INDEX aux.i2 ON t2(e, f);
|
|
|
|
SELECT * FROM pragma_index_list('t1')
|
|
SELECT * FROM pragma_index_list('t2')
|
|
SELECT * FROM pragma_index_list('t1')
|
|
SELECT * FROM pragma_index_list('t2')
|
|
|
|
CREATE UNIQUE INDEX main.i1 ON t1(a);
|
|
CREATE UNIQUE INDEX aux.i2 ON t2(d);
|
|
CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
|
|
CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
|
|
|
|
SELECT * FROM pragma_foreign_key_list('c1')
|
|
SELECT * FROM pragma_foreign_key_list('c2')
|
|
SELECT * FROM pragma_foreign_key_list('c1')
|
|
SELECT * FROM pragma_foreign_key_list('c2')
|
|
|
|
CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
|
|
CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
|
|
INSERT INTO main.c1 VALUES(1, 2, 3);
|
|
INSERT INTO aux.c2 VALUES(4, 5, 6);
|
|
|
|
pragma foreign_key_check('c1')
|
|
pragma foreign_key_check('c2')
|
|
pragma foreign_key_check('c1')
|
|
|
|
CREATE TABLE t4(a DEFAULT 'abc' /* comment */, b DEFAULT -1 -- comment
|
|
, c DEFAULT +4.0 /* another comment */
|
|
);
|
|
PRAGMA table_info = t4;
|
|
|