sequel

package
v1.0.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 5 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRowsAffectedResult

func NewRowsAffectedResult(rowsAffected int64) sql.Result

Types

type AutoIncrKeyer

type AutoIncrKeyer interface {
	PrimaryKeyer
	IsAutoIncr()
}

type ColumnValuer

type ColumnValuer[T any] interface {
	ColumnName() string
	Convert(T) driver.Value
	Value() driver.Value
}

func Column

func Column[T any](columnName string, value T, convert ConvertFunc[T]) ColumnValuer[T]

type Columner

type Columner interface {
	Columns() []string
}

type CompositeKeyer

type CompositeKeyer interface {
	Keyer
	CompositeKey() ([]string, []int, []any)
}

type ConvertFunc

type ConvertFunc[T any] func(T) driver.Value

type DB

type DB interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}

type Databaser

type Databaser interface {
	DatabaseName() string
}

type EmptyResult

type EmptyResult struct{}

func (EmptyResult) LastInsertId

func (EmptyResult) LastInsertId() (int64, error)

func (EmptyResult) RowsAffected

func (EmptyResult) RowsAffected() (int64, error)

type Inserter

type Inserter interface {
	TableColumnValuer
	InsertPlaceholders(row int) string
}

type KeyDeleter

type KeyDeleter interface {
	Keyer
	DeleteOneByPKStmt() (string, []any)
}

type KeyFinder

type KeyFinder interface {
	Keyer
	FindOneByPKStmt() (string, []any)
}

type KeyUpdater

type KeyUpdater interface {
	Keyer
	UpdateOneByPKStmt() (string, []any)
}

type KeyValueScanner

type KeyValueScanner[T any] interface {
	KeyValuer
	PtrScanner[T]
}

type KeyValuer

type KeyValuer interface {
	Keyer
	Tabler
	Columner
	Valuer
}

type Keyer

type Keyer interface {
	HasPK()
}

type OrderByClause

type OrderByClause interface {
	ColumnName() string
	Asc() bool
}

func OrderByColumn

func OrderByColumn(columnName string, asc bool) OrderByClause

type PrimaryKeyer

type PrimaryKeyer interface {
	Keyer
	PK() (string, int, any)
}

type PtrScanner

type PtrScanner[T any] interface {
	*T
	Scanner
}

type QueryFunc

type QueryFunc func(placeholder string) string

type SQLColumnValuer

type SQLColumnValuer[T any] interface {
	ColumnName() string
	Convert(T) driver.Value
	Value() driver.Value
	SQLValue(placeholder string) string
}

func SQLColumn

func SQLColumn[T any](columnName string, value T, sqlValue QueryFunc, convert ConvertFunc[T]) SQLColumnValuer[T]

type SQLColumner

type SQLColumner interface {
	SQLColumns() []string
}

type Scanner

type Scanner interface {
	Addrs() []any
}

type SetClause

type SetClause func(StmtBuilder)

type SingleInserter

type SingleInserter interface {
	InsertOneStmt() (string, []any)
}

type Stmt

type Stmt interface {
	StmtBuilder
	fmt.Stringer
	fmt.Formatter
	Args() []any
	Reset()
}

type StmtBuilder

type StmtBuilder interface {
	StmtWriter
	Var(v any) string
	// Vars will group the valus in parenthesis
	Vars(vals []any) string
}

type StmtWriter

type StmtWriter interface {
	io.Writer
	io.StringWriter
	io.ByteWriter
}

type TableColumnValuer

type TableColumnValuer interface {
	Tabler
	Columner
	Valuer
}

type TableName

type TableName struct{}

For rename table name

type Tabler

type Tabler interface {
	TableName() string
}

type Valuer

type Valuer interface {
	Values() []any
}

type WhereClause

type WhereClause func(StmtBuilder)

Directories

Path Synopsis
The `types` package is reference from :
The `types` package is reference from :

Jump to

Keyboard shortcuts

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