Documentation ¶
Index ¶
- Constants
- func BeginTx(ctx context.Context, db *sql.DB, write bool) (*sql.Tx, error)
- func Migrate(sqlDB *sql.DB) error
- func New(dbPath string) (*sql.DB, error)
- type ConstraintError
- type DB
- func (db DB) BeginTx(ctx context.Context, write bool) (Tx, error)
- func (db DB) C() DBTx
- func (db DB) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (db DB) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (db DB) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (db DB) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
- type DBTx
- type Error
- type Tx
- func (tx Tx) C() DBTx
- func (tx Tx) Commit() error
- func (tx Tx) CommitHook(fn func())
- func (tx Tx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (tx Tx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (tx Tx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (tx Tx) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
- func (tx Tx) Rollback() error
Constants ¶
View Source
const ( CONSTRAINT_CHECK = 275 CONSTRAINT_COMMITHOOK = 531 CONSTRAINT_DATATYPE = 3091 CONSTRAINT_FOREIGNKEY = 787 CONSTRAINT_FUNCTION = 1043 CONSTRAINT_NOTNULL = 1299 CONSTRAINT_PINNED = 2835 CONSTRAINT_PRIMARYKEY = 1555 CONSTRAINT_ROWID = 2579 CONSTRAINT_TRIGGER = 1811 CONSTRAINT_UNIQUE = 2067 CONSTRAINT_VTAB = 2323 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConstraintError ¶
type ConstraintError Error
func AsConstraintError ¶
func AsConstraintError(err error, code int, codes ...int) (ConstraintError, bool)
func (ConstraintError) IsField ¶
func (e ConstraintError) IsField(field string) bool
type Tx ¶
func (Tx) CommitHook ¶
func (tx Tx) CommitHook(fn func())
func (Tx) ExecContext ¶
func (Tx) PrepareContext ¶
func (Tx) QueryContext ¶
func (Tx) QueryRowContext ¶
Click to show internal directories.
Click to hide internal directories.