mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-12 14:23:38 +00:00
ad79ef48a2
* add tests * add bench
13 lines
309 B
Plaintext
13 lines
309 B
Plaintext
|
|
CREATE TABLE v(x INTEGER);
|
|
CREATE TABLE hist(x INTEGER PRIMARY KEY, cnt INTEGER);
|
|
CREATE TRIGGER vt AFTER INSERT ON v BEGIN
|
|
INSERT INTO hist VALUES(new.x, 1) ON CONFLICT(x) DO
|
|
UPDATE SET cnt=cnt+1;
|
|
END;
|
|
|
|
|
|
INSERT INTO v VALUES(1), (4), (1), (5), (5), (8), (9), (1);
|
|
SELECT * FROM hist;
|
|
|