libsql-client-go
libsql-client-go copied to clipboard
Deal with multiple statements at once for all kinds of connections
Right now (after this PR is merger) we have three kinds of connections: file://, ws:// and http://. Each one of them has a different behavior when we query multiple statements at once. For instance, if I run select 1; select 2;
-
file://: It's just run the first statement and silently ignores the other ones, so justselect 1;would be executed. ps: for this one we're usingsqlite3driver. -
ws://: It doesn't accept multiple statements at once and returns an error instead of executing -
http://: It accepts multiple statements, running bothselect 1;andselect 2;. User can call NextResultSet to get all the results.
The idea is to standardized this pattern, following http behavior. That is the closest one to go database/sql standard
I'm also dealing with this problem when I'm trying to run my schema.sql at the start of the application. Multiple statements are failing when using libsql, but working when using sqlite3. Is there a better or different way to handle it?