binder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNKNOWN = iota
	QUESTION
	DOLLAR
	NAMED
	AT
)

Bindvar types supported by Rebind, BindMap and BindStruct.

Variables

This section is empty.

Functions

This section is empty.

Types

type B

type B interface {
	// Type returns the bindtype for a given database given a drivername.
	Type(driverName string) int
	// Driver sets the BindType for driverName to bindType.
	Driver(driverName string, bindType int)
	// Rebind a query from the default bindtype (QUESTION) to the target bindtype.
	Rebind(bindType int, query string) string
	// Experimental implementation of Rebind which uses a bytes.Buffer.  The code is
	// much simpler and should be more resistant to odd unicode, but it is twice as
	// slow.  Kept here for benchmarking purposes and to possibly replace Rebind if
	// problems arise with its somewhat naive handling of unicode.
	RebindBuff(bindType int, query string) string
	// In expands slice values in args, returning the modified query string
	// and a new arg list that can be executed by a database. The `query` should
	// use the `?` bindVar.  The return value uses the `?` bindVar.
	In(query string, args ...any) (string, []any, error)
	// contains filtered or unexported methods
}
var (
	Default B = Binder{}
)

type Binder

type Binder struct{}

Binder is a binder for sqlx.

func (Binder) Driver

func (Binder) Driver(driverName string, bindType int)

func (Binder) In

func (b Binder) In(query string, args ...any) (string, []any, error)

func (Binder) Rebind

func (Binder) Rebind(bindType int, query string) string

func (Binder) RebindBuff

func (Binder) RebindBuff(bindType int, query string) string

func (Binder) Type

func (Binder) Type(driverName string) int

Jump to

Keyboard shortcuts

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