sqlxext

package module
v0.0.0-...-5dbdbd5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 2 Imported by: 0

README

SQLXext

Sqlxext - provides handy extensions to sqlx default functions.

Go Report Card Go Reference

Documentation

Overview

Package sqlxext - provides handy extensions to sqlx default functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecSQLForRows

func ExecSQLForRows(
	ctx context.Context,
	db sqlx.ExtContext,
	dest interface{}, query string, inParams interface{},
) error

ExecSQLForRows execute db request and write results to dest. It is sqlx.SelectContext under the hood, but accepts query with named parameters. Nil dest or nil inParams are allowed. If dest is nil, it works like sqlx.NamedExecContext.

func NamedGetContext

func NamedGetContext(
	ctx context.Context,
	db sqlx.ExtContext,
	dest interface{}, query string, inParams interface{},
) error

NamedGetContext gets and scans one row it to dst like sqlx.GetContext does, but accepts query with named parameters. Nil inParams is allowed, unlike dest. Use ExecSQLForRows (NamedSelectContext) if you need to discard row(-s) or Exec the statement.

func NamedSelectContext

func NamedSelectContext(
	ctx context.Context,
	db sqlx.ExtContext,
	dest interface{}, query string, inParams interface{},
) error

NamedSelectContext select all rows and scans them to dst like sqlx.SelectContext does, but accepts query with named parameters. Nil dest or nil inParams are allowed. If dest is nil, it works like sqlx.NamedExecContext.

Types

This section is empty.

Jump to

Keyboard shortcuts

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