Debian Codegraph @

static_mock.go

raw
1 // Copyright (C) 2019 Yasuhiro Matsumoto <[email protected]>.
2 //
3 // Use of this source code is governed by an MIT-style
4 // license that can be found in the LICENSE file.
5
6 //go:build !cgo
7
8 package sqlite3
9
10 import (
11 "database/sql"
12 "database/sql/driver"
13 "errors"
14 )
15
16 var errorMsg = errors.New("Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub")
17
18 func init() {
19 sql.Register("sqlite3", &SQLiteDriver{})
20 }
21
22 type (
23 SQLiteDriver struct {
24 Extensions []string
25 ConnectHook func(*SQLiteConn) error
26 }
27 SQLiteConn struct{}
28 )
29
30 func (SQLiteDriver) Open(s string) (driver.Conn, error) { return nil, errorMsg }
31 func (c *SQLiteConn) RegisterAggregator(string, any, bool) error { return errorMsg }
32 func (c *SQLiteConn) RegisterAuthorizer(func(int, string, string, string) int) {}
33 func (c *SQLiteConn) RegisterCollation(string, func(string, string) int) error { return errorMsg }
34 func (c *SQLiteConn) RegisterCommitHook(func() int) {}
35 func (c *SQLiteConn) RegisterFunc(string, any, bool) error { return errorMsg }
36 func (c *SQLiteConn) RegisterRollbackHook(func()) {}
37 func (c *SQLiteConn) RegisterUpdateHook(func(int, string, string, int64)) {}