Exec method appears to not support multi line statement queries, it executes up until first ; then completes.
Minimal code required to reproduce.
db, err := sql.Open("libsql", url)
if err != nil {
return nil, err
}
defer db.Close()
db.Exec(`create table foo (id integer primary key);
create table bar (id integer primary key);`)
My expectation would be the same behavior as other sqlite3 drivers mattn sqlite3 and modernc where multi statement queries are executed fully when using Exec.
My current work around is at the template level to inject a separator symbol that I can split on and run Exec in a loop. This however isn't great for larger SQL scripts.
Exec method appears to not support multi line statement queries, it executes up until first
;
then completes.Minimal code required to reproduce.
My expectation would be the same behavior as other sqlite3 drivers mattn sqlite3 and modernc where multi statement queries are executed fully when using
Exec
.My current work around is at the template level to inject a separator symbol that I can split on and run
Exec
in a loop. This however isn't great for larger SQL scripts.