tursodatabase / libsql-shell-go

7 stars 7 forks source link

`.schema` output should show triggers #134

Closed CodingDoug closed 11 months ago

CodingDoug commented 1 year ago

sqlite3 does this, so libsql shell should as well.

CodingDoug commented 1 year ago

For example:

$ sqlite3 test.db
sqlite> create table t (t text);
sqlite> insert into t values ('x');
sqlite> create trigger t after insert on t begin select 1; end;
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE t (t text);
INSERT INTO t VALUES('x');
CREATE TRIGGER t after insert on t begin select 1; end;
COMMIT;

It looks like triggers always come at the end after the data has been inserted.