mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-12 15:33:44 +00:00
ad79ef48a2
* add tests * add bench
24 lines
568 B
Plaintext
24 lines
568 B
Plaintext
|
|
CREATE TABLE t1(a, b);
|
|
INSERT INTO t1 VALUES(1, 'f');
|
|
INSERT INTO t1 VALUES(2, 'e');
|
|
INSERT INTO t1 VALUES(3, 'd');
|
|
INSERT INTO t1 VALUES(4, 'c');
|
|
INSERT INTO t1 VALUES(5, 'b');
|
|
INSERT INTO t1 VALUES(6, 'a');
|
|
|
|
CREATE VIEW v1 AS SELECT a,b FROM t1;
|
|
CREATE TABLE log(op, a);
|
|
|
|
CREATE TRIGGER v1del INSTEAD OF DELETE ON v1 BEGIN
|
|
INSERT INTO log VALUES('delete', old.a);
|
|
END;
|
|
|
|
CREATE TRIGGER v1upd INSTEAD OF UPDATE ON v1 BEGIN
|
|
INSERT INTO log VALUES('update', old.a);
|
|
END;
|
|
|
|
|
|
CREATE TABLE t2(a, b, c, PRIMARY KEY(a, b)) WITHOUT ROWID;
|
|
|