Skip to content

Commit

Permalink
Update behaviour of extension loading
Browse files Browse the repository at this point in the history
  • Loading branch information
julien040 committed Apr 20, 2024
1 parent ae64be9 commit df3640c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sqlite3_load_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ func (c *SQLiteConn) LoadExtension(lib string, entry string) error {
return errors.New(C.GoString(C.sqlite3_errmsg(c.db)))
}

if err := c.loadExtension(lib, &entry); err != nil {
var entrypoint *string = nil

if len(entry) > 0 {
entrypoint = &entry
}

if err := c.loadExtension(lib, entrypoint); err != nil {
C.sqlite3_enable_load_extension(c.db, 0)
return err
}
Expand Down

0 comments on commit df3640c

Please sign in to comment.