sql

package module
v0.0.0-...-29b1576 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetPlaceHolder

func SetPlaceHolder(p tqla.Placeholder)

func WithTransaction

func WithTransaction(ctx context.Context, tx *sql.Tx) context.Context

Types

type ImmutableObject

type ImmutableObject[M, A any] struct {
	// contains filtered or unexported fields
}

func NewImmutableObject

func NewImmutableObject[M, A any](db *sql.DB, c, r string) ImmutableObject[M, A]

func (ImmutableObject) Create

func (c ImmutableObject) Create(ctx context.Context, args A, value M) error

func (ImmutableObject) Read

func (r ImmutableObject) Read(ctx context.Context, args A) (value M, err error)

type Object

type Object[M, A any] struct {
	// contains filtered or unexported fields
}

func NewObject

func NewObject[M, A any](db *sql.DB, c, r, u, d string) Object[M, A]

func (Object) Create

func (c Object) Create(ctx context.Context, args A, value M) error

func (Object) Delete

func (d Object) Delete(ctx context.Context, args A) error

func (Object) Read

func (r Object) Read(ctx context.Context, args A) (value M, err error)

func (Object) Update

func (u Object) Update(ctx context.Context, args A, value M) error

type PersistentObject

type PersistentObject[M, A any] struct {
	// contains filtered or unexported fields
}

func NewPersistentObject

func NewPersistentObject[M, A any](db *sql.DB, c, r, u string) PersistentObject[M, A]

func (PersistentObject) Create

func (c PersistentObject) Create(ctx context.Context, args A, value M) error

func (PersistentObject) Read

func (r PersistentObject) Read(ctx context.Context, args A) (value M, err error)

func (PersistentObject) Update

func (u PersistentObject) Update(ctx context.Context, args A, value M) error

type View

type View[M, A any] struct {
	// contains filtered or unexported fields
}

func NewView

func NewView[M, A any](db *sql.DB, r string) View[M, A]

func (View) Read

func (r View) Read(ctx context.Context, args A) (value M, err error)

Jump to

Keyboard shortcuts

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