db

package
v8.36.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 24 Imported by: 1

Documentation

Overview

Package db exposes a lightweight abstraction over the SQLite code. It performs some basic mapping of lower-level types to rqlite types.

Index

Constants

View Source
const (
	SQLiteHeaderSize = 32

	OptimizeDefault = 0xFFFE
	OptimizeAll     = 0x10002
)
View Source
const (
	// ModeReadOnly is the mode to open a database in read-only mode.
	ModeReadOnly = true
	// ModeReadWrite is the mode to open a database in read-write mode.
	ModeReadWrite = false
)

Variables

View Source
var (
	// ErrWALReplayDirectoryMismatch is returned when the WAL file(s) are not in the same
	// directory as the database file.
	ErrWALReplayDirectoryMismatch = errors.New("WAL file(s) not in same directory as database file")

	// ErrQueryTimeout is returned when a query times out.
	ErrQueryTimeout = errors.New("query timeout")

	// ErrExecuteTimeout is returned when an execute times out.
	ErrExecuteTimeout = errors.New("execute timeout")
)
View Source
var BreakingPragmas = map[string]*regexp.Regexp{
	"PRAGMA journal_mode":       regexp.MustCompile(`(?i)^\s*PRAGMA\s+(\w+\.)?journal_mode\s*=\s*`),
	"PRAGMA wal_autocheckpoint": regexp.MustCompile(`(?i)^\s*PRAGMA\s+wal_autocheckpoint\s*=\s*`),
	"PRAGMA wal_checkpoint":     regexp.MustCompile(`(?i)^\s*PRAGMA\s+(\w+\.)?wal_checkpoint`),
	"PRAGMA synchronous":        regexp.MustCompile(`(?i)^\s*PRAGMA\s+(\w+\.)?synchronous\s*=\s*`),
}

BreakingPragmas are PRAGMAs that, if executed, would break the database layer.

View Source
var DBVersion string

DBVersion is the SQLite version.

Functions

func CheckpointRemove added in v8.30.1

func CheckpointRemove(path string) error

CheckpointRemove checkpoints any WAL files into the database file at the given given path. Checkpointing a database in DELETE mode is an error.

func EnsureDeleteMode added in v8.16.1

func EnsureDeleteMode(path string) error

EnsureDeleteMode ensures the database at the given path is in DELETE mode.

func EnsureWALMode added in v8.30.1

func EnsureWALMode(path string) error

EnsureWALMode ensures the database at the given path is in WAL mode.

func IsBreakingPragma added in v8.26.8

func IsBreakingPragma(stmt string) bool

IsBreakingPragma returns true if the given statement is a breaking PRAGMA.

func IsDELETEModeEnabled

func IsDELETEModeEnabled(b []byte) bool

IsDELETEModeEnabled checks that the supplied data looks like a SQLite file with DELETE mode enabled.

func IsDELETEModeEnabledSQLiteFile

func IsDELETEModeEnabledSQLiteFile(path string) (bool, error)

IsDELETEModeEnabledSQLiteFile checks that the supplied path looks like a SQLite with DELETE mode enabled.

func IsValidSQLiteData

func IsValidSQLiteData(b []byte) bool

IsValidSQLiteData checks that the supplied data looks like a SQLite data. See https://www.sqlite.org/fileformat.html.

func IsValidSQLiteFile

func IsValidSQLiteFile(path string) bool

IsValidSQLiteFile checks that the supplied path looks like a SQLite file. A nonexistent file is considered invalid.

func IsValidSQLiteFileCompressed added in v8.30.1

func IsValidSQLiteFileCompressed(path string) bool

IsValidSQLiteFileCompressed checks that the supplied path looks like a compressed SQLite file. A nonexistent file, invalid Gzip archive, or gzip archive that does not contain a valid SQLite file is considered invalid.

func IsValidSQLiteWALData

func IsValidSQLiteWALData(b []byte) bool

IsValidSQLiteWALData checks that the supplied data looks like a SQLite WAL file.

func IsValidSQLiteWALFile

func IsValidSQLiteWALFile(path string) bool

IsValidSQLiteWALFile checks that the supplied path looks like a SQLite WAL file. See https://www.sqlite.org/fileformat2.html#walformat. A nonexistent file is considered invalid.

func IsWALModeEnabled

func IsWALModeEnabled(b []byte) bool

IsWALModeEnabled checks that the supplied data looks like a SQLite data with WAL mode enabled.

func IsWALModeEnabledSQLiteFile

func IsWALModeEnabledSQLiteFile(path string) (bool, error)

IsWALModeEnabledSQLiteFile checks that the supplied path looks like a SQLite with WAL mode enabled.

func MakeDSN added in v8.16.6

func MakeDSN(path string, readOnly, fkEnabled, walEnabled bool) string

MakeDSN returns a SQLite DSN for the given path, with the given options.

func ParseHex added in v8.31.0

func ParseHex(s string) ([]byte, error)

ParseHex parses the given string into a byte slice as per the SQLite specification:

BLOB literals are string literals containing hexadecimal data and preceded by a single
"x" or "X" character. Example: X'53514C697465'

func RemoveFiles

func RemoveFiles(path string) error

RemoveFiles removes the SQLite database file, and any associated WAL and SHM files.

func RemoveWALFiles added in v8.30.1

func RemoveWALFiles(path string) error

RemoveWALFiles removes the WAL and SHM files associated with the given path, leaving the database file untouched.

func ReplayWAL

func ReplayWAL(path string, wals []string, deleteMode bool) error

ReplayWAL replays the given WAL files into the database at the given path, in the order given by the slice. The supplied WAL files must be in the same directory as the database file and are deleted as a result of the replay operation. If deleteMode is true, the database file will be in DELETE mode after the replay operation, otherwise it will be in WAL mode. In either case no WAL-related files will be present.

func ResetStats

func ResetStats()

ResetStats resets the expvar stats for this module. Mostly for test purposes.

func ValidateExtension added in v8.27.0

func ValidateExtension(path string) error

ValidateExtension validates the given extension path can be loaded into a SQLite database.

func WALPath added in v8.14.0

func WALPath(dbPath string) string

WALPath returns the path to the WAL file for the given database path.

Types

type CheckpointMode added in v8.18.2

type CheckpointMode int

CheckpointMode is the mode in which a checkpoint runs.

const (
	// CheckpointRestart instructs the checkpoint to run in restart mode.
	CheckpointRestart CheckpointMode = iota
	// CheckpointTruncate instructs the checkpoint to run in truncate mode.
	CheckpointTruncate
)

type CnkOnCloseMode added in v8.30.1

type CnkOnCloseMode int

CnkOnCloseMode represents the checkpoint on close mode.

const (
	// CnkOnCloseModeEnabled enables checkpoint on close.
	CnkOnCloseModeEnabled CnkOnCloseMode = iota

	// CnkOnCloseModeDisabled disables checkpoint on close.
	CnkOnCloseModeDisabled
)

type CommitHookCallback added in v8.36.17

type CommitHookCallback func() bool

CommitHookCallback is a callback function that is called whenever a transaction is committed to the database. If the callback returns true the transaction is committed, otherwise it is rolled back.

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is the SQL database.

func Open

func Open(dbPath string, fkEnabled, wal bool) (retDB *DB, retErr error)

Open opens a file-based database using the default driver.

func OpenWithDriver added in v8.27.0

func OpenWithDriver(drv *Driver, dbPath string, fkEnabled, wal bool) (retDB *DB, retErr error)

OpenWithDriver opens a file-based database, creating it if it does not exist. After this function returns, an actual SQLite file will always exist. If the database is opened in WAL mode, the WAL files will also be created if they do not exist.

func (*DB) Backup

func (db *DB) Backup(path string, vacuum bool) error

Backup writes a consistent snapshot of the database to the given file. The resultant SQLite database file will be in DELETE mode. This function can be called when changes to the database are in flight.

func (*DB) BusyTimeout added in v8.18.2

func (db *DB) BusyTimeout() (rwMs, roMs int, err error)

BusyTimeout returns the current busy timeout value.

func (*DB) Checkpoint

func (db *DB) Checkpoint(mode CheckpointMode) error

Checkpoint checkpoints the WAL file. If the WAL file is not enabled, this function is a no-op.

func (*DB) CheckpointWithTimeout

func (db *DB) CheckpointWithTimeout(mode CheckpointMode, dur time.Duration) (err error)

CheckpointWithTimeout performs a WAL checkpoint. If the checkpoint does not run to completion within the given duration, an error is returned. If the duration is 0, the busy timeout is not modified before executing the checkpoint.

func (*DB) Close

func (db *DB) Close() error

Close closes the underlying database connection.

func (*DB) CompileOptions

func (db *DB) CompileOptions() ([]string, error)

CompileOptions returns the SQLite compilation options.

func (*DB) ConnectionPoolStats

func (db *DB) ConnectionPoolStats(sqlDB *sql.DB) *PoolStats

ConnectionPoolStats returns database pool statistics

func (*DB) Copy

func (db *DB) Copy(dstDB *DB) error

Copy copies the contents of the database to the given database. All other attributes of the given database remain untouched e.g. whether it's an on-disk database, except the database will be placed in DELETE mode. This function can be called when changes to the source database are in flight.

func (*DB) DBLastModified added in v8.16.8

func (db *DB) DBLastModified() (time.Time, error)

DBLastModified returns the last modified time of the database file.

func (*DB) DBSum added in v8.16.8

func (db *DB) DBSum() (string, error)

DBSum returns the MD5 checksum of the database file.

func (*DB) DisableCheckpointing

func (db *DB) DisableCheckpointing() error

DisableCheckpointing disables the automatic checkpointing that occurs when the WAL reaches a certain size. This is key for full control of snapshotting. and can be useful for testing.

func (*DB) Dump

func (db *DB) Dump(w io.Writer) error

Dump writes a consistent snapshot of the database in SQL text format. This function can be called when changes to the database are in flight.

func (*DB) EnableCheckpointing

func (db *DB) EnableCheckpointing() error

EnableCheckpointing enables the automatic checkpointing that occurs when the WAL reaches a certain size.

func (*DB) Execute

func (db *DB) Execute(req *command.Request, xTime bool) ([]*command.ExecuteQueryResponse, error)

Execute executes queries that modify the database.

func (*DB) ExecuteStringStmt

func (db *DB) ExecuteStringStmt(query string) ([]*command.ExecuteQueryResponse, error)

ExecuteStringStmt executes a single query that modifies the database. This is primarily a convenience function.

func (*DB) ExecuteStringStmtWithTimeout added in v8.19.0

func (db *DB) ExecuteStringStmtWithTimeout(query string, timeout time.Duration) ([]*command.ExecuteQueryResponse, error)

ExecuteStringStmtWithTimeout executes a single query that modifies the database. It also sets a timeout for the query. This is primarily a convenience function.

func (*DB) ExtensionNames added in v8.27.0

func (db *DB) ExtensionNames() []string

ExtensionNames returns the names of the SQLite extensions loaded into the database.

func (*DB) FKEnabled

func (db *DB) FKEnabled() bool

FKEnabled returns whether Foreign Key constraints are enabled.

func (*DB) FileSize

func (db *DB) FileSize() (int64, error)

FileSize returns the size of the SQLite file on disk. If running in on-memory mode, this function returns 0.

func (*DB) GetCheckpointing

func (db *DB) GetCheckpointing() (int, error)

GetCheckpointing returns the current checkpointing setting.

func (*DB) GetSynchronousMode

func (db *DB) GetSynchronousMode() (SynchronousMode, error)

GetSynchronousMode returns the current synchronous mode.

func (*DB) IntegrityCheck added in v8.16.8

func (db *DB) IntegrityCheck(full bool) ([]*command.QueryRows, error)

IntegrityCheck runs a PRAGMA integrity_check on the database. If full is true, a full integrity check is performed, otherwise a quick check. It returns after hitting the first integrity failure, if any.

func (*DB) LastModified added in v8.16.1

func (db *DB) LastModified() (time.Time, error)

LastModified returns the last modified time of the database file, or the WAL file, whichever is most recent.

func (*DB) Optimize added in v8.30.0

func (db *DB) Optimize() error

Optimize runs a default PRAGMA OPTIMIZE on the database. If it's the first time this function is called on this database, it will run a full optimization.

func (*DB) OptimizeWithMask added in v8.30.0

func (db *DB) OptimizeWithMask(mask int) error

OptimizeWithMask runs a PRAGMA OPTIMIZE on the database, using the given mask.

func (*DB) Path

func (db *DB) Path() string

Path returns the path of this database.

func (*DB) Query

func (db *DB) Query(req *command.Request, xTime bool) ([]*command.QueryRows, error)

Query executes queries that return rows, but don't modify the database.

func (*DB) QueryStringStmt

func (db *DB) QueryStringStmt(query string) ([]*command.QueryRows, error)

QueryStringStmt executes a single query that return rows, but don't modify database.

func (*DB) QueryStringStmtWithTimeout added in v8.19.0

func (db *DB) QueryStringStmtWithTimeout(query string, tx bool, timeout time.Duration) ([]*command.QueryRows, error)

QueryStringStmtWithTimeout executes a single query that return rows, but don't modify database. It also sets a timeout for the query.

func (*DB) RegisterCommitHook added in v8.36.17

func (db *DB) RegisterCommitHook(hook CommitHookCallback) error

RegisterCommitHook registers a callback that is called whenever a transaction is committed to the database. If a callback is already registered, it is replaced. If hook is nil, the callback is removed.

func (*DB) RegisterPreUpdateHook added in v8.36.7

func (db *DB) RegisterPreUpdateHook(hook PreUpdateHookCallback, rowIDsOnly bool) error

RegisterPreUpdateHook registers a callback that is called before a row is modified in the database. If a callback is already registered, it is replaced. If hook is nil, the callback is removed.

func (*DB) RegisterUpdateHook added in v8.36.17

func (db *DB) RegisterUpdateHook(hook UpdateHookCallback) error

RegisterUpdateHook registers a callback that is called when a row is modified in the database. If a callback is already registered, it is replaced. If hook is nil, the callback is removed.

func (*DB) Request

func (db *DB) Request(req *command.Request, xTime bool) ([]*command.ExecuteQueryResponse, error)

Request processes a request that can contain both executes and queries.

func (*DB) RequestStringStmts

func (db *DB) RequestStringStmts(stmts []string) ([]*command.ExecuteQueryResponse, error)

RequestStringStmts processes a request that can contain both executes and queries.

func (*DB) RequestStringStmtsWithTimeout added in v8.19.0

func (db *DB) RequestStringStmtsWithTimeout(stmts []string, timeout time.Duration) ([]*command.ExecuteQueryResponse, error)

RequestStringStmtsWithTimeout processes a request that can contain both executes and queries.

func (*DB) Serialize

func (db *DB) Serialize() ([]byte, error)

Serialize returns a byte slice representation of the SQLite database. For an ordinary on-disk database file, the serialization is just a copy of the disk file. If the database is in WAL mode, a temporary on-disk copy is made, and it is this copy that is serialized. This function must not be called while any writes are happening to the database.

func (*DB) SetBusyTimeout added in v8.18.2

func (db *DB) SetBusyTimeout(rwMs, roMs int) (err error)

SetBusyTimeout sets the busy timeout for the database. If a timeout is is less than zero it is not set.

func (*DB) SetSynchronousMode

func (db *DB) SetSynchronousMode(mode SynchronousMode) error

SetSynchronousMode sets the synchronous mode of the database.

func (*DB) Size

func (db *DB) Size() (int64, error)

Size returns the size of the database in bytes. "Size" is defined as page_count * schema.page_size.

func (*DB) Stats

func (db *DB) Stats() (map[string]interface{}, error)

Stats returns status and diagnostics for the database.

func (*DB) StmtReadOnly

func (db *DB) StmtReadOnly(sql string) (bool, error)

StmtReadOnly returns whether the given SQL statement is read-only. As per https://www.sqlite.org/c3ref/stmt_readonly.html, this function may not return 100% correct results, but should cover most scenarios.

func (*DB) StmtReadOnlyWithConn

func (db *DB) StmtReadOnlyWithConn(sql string, conn *sql.Conn) (bool, error)

StmtReadOnlyWithConn returns whether the given SQL statement is read-only, using the given connection.

func (*DB) Vacuum

func (db *DB) Vacuum() error

Vacuum runs a VACUUM on the database.

func (*DB) VacuumInto added in v8.16.8

func (db *DB) VacuumInto(path string) error

VacuumInto VACUUMs the database into the file at path

func (*DB) WALEnabled

func (db *DB) WALEnabled() bool

WALEnabled returns whether WAL mode is enabled.

func (*DB) WALLastModified added in v8.16.8

func (db *DB) WALLastModified() (time.Time, error)

WALLastModified returns the last modified time of the WAL file.

func (*DB) WALPath

func (db *DB) WALPath() string

WALPath returns the path to the WAL file for this database.

func (*DB) WALSize

func (db *DB) WALSize() (int64, error)

WALSize returns the size of the SQLite WAL file on disk. If running in WAL mode is not enabled, this function returns 0.

func (*DB) WALSum added in v8.16.8

func (db *DB) WALSum() (string, error)

WALSum returns the MD5 checksum of the WAL file.

type Driver added in v8.27.0

type Driver struct {
	// contains filtered or unexported fields
}

Driver is a Database driver.

func CheckpointDriver added in v8.30.1

func CheckpointDriver() *Driver

CheckpointDriver returns the checkpoint driver. It registers the SQLite3 driver with the checkpoint driver name. It can be called multiple times, but only registers the SQLite3 driver once. This driver enables checkpoint on close for any database in WAL mode.

func DefaultDriver added in v8.27.0

func DefaultDriver() *Driver

DefaultDriver returns the default driver. It registers the SQLite3 driver with the default driver name. It can be called multiple times, but only registers the SQLite3 driver once. This driver disables checkpoint on close for any database in WAL mode.

func ForeignKeyDriver added in v8.36.4

func ForeignKeyDriver() *Driver

ForeignKeyDriver returns a driver that enables foreign key support on every connection.

func NewDriver added in v8.27.0

func NewDriver(name string, extensions []string, chkpt CnkOnCloseMode) *Driver

NewDriver returns a new driver with the given name and extensions. It registers the SQLite3 driver with the given name. extensions is a list of paths to SQLite3 extension shared objects. chkpt is the checkpoint-on-close mode the Driver will use.

If a driver with the given name already exists, a panic will occur.

func (*Driver) CheckpointOnCloseMode added in v8.30.1

func (d *Driver) CheckpointOnCloseMode() CnkOnCloseMode

CheckpointOnCloseMode returns the checkpoint on close mode.

func (*Driver) ExtensionNames added in v8.27.0

func (d *Driver) ExtensionNames() []string

ExtensionNames returns the names of the loaded driver extensions.

func (*Driver) Extensions added in v8.27.0

func (d *Driver) Extensions() []string

Extensions returns the paths of the loaded driver extensions.

func (*Driver) Name added in v8.27.0

func (d *Driver) Name() string

Name returns the driver name.

type PoolStats

type PoolStats struct {
	MaxOpenConnections int           `json:"max_open_connections"`
	OpenConnections    int           `json:"open_connections"`
	InUse              int           `json:"in_use"`
	Idle               int           `json:"idle"`
	WaitCount          int64         `json:"wait_count"`
	WaitDuration       time.Duration `json:"wait_duration"`
	MaxIdleClosed      int64         `json:"max_idle_closed"`
	MaxIdleTimeClosed  int64         `json:"max_idle_time_closed"`
	MaxLifetimeClosed  int64         `json:"max_lifetime_closed"`
}

PoolStats represents connection pool statistics

type PreUpdateHookCallback added in v8.36.7

type PreUpdateHookCallback func(ev *command.CDCEvent) error

PreUpdateHookCallback is a callback function that is called before a row is modified in the database.

type SwappableDB added in v8.17.0

type SwappableDB struct {
	// contains filtered or unexported fields
}

SwappableDB is a wrapper around DB that allows the underlying database to be swapped out in a thread-safe manner.

func OpenSwappable added in v8.17.0

func OpenSwappable(dbPath string, drv *Driver, fkEnabled, wal bool) (*SwappableDB, error)

OpenSwappable returns a new SwappableDB instance, which opens the database at the given path, using the given driver. If drv is nil then the default driver is used. If fkEnabled is true, foreign key constraints are enabled. If wal is true, the WAL journal mode is enabled.

func (*SwappableDB) Backup added in v8.17.0

func (s *SwappableDB) Backup(path string, vacuum bool) error

Backup calls Backup on the underlying database.

func (*SwappableDB) Checkpoint added in v8.17.0

func (s *SwappableDB) Checkpoint(mode CheckpointMode) error

Checkpoint calls Checkpoint on the underlying database.

func (*SwappableDB) Close added in v8.17.0

func (s *SwappableDB) Close() error

Close closes the underlying database.

func (*SwappableDB) DBLastModified added in v8.31.1

func (s *SwappableDB) DBLastModified() (time.Time, error)

DBLastModified calls DBLastModified on the underlying database.

func (*SwappableDB) Dump added in v8.17.0

func (s *SwappableDB) Dump(w io.Writer) error

Dump calls Dump on the underlying database.

func (*SwappableDB) Execute added in v8.17.0

func (s *SwappableDB) Execute(ex *command.Request, xTime bool) ([]*command.ExecuteQueryResponse, error)

Execute calls Execute on the underlying database.

func (*SwappableDB) FKEnabled added in v8.17.0

func (s *SwappableDB) FKEnabled() bool

FKEnabled calls FKEnabled on the underlying database.

func (*SwappableDB) FileSize added in v8.24.0

func (s *SwappableDB) FileSize() (int64, error)

FileSize calls FileSize on the underlying database.

func (*SwappableDB) Optimize added in v8.30.0

func (s *SwappableDB) Optimize() error

Optimize calls Optimize on the underlying database.

func (*SwappableDB) Path added in v8.17.0

func (s *SwappableDB) Path() string

Path calls Path on the underlying database.

func (*SwappableDB) Query added in v8.17.0

func (s *SwappableDB) Query(q *command.Request, xTime bool) ([]*command.QueryRows, error)

Query calls Query on the underlying database.

func (*SwappableDB) QueryStringStmt added in v8.17.0

func (s *SwappableDB) QueryStringStmt(query string) ([]*command.QueryRows, error)

QueryStringStmt calls QueryStringStmt on the underlying database.

func (*SwappableDB) Request added in v8.17.0

func (s *SwappableDB) Request(req *command.Request, xTime bool) ([]*command.ExecuteQueryResponse, error)

Request calls Request on the underlying database.

func (*SwappableDB) Serialize added in v8.17.0

func (s *SwappableDB) Serialize() ([]byte, error)

Serialize calls Serialize on the underlying database.

func (*SwappableDB) SetSynchronousMode added in v8.26.3

func (s *SwappableDB) SetSynchronousMode(mode SynchronousMode) error

SetSynchronousMode calls SetSynchronousMode on the underlying database.

func (*SwappableDB) Stats added in v8.17.0

func (s *SwappableDB) Stats() (map[string]interface{}, error)

Stats returns the underlying database's stats.

func (*SwappableDB) StmtReadOnly added in v8.17.0

func (s *SwappableDB) StmtReadOnly(sql string) (bool, error)

StmtReadOnly calls StmtReadOnly on the underlying database.

func (*SwappableDB) Swap added in v8.17.0

func (s *SwappableDB) Swap(path string, fkConstraints, walEnabled bool) error

Swap swaps the underlying database with that at the given path. The Swap operation may fail on some platforms if the file at path is open by another process. It is the caller's responsibility to ensure the file at path is not in use.

func (*SwappableDB) Vacuum added in v8.31.2

func (s *SwappableDB) Vacuum() error

Vacuum calls Vacuum on the underlying database.

func (*SwappableDB) VacuumInto added in v8.17.0

func (s *SwappableDB) VacuumInto(path string) error

VacuumInto calls VacuumInto on the underlying database.

func (*SwappableDB) WALEnabled added in v8.17.0

func (s *SwappableDB) WALEnabled() bool

WALEnabled calls WALEnabled on the underlying database.

func (*SwappableDB) WALSize added in v8.30.5

func (s *SwappableDB) WALSize() (int64, error)

WALSize calls WALSize on the underlying database.

type SynchronousMode added in v8.26.3

type SynchronousMode int

SynchronousMode is SQLite synchronous mode.

const (
	SynchronousOff SynchronousMode = iota
	SynchronousNormal
	SynchronousFull
	SynchronousExtra
)

func SynchronousModeFromInt added in v8.26.3

func SynchronousModeFromInt(i int) (SynchronousMode, error)

SynchronousModeFromInt returns the synchronous mode from the given integer.

func SynchronousModeFromString added in v8.26.3

func SynchronousModeFromString(s string) (SynchronousMode, error)

SynchronousModeFromString returns the synchronous mode from the given string.

func (SynchronousMode) String added in v8.26.3

func (s SynchronousMode) String() string

String returns the string representation of the synchronous mode.

type UpdateHookCallback added in v8.36.17

type UpdateHookCallback func(ev *command.UpdateHookEvent) error

UpdateHookCallback is a callback function that is called before a row is modified in the database.

Directories

Path Synopsis
wal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL