query

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is a helper for building SQL queries with named parameters (jackc/pgx/v5 style for the moment)

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Build

func (qb *Builder) Build(params map[string]interface{}) (string, error)

Build returns the query string with the parameters replaced by the values from the provided map.

func (*Builder) HasParam

func (qb *Builder) HasParam(name string) bool

HasParam checks whether the Builder has a parameter of the given name.

func (*Builder) String

func (qb *Builder) String() string

func (*Builder) WriteString

func (qb *Builder) WriteString(part string)

WriteString appends the provided string to the query and extracts any parameters from it.

Jump to

Keyboard shortcuts

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