tursodatabase / libsql-client-go

Go client API for libSQL
MIT License
193 stars 24 forks source link

Fix statement spliting #51

Closed luisfvieirasilva closed 1 year ago

luisfvieirasilva commented 1 year ago

We had a bug spliting create trigger statements, see example below. I've implemented the fix inside libsql/sqlite-antlr4-parser repo so both this one and shell can use the same function to do it.

Example of breaking statement split:

CREATE TRIGGER update_updated_at AFTER UPDATE ON users FOR EACH ROW BEGIN
  UPDATE users SET updated_at = 0 WHERE id = NEW.id; end;

You can see the PR with the new SplitStatement function here

CodingDoug commented 1 year ago

Is this a fix for https://github.com/libsql/libsql-shell-go/issues/131?

luisfvieirasilva commented 1 year ago

@CodingDoug, it's part of the fix. After this PR is integrated, I'll need to update libsql-shell-go and turso-cli project