minisqlx

package module
v0.0.0-...-bfa1d92 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 3 Imported by: 0

README

minisqlx

mini sqlx wrapper

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Open = sqlx.Open
)

Functions

func Get

func Get[T any](ctx context.Context, db DB, query string, args ...interface{}) (T, error)

func Select

func Select[T any](ctx context.Context, db DB, query string, args ...interface{}) ([]T, error)

Types

type Conn

type Conn = sqlx.Conn

type DB

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

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

func ConnectContext

func ConnectContext(ctx context.Context, driverName, dataSourceName string) (DB, error)

type NamedStmt

type NamedStmt = sqlx.NamedStmt

type Row

type Row = sqlx.Row

type Rows

type Rows = sqlx.Rows

type Stmt

type Stmt = sqlx.Stmt

type Tx

type Tx = sqlx.Tx

Jump to

Keyboard shortcuts

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