mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-15 23:48:49 +00:00
ad79ef48a2
* add tests * add bench
44 lines
1010 B
Plaintext
44 lines
1010 B
Plaintext
|
|
CREATE TABLE t3(a, b, c, d,
|
|
UNIQUE(a, b),
|
|
FOREIGN KEY(c, d) REFERENCES t3(a, b)
|
|
);
|
|
INSERT INTO t3 VALUES(1, 2, 1, 2);
|
|
|
|
|
|
CREATE TABLE t4(a UNIQUE, b REFERENCES t4(a));
|
|
|
|
|
|
CREATE TABLE t5(a INTEGER PRIMARY KEY, b REFERENCES t5(a));
|
|
INSERT INTO t5 VALUES(NULL, 1);
|
|
|
|
|
|
CREATE TABLE t6(a INTEGER PRIMARY KEY, b, c, d,
|
|
FOREIGN KEY(c, d) REFERENCES t6(a, b)
|
|
);
|
|
CREATE UNIQUE INDEX t6i ON t6(b, a);
|
|
|
|
|
|
INSERT INTO t6 VALUES(100, 'one', 100, 'one');
|
|
DELETE FROM t6 WHERE a = 100;
|
|
|
|
|
|
INSERT INTO t6 VALUES(100, 'one', 100, 'one');
|
|
UPDATE t6 SET c = 1, d = 'a' WHERE a = 100;
|
|
DELETE FROM t6 WHERE a = 100;
|
|
|
|
|
|
CREATE TABLE t7(a, b, c, d INTEGER PRIMARY KEY,
|
|
FOREIGN KEY(c, d) REFERENCES t7(a, b)
|
|
);
|
|
CREATE UNIQUE INDEX t7i ON t7(a, b);
|
|
|
|
|
|
CREATE TABLE t8(a, b, c, d, e, FOREIGN KEY(c, d) REFERENCES t8(a, b));
|
|
CREATE UNIQUE INDEX t8i1 ON t8(a, b);
|
|
CREATE UNIQUE INDEX t8i2 ON t8(c);
|
|
INSERT INTO t8 VALUES(1, 1, 1, 1, 1);
|
|
|
|
UPDATE t8 SET d = 1;
|
|
UPDATE t8 SET e = 2;
|