orm

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 4 Imported by: 1

README

orm

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(executor Executor, statement string, c *int, arg model.Arg) error

func Delete

func Delete(executor Executor, statement string, m model.Identifier) (err error)

func Get

func Get(executor Executor, statement string, m model.Identifier) error

func NamedInsert

func NamedInsert(executor Executor, statement string, m model.Identifier) error

func NamedSave

func NamedSave(executor Executor, statement string, m model.Identifier) error

func NamedUpdate

func NamedUpdate(executor Executor, statement string, m model.Identifier) error

func Select

func Select(executor Executor, statement string, list any, arg model.Arg) error

Types

type Counter

type Counter interface {
	Count(...model.Arg) (int, error)
	CountTx(*sqlx.Tx, ...model.Arg) (int, error)
}

type Deleter

type Deleter[T any] interface {
	Delete(*T) error
	DeleteTx(*sqlx.Tx, *T) error
}

type Executor

type Executor interface {
	NamedExec(string, any) (sql.Result, error)
	PrepareNamed(string) (*sqlx.NamedStmt, error)
}

type Finder

type Finder[T any] interface {
	Find(...model.Arg) ([]T, error)
}

type Geter

type Geter[T any] interface {
	Get(*T) error
	GetTx(*sqlx.Tx, *T) error
}

type Inserter

type Inserter[T any] interface {
	Insert(*T) error
	InsertTx(*sqlx.Tx, *T) error
}

type Pager

type Pager[T any] interface {
	PaginationTx(*sqlx.Tx, model.Pager) ([]T, error)
}

type Saver

type Saver[T any] interface {
	Save(*T) error
	SaveTx(*sqlx.Tx, *T) error
}

type Updater

type Updater[T any] interface {
	Update(*T) error
	UpdateTx(*sqlx.Tx, *T) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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