builder

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 2 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 {
	GroupBy string
	OrderBy string
	Params  []interface{}
	Select  string
	Where   string
	// contains filtered or unexported fields
}

Builder -

func (*Builder) BuildQuery

func (b *Builder) BuildQuery(tableName string) string

BuildQuery - It takes care of building the query

func (*Builder) GroupByField

func (b *Builder) GroupByField(fields ...string) *Builder

GroupByField - Builds "group by" expression GroupByField - Costruisce una condizione di group by

func (*Builder) OrderByAsc

func (b *Builder) OrderByAsc(fields ...string) *Builder

OrderByAsc - Build "order by" expression ASC

func (*Builder) OrderByDesc

func (b *Builder) OrderByDesc(fields ...string) *Builder

OrderByDesc - Build "order by" expression DESC

func (*Builder) ResetStmt

func (b *Builder) ResetStmt()

ResetStmt - Resets stmt fields with initial values

func (*Builder) SelectField

func (b *Builder) SelectField(fields ...string) *Builder

SelectField - Builds the n-fields passed in "select" expression

func (*Builder) WhereEqual

func (b *Builder) WhereEqual(field string, value interface{}) *Builder

WhereEqual - Builds "where" expression with "=" operator

func (*Builder) WhereNull

func (b *Builder) WhereNull(field string, isNull bool) *Builder

WhereNull - Builds "where" expression on nullable field, if isNull is TRUE checks for "IS NULL" otherwise "IS NOT NULL"

func (*Builder) WhereOperator

func (b *Builder) WhereOperator(field string, operator string, value interface{}) *Builder

WhereOperator - Builds "where" expression with passed operator, no checks if is valid operator

type QueryBuilderInterface

type QueryBuilderInterface interface {
	PrepareStmt(tableName string) (*sql.Stmt, error)
}

QueryBuilderInterface -

Jump to

Keyboard shortcuts

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