core

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBusy     = &Error{Code: 5, Msg: "database is locked"}
	ErrLocked   = &Error{Code: 6, Msg: "database table is locked"}
	ErrNoMem    = &Error{Code: 7, Msg: "out of memory"}
	ErrReadonly = &Error{Code: 8, Msg: "attempt to write a readonly database"}
)

Common SQLite error sentinels for use with errors.Is.

Functions

func OpenDB

func OpenDB(capi portout.CAPI, dsn string) (*database, error)

OpenDB opens a SQLite database at the given DSN (file path or ":memory:").

Types

type Error

type Error struct {
	Code int
	Msg  string
}

Error represents a SQLite error with a result code and message.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

Is reports whether the error has the given SQLite result code.

Jump to

Keyboard shortcuts

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