Documentation ¶
Overview ¶
Package builder makes SQL queries for data access object
Index ¶
- type Builder
- func (b *Builder) CreateQuery(table tabler.Tabler, opts ...interface{}) (string, []interface{}, error)
- func (b *Builder) SelectQuery(tableName string, condition params.Condition, fields ...string) (string, []interface{}, error)
- func (b *Builder) SelectQueryFields(table tabler.Tabler, condition params.Condition, opts ...interface{}) (string, []interface{}, error)
- func (b *Builder) UpdateQuery(entity tabler.Tabler, condition params.Condition, operation string, ...) (string, []interface{}, error)
- func (b *Builder) UpsertQuery(entities []tabler.Tabler, opts ...interface{}) (string, []interface{}, error)
- type BuilderFace
- type Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { Scanner scanner.Scanner // scanner is a scanner object to interact with tables. // contains filtered or unexported fields }
Builder builds SQL queries
func NewBuilder ¶
NewBuilder constructs a new Builder object
func (*Builder) CreateQuery ¶
func (b *Builder) CreateQuery(table tabler.Tabler, opts ...interface{}) (string, []interface{}, error)
CreateQuery constructs a INSERT SQL query.
func (*Builder) SelectQuery ¶
func (b *Builder) SelectQuery(tableName string, condition params.Condition, fields ...string) (string, []interface{}, error)
SelectQuery constructs a SELECT SQL query.
func (*Builder) SelectQueryFields ¶
func (b *Builder) SelectQueryFields(table tabler.Tabler, condition params.Condition, opts ...interface{}) (string, []interface{}, error)
SelectQueryFields constructs a SELECT SQL query with all fields.
type BuilderFace ¶
type BuilderFace interface { CreateQuery(table tabler.Tabler, opts ...interface{}) (string, []interface{}, error) UpsertQuery(entities []tabler.Tabler, opts ...interface{}) (string, []interface{}, error) SelectQuery(tableName string, condition params.Condition, fields ...string) (string, []interface{}, error) SelectQueryFields(table tabler.Tabler, condition params.Condition, opts ...interface{}) (string, []interface{}, error) UpdateQuery(entity tabler.Tabler, condition params.Condition, operation string, opts ...interface{}) (string, []interface{}, error) }
Click to show internal directories.
Click to hide internal directories.