sqjdb

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 9 Imported by: 0

README

sqjdb

SQLite JSON Database using Zombiezen/ModernC's cgo-free port of SQLite.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRows = errors.New("sqjson: no rows in result set")

Functions

func Bind

func Bind(stmt *sqlite.Stmt, i int, v any) error

Types

type SQL

type SQL struct {
	Query string
	Args  []any
}

func ByID

func ByID(id string) SQL

type Table

type Table[T any] struct {
	Name string
	// contains filtered or unexported fields
}

func NewTable

func NewTable[T any](name string) Table[T]

func (*Table[T]) All

func (t *Table[T]) All(conn *sqlite.Conn, sqls ...SQL) ([]*T, error)

func (*Table[T]) Delete

func (t *Table[T]) Delete(conn *sqlite.Conn, sqls ...SQL) error

func (*Table[T]) Insert

func (t *Table[T]) Insert(conn *sqlite.Conn, doc *T) (*T, error)

func (*Table[T]) Migrate

func (t *Table[T]) Migrate(conn *sqlite.Conn) error

func (*Table[T]) One

func (t *Table[T]) One(conn *sqlite.Conn, sqls ...SQL) (*T, error)

func (*Table[T]) Patch

func (t *Table[T]) Patch(conn *sqlite.Conn, doc *T, sqls ...SQL) error

func (*Table[T]) Replace

func (t *Table[T]) Replace(conn *sqlite.Conn, doc *T, sqls ...SQL) error

Jump to

Keyboard shortcuts

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