factory

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON added in v0.0.7

type JSON map[string]any

type KV

type KV map[string]any

func ToKV

func ToKV(opts []any) KV

func (KV) Bool

func (kv KV) Bool(key string, deflt ...bool) any

func (KV) Float added in v0.0.7

func (kv KV) Float(key string, deflt ...float64) any

func (KV) Int

func (kv KV) Int(key string, deflt ...int) any

func (KV) String

func (kv KV) String(key string, deflt ...string) any

func (KV) Time

func (kv KV) Time(key string, deflt ...time.Time) any

func (KV) UInt16

func (kv KV) UInt16(key string, deflt ...uint16) any

func (KV) UUID

func (kv KV) UUID(key string, deflt ...string) any

type SQLStorage

type SQLStorage interface {
	JSON(input any) (any, error)
	MustExec(sql string, args ...any)
	Placeholder(i int) string
}
var DB SQLStorage

type SQLiteProvider added in v0.0.7

type SQLiteProvider interface {
	WithDB(func(conn sqlite.Conn))
}

Factory where the sqlite connection is passed at runtime

type Sqlite added in v0.0.7

type Sqlite struct {
	Truncate func(p SQLiteProvider) Sqlite
	Insert   func(p SQLiteProvider, args ...any) typed.Typed
}

func NewSqlite added in v0.0.7

func NewSqlite(name string, builder func(KV) KV, pks ...string) Sqlite

type Table

type Table struct {
	Truncate func() Table
	Insert   func(args ...any) typed.Typed
}

func NewTable

func NewTable(name string, builder func(KV) KV, pks ...string) Table

Jump to

Keyboard shortcuts

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