Documentation ¶
Index ¶
- type Sqlbuilder
- func (s *Sqlbuilder) Build() string
- func (s *Sqlbuilder) BuildInsert(table string, data interface{}, additionalQuery ...string) (string, error)
- func (s *Sqlbuilder) BuildUpdate(table string, data interface{}, additionalQuery string) (string, error)
- func (s *Sqlbuilder) Column(column string, value interface{}) *Sqlbuilder
- func (s *Sqlbuilder) Count() string
- func (s *Sqlbuilder) DeleteFrom(fromStmt string) *Sqlbuilder
- func (s *Sqlbuilder) Exists() string
- func (s *Sqlbuilder) From(fromStmt string) *Sqlbuilder
- func (s *Sqlbuilder) Insert(table string) *Sqlbuilder
- func (s *Sqlbuilder) LeftJoin(table string, as string, on string) *Sqlbuilder
- func (s *Sqlbuilder) LeftJoinExtended(table string, as string, on string, additionalQuery ...string) *Sqlbuilder
- func (s *Sqlbuilder) Limit(limit int) *Sqlbuilder
- func (s *Sqlbuilder) Offset(offset int) *Sqlbuilder
- func (s *Sqlbuilder) OrderBy(column string, diretion string) *Sqlbuilder
- func (s *Sqlbuilder) Reset() *Sqlbuilder
- func (s *Sqlbuilder) Select(selectStmt ...string) *Sqlbuilder
- func (s *Sqlbuilder) SelectRaw(selectStmt string) *Sqlbuilder
- func (s *Sqlbuilder) Update(table string) *Sqlbuilder
- func (s *Sqlbuilder) Where(table string, operator string, value interface{}) *Sqlbuilder
- func (s *Sqlbuilder) WhereIn(column string, params interface{}) *Sqlbuilder
- func (s *Sqlbuilder) WhereRaw(whereStmt string) *Sqlbuilder
- func (s *Sqlbuilder) WhereStringMatchAll(column string, params []string) *Sqlbuilder
- func (s *Sqlbuilder) WhereStringMatchAny(column string, params []string) *Sqlbuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sqlbuilder ¶
type Sqlbuilder struct { Dialect string //Can be postgres, mysql or (more to come) // contains filtered or unexported fields }
func New ¶
func New(dialect string) *Sqlbuilder
func (*Sqlbuilder) Build ¶
func (s *Sqlbuilder) Build() string
func (*Sqlbuilder) BuildInsert ¶
func (s *Sqlbuilder) BuildInsert(table string, data interface{}, additionalQuery ...string) (string, error)
func (*Sqlbuilder) BuildUpdate ¶
func (s *Sqlbuilder) BuildUpdate(table string, data interface{}, additionalQuery string) (string, error)
func (*Sqlbuilder) Column ¶
func (s *Sqlbuilder) Column(column string, value interface{}) *Sqlbuilder
Column
Adds a string column for INSERT & UPDATE statements.
func (*Sqlbuilder) Count ¶
func (s *Sqlbuilder) Count() string
func (*Sqlbuilder) DeleteFrom ¶
func (s *Sqlbuilder) DeleteFrom(fromStmt string) *Sqlbuilder
func (*Sqlbuilder) Exists ¶
func (s *Sqlbuilder) Exists() string
func (*Sqlbuilder) From ¶
func (s *Sqlbuilder) From(fromStmt string) *Sqlbuilder
func (*Sqlbuilder) Insert ¶
func (s *Sqlbuilder) Insert(table string) *Sqlbuilder
Insert
Sets the insert table statement to the table name.
func (*Sqlbuilder) LeftJoin ¶
func (s *Sqlbuilder) LeftJoin(table string, as string, on string) *Sqlbuilder
func (*Sqlbuilder) LeftJoinExtended ¶
func (s *Sqlbuilder) LeftJoinExtended(table string, as string, on string, additionalQuery ...string) *Sqlbuilder
func (*Sqlbuilder) Limit ¶
func (s *Sqlbuilder) Limit(limit int) *Sqlbuilder
func (*Sqlbuilder) Offset ¶
func (s *Sqlbuilder) Offset(offset int) *Sqlbuilder
func (*Sqlbuilder) OrderBy ¶
func (s *Sqlbuilder) OrderBy(column string, diretion string) *Sqlbuilder
func (*Sqlbuilder) Reset ¶
func (s *Sqlbuilder) Reset() *Sqlbuilder
func (*Sqlbuilder) Select ¶
func (s *Sqlbuilder) Select(selectStmt ...string) *Sqlbuilder
func (*Sqlbuilder) SelectRaw ¶
func (s *Sqlbuilder) SelectRaw(selectStmt string) *Sqlbuilder
func (*Sqlbuilder) Update ¶
func (s *Sqlbuilder) Update(table string) *Sqlbuilder
Update
Sets the update table statement to the table name.
func (*Sqlbuilder) Where ¶
func (s *Sqlbuilder) Where(table string, operator string, value interface{}) *Sqlbuilder
func (*Sqlbuilder) WhereIn ¶
func (s *Sqlbuilder) WhereIn(column string, params interface{}) *Sqlbuilder
Accepts Slice of INT, FLOAT32, STRING, or a simple comma separated STRING
func (*Sqlbuilder) WhereRaw ¶
func (s *Sqlbuilder) WhereRaw(whereStmt string) *Sqlbuilder
func (*Sqlbuilder) WhereStringMatchAll ¶
func (s *Sqlbuilder) WhereStringMatchAll(column string, params []string) *Sqlbuilder
func (*Sqlbuilder) WhereStringMatchAny ¶
func (s *Sqlbuilder) WhereStringMatchAny(column string, params []string) *Sqlbuilder
Click to show internal directories.
Click to hide internal directories.