db

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqlxDatabase

type SqlxDatabase interface {
	SqlxEngine
	Begin(opts *sql.TxOptions) (SqlxTransaction, error)
	BeginContext(ctx context.Context, opts *sql.TxOptions) (SqlxTransaction, error)
}

SqlxDatabase database interface

type SqlxEngine

type SqlxEngine interface {
	SqlxQueryEngine
	Close() error
	Rebind(query string) string
	BindNamed(query string, arg interface{}) (string, []interface{}, error)
	Unsafe() SqlxEngine
}

SqlxEngine ...

type SqlxExec

type SqlxExec interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	NamedExec(query string, arg interface{}) (sql.Result, error)
	NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
}

SqlxExec exec interface

type SqlxGet

type SqlxGet interface {
	Get(dest interface{}, query string, args ...interface{}) error
	GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
}

SqlxGet Get interface

type SqlxNamedStatement

type SqlxNamedStatement interface {
	Unsafe() SqlxNamedStatement
	Close() error

	QueryRow(arg interface{}) *SqlxRow
	QueryRowContext(ctx context.Context, arg interface{}) *SqlxRow
	QueryRowx(arg interface{}) *SqlxRow
	QueryRowxContext(ctx context.Context, arg interface{}) *SqlxRow

	Queryx(arg interface{}) (*SqlxRows, error)
	QueryxContext(ctx context.Context, arg interface{}) (*SqlxRows, error)

	Exec(arg interface{}) (sql.Result, error)
	ExecContext(ctx context.Context, arg interface{}) (sql.Result, error)
	Query(arg interface{}) (*sql.Rows, error)
	QueryContext(ctx context.Context, arg interface{}) (*sql.Rows, error)
	Select(dest interface{}, arg interface{}) error
	SelectContext(ctx context.Context, dest interface{}, arg interface{}) error
	Get(dest interface{}, arg interface{}) error
	GetContext(ctx context.Context, dest interface{}, arg interface{}) error
}

SqlxNamedStatement prepared named statement interface

type SqlxPrepare

type SqlxPrepare interface {
	Prepare(query string) (SqlxStatement, error)
	PrepareContext(ctx context.Context, query string) (SqlxStatement, error)
	PrepareNamed(query string) (SqlxNamedStatement, error)
	PrepareNamedContext(ctx context.Context, query string) (SqlxNamedStatement, error)
}

SqlxPrepare preparer interface

type SqlxQuery

type SqlxQuery interface {
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
	Queryx(query string, args ...interface{}) (*SqlxRows, error)
	QueryxContext(ctx context.Context, query string, args ...interface{}) (*SqlxRows, error)
	NamedQuery(query string, arg interface{}) (*SqlxRows, error)
	NamedQueryContext(ctx context.Context, query string, arg interface{}) (*SqlxRows, error)
}

SqlxQuery query Rows interface

type SqlxQueryEngine

type SqlxQueryEngine interface {
	SqlxPrepare
	SqlxExec
	SqlxQuery
	SqlxQueryRow
	SqlxSelect
	SqlxGet
}

SqlxQueryEngine essential sql-x query engine

type SqlxQueryRow

type SqlxQueryRow interface {
	QueryRow(query string, args ...interface{}) *sql.Row
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
	QueryRowx(query string, args ...interface{}) *SqlxRow
	QueryRowxContext(ctx context.Context, query string, args ...interface{}) *SqlxRow
}

SqlxQueryRow query row interface

type SqlxRow

type SqlxRow = sqlx.Row

SqlxRow just alias

type SqlxRows

type SqlxRows = sqlx.Rows

SqlxRows just alias

type SqlxSelect

type SqlxSelect interface {
	Select(dest interface{}, query string, args ...interface{}) error
	SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
}

SqlxSelect select interface

type SqlxStatement

type SqlxStatement interface {
	Unsafe() SqlxStatement
	Close() error

	QueryRow(args ...interface{}) *sql.Row
	QueryRowContext(ctx context.Context, args ...interface{}) *sql.Row
	QueryRowx(args ...interface{}) *SqlxRow
	QueryRowxContext(ctx context.Context, args ...interface{}) *SqlxRow

	Queryx(args ...interface{}) (*SqlxRows, error)
	QueryxContext(ctx context.Context, args ...interface{}) (*SqlxRows, error)

	Exec(args ...interface{}) (sql.Result, error)
	ExecContext(ctx context.Context, args ...interface{}) (sql.Result, error)
	Query(args ...interface{}) (*sql.Rows, error)
	QueryContext(ctx context.Context, args ...interface{}) (*sql.Rows, error)
	Select(dest interface{}, args ...interface{}) error
	SelectContext(ctx context.Context, dest interface{}, args ...interface{}) error
	Get(dest interface{}, args ...interface{}) error
	GetContext(ctx context.Context, dest interface{}, args ...interface{}) error
}

SqlxStatement prepared statement interface

type SqlxTransaction

type SqlxTransaction interface {
	SqlxEngine
	Stmtx(stmt interface{}) SqlxStatement
	StmtxContext(ctx context.Context, stmt interface{}) SqlxStatement
	End(doCommit bool) error
}

SqlxTransaction transaction interface

Jump to

Keyboard shortcuts

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