sequel

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 5 Imported by: 47

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 BasicTypes

type BasicTypes interface {
	string | bool | int64 | float64 | []byte | time.Time
}

type ColumnClause

type ColumnClause[T any] interface {
	ColumnName() string
	Value() T
}

func BasicColumn

func BasicColumn[T BasicTypes](columnName string, value T) ColumnClause[T]

type ColumnConvertClause

type ColumnConvertClause[T any] interface {
	ColumnClause[T]
	Convert(T) any
}

func Column

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

type ColumnValuer

type ColumnValuer interface {
	Tabler
	Columner
	Valuer
}

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) any

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 InsertColumner

type InsertColumner interface {
	InsertColumns() []string
}

type Inserter

type Inserter interface {
	ColumnValuer
	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 SQLColumnClause

type SQLColumnClause[T any] interface {
	ColumnConvertClause[T]
	SQLColumn(placeholder string) string
}

func SQLColumn

func SQLColumn[T any](columnName string, value T, sqlValue QueryFunc, convert ConvertFunc[T]) SQLColumnClause[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.Formatter
	Query() string
	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 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
driver
The `types` package is reference from :
The `types` package is reference from :
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