sequel

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 6 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDialect

func RegisterDialect(name string, d Dialect)

Types

type AutoIncrKeyer

type AutoIncrKeyer interface {
	Keyer
	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 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 Dialect

type Dialect interface {
	// SQL driver name
	Driver() string
	// Argument string to escape SQL injection
	QuoteVar(n int) string
	VarRune() rune
	// Character to escape table, column name
	QuoteIdentifier(v string) string
	QuoteRune() rune
}

func DefaultDialect

func DefaultDialect() Dialect

func GetDialect

func GetDialect(name string) (Dialect, bool)

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 {
	Columner
	InsertVarQuery() string
}

type KeyFinder

type KeyFinder interface {
	Keyer
	FindByPKStmt() string
}

type KeyUpdater

type KeyUpdater interface {
	Keyer
	UpdateByPKStmt() string
}

type KeyValueScanner

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

type KeyValuer

type KeyValuer[T any] interface {
	Keyer
	Tabler
	Columner
	Valuer
}

type Keyer

type Keyer interface {
	PK() (columnName string, pos int, value driver.Value)
}

type Migrator

type Migrator interface {
	Tabler
	CreateTableStmt() string
	AlterTableStmt() string
}

type OrderByClause

type OrderByClause func(StmtWriter)

type Scanner

type Scanner[T any] interface {
	*T
	Addrs() []any
}

type SetClause

type SetClause func(StmtBuilder)

type SingleInserter

type SingleInserter interface {
	InsertOneStmt() string
}

type Stmt

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

type StmtBuilder

type StmtBuilder interface {
	StmtWriter
	Var(query string, v any)
	Vars(query string, v []any)
}

type StmtWriter

type StmtWriter interface {
	io.StringWriter
	io.ByteWriter
}

type Table

type Table struct{}

For rename table name

type TableColumnValuer

type TableColumnValuer[T any] interface {
	Tabler
	Columner
	Valuer
}

type Tabler

type Tabler interface {
	TableName() string
}

type Valuer

type Valuer interface {
	Values() []any
}

type WhereClause

type WhereClause func(StmtBuilder)

Directories

Path Synopsis
dialect
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