[chore] Bump ncruces/go-sqlite3 to 0.17.1 (#3085)

More linkanme fixes.
This commit is contained in:
Daenney
2024-07-08 22:03:00 +02:00
committed by GitHub
parent 9a7c8926f5
commit 1de41f64f2
7 changed files with 50 additions and 6 deletions

30
vendor/github.com/ncruces/go-sqlite3/registry.go generated vendored Normal file
View File

@ -0,0 +1,30 @@
package sqlite3
import "sync"
var (
// +checklocks:extRegistryMtx
extRegistry []func(*Conn) error
extRegistryMtx sync.RWMutex
)
// AutoExtension causes the entryPoint function to be invoked
// for each new database connection that is created.
//
// https://sqlite.org/c3ref/auto_extension.html
func AutoExtension(entryPoint func(*Conn) error) {
extRegistryMtx.Lock()
defer extRegistryMtx.Unlock()
extRegistry = append(extRegistry, entryPoint)
}
func initExtensions(c *Conn) error {
extRegistryMtx.RLock()
defer extRegistryMtx.RUnlock()
for _, f := range extRegistry {
if err := f(c); err != nil {
return err
}
}
return nil
}