sqliteutil

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginImmediate

func BeginImmediate(db *sql.DB) (*sql.Tx, error)

BeginImmediate returns a transaction that has already acquired the write lock.

Types

type Checksum

type Checksum uint64

Checksum represents an LTX checksum that is stored as a BLOB in SQLite.

func (*Checksum) Scan

func (v *Checksum) Scan(src any) error

Scan an 8-byte BLOB as a checksum. Zero value is encoded as a NULL.

func (Checksum) Value

func (v Checksum) Value() (driver.Value, error)

Value returns the time in RFC 3339 format.

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool // Valid is true if Time is not NULL
}

NullTime represents a SQLite-specific implementation of nullable *time.Time.

func NewNullTime

func NewNullTime(t *time.Time) *NullTime

func (*NullTime) Scan

func (n *NullTime) Scan(src any) error

Scan reads an LTX timestamp into t.

func (NullTime) T

func (n NullTime) T() *time.Time

T returns the value as a *time.Time

func (NullTime) Value

func (n NullTime) Value() (driver.Value, error)

Value returns the time in LTX timestamp format.

type Time

type Time time.Time

Time represents a SQLite-specific implementation of non-nullable time.Time.

func (*Time) Scan

func (t *Time) Scan(src any) error

Scan reads an LTX timestamp into t.

func (Time) Value

func (t Time) Value() (driver.Value, error)

Value returns the time in LTX timestamp format.

Jump to

Keyboard shortcuts

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