Skip to content

Commit e537baa

Browse files
committed
Don't trip over single queries ending with semicolon
1 parent bd2b712 commit e537baa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

connection.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func (conn SqliteJsConn) Close() error {
3838

3939
func (conn *SqliteJsConn) Exec(query string, args []driver.Value) (result driver.Result, err error) {
4040
defer protect("Exec", func(e error) { err = e })
41+
query = strings.TrimRight(query, ";")
4142
if strings.Contains(query, ";") {
4243
if len(args) != 0 {
4344
return nil, fmt.Errorf("cannot exec multiple statements with placeholders, query: %s nargs=%d", query, len(args))

0 commit comments

Comments
 (0)