builder

package
v0.0.0-...-7203340 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: MIT 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 builder for SQL statements

func New

func New(d Dialect, word string) *Builder

New returns a new SQL statement builder

func (*Builder) Append

func (b *Builder) Append(word string)

Append a phrase to the statement

func (*Builder) Args

func (b *Builder) Args() []interface{}

Args returns the collected argument list

func (*Builder) Close

func (b *Builder) Close()

Close closes parentheses

func (*Builder) Comma

func (b *Builder) Comma()

Comma adds a comma

func (*Builder) Open

func (b *Builder) Open()

Open opens parentheses

func (*Builder) Quote

func (b *Builder) Quote(word string)

Quote appends the word quoted

func (*Builder) QuoteFullName

func (b *Builder) QuoteFullName(surename, firstname string)

QuoteFullName quotes two names with a dot between them

func (*Builder) Statement

func (b *Builder) Statement() string

Statement returns the statement, and return the used buffer so no longer calls to builder can be done afterwards

func (*Builder) Var

func (b *Builder) Var(arg interface{})

Var adds a placeholder for a variable in the statement, and adds the variable to the list of arguments

type Dialect

type Dialect interface {
	Quote(string) string
	Var(int) string
}

Dialect is dialect interface for a builder

Jump to

Keyboard shortcuts

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