db

package
v0.0.0-...-a1630c6 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open() (db *sqlx.DB)

Open a connection pool to the Database.

Types

type Queryable

type Queryable interface {
	sqlx.ExecerContext
	sqlx.Ext
	sqlx.Preparer
	sqlx.PreparerContext
	sqlx.QueryerContext

	Get(any, string, ...any) error
	GetContext(context.Context, any, string, ...any) error
	MustExec(string, ...any) sql.Result
	MustExecContext(context.Context, string, ...any) sql.Result
	NamedExec(string, any) (sql.Result, error)
	NamedExecContext(context.Context, string, any) (sql.Result, error)
	NamedQuery(string, any) (*sqlx.Rows, error)
	PrepareNamed(string) (*sqlx.NamedStmt, error)
	PrepareNamedContext(context.Context, string) (*sqlx.NamedStmt, error)
	Preparex(string) (*sqlx.Stmt, error)
	PreparexContext(context.Context, string) (*sqlx.Stmt, error)
	QueryRow(string, ...any) *sql.Row
	QueryRowContext(context.Context, string, ...any) *sql.Row
	Select(any, string, ...any) error
	SelectContext(context.Context, any, string, ...any) error
}

Queryable includes all methods shared by sqlx.DB & sqlx.Tx, allowing either type to be used interchangeably. https://github.com/jmoiron/sqlx/pull/809

Jump to

Keyboard shortcuts

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