Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exec method doesn't support multiple statements (separated by semi-colon) #22

Open
JayJamieson opened this issue Apr 2, 2024 · 0 comments

Comments

@JayJamieson
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant