base

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseQueryBuilder

func NewBaseQueryBuilder

func NewBaseQueryBuilder() *BaseQueryBuilder

func (BaseQueryBuilder) Build

func (m BaseQueryBuilder) Build(sb *[]byte, q *structs.Query, number int, unions *[]structs.Union) ([]interface{}, error)

Build builds the query.

func (BaseQueryBuilder) Lock

func (BaseQueryBuilder) Lock(sb *[]byte, lock *structs.Lock)

Lock returns the lock statement.

type DeleteBaseBuilder

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

func NewDeleteBaseBuilder

func NewDeleteBaseBuilder(util interfaces.SQLUtils, iq *structs.DeleteQuery) *DeleteBaseBuilder

func (*DeleteBaseBuilder) BuildDelete

func (m *DeleteBaseBuilder) BuildDelete(q *structs.DeleteQuery) (string, []interface{}, error)

DeleteBatch builds the Delete query for Delete.

func (*DeleteBaseBuilder) Delete

type FromBaseBuilder

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

func NewFromBaseBuilder

func NewFromBaseBuilder(util interfaces.SQLUtils) *FromBaseBuilder

func (FromBaseBuilder) From

func (f FromBaseBuilder) From(sb *[]byte, table string)

type GroupByBaseBuilder

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

func NewGroupByBaseBuilder

func NewGroupByBaseBuilder(util interfaces.SQLUtils) *GroupByBaseBuilder

func (GroupByBaseBuilder) GroupBy

func (g GroupByBaseBuilder) GroupBy(sb *[]byte, groupBy *structs.GroupBy) []interface{}

type InsertBaseBuilder

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

func NewInsertBaseBuilder

func NewInsertBaseBuilder(util interfaces.SQLUtils, iq *structs.InsertQuery) *InsertBaseBuilder

func (InsertBaseBuilder) BuildInsert

func (m InsertBaseBuilder) BuildInsert(q *structs.InsertQuery) (string, []interface{}, error)

BuildInsert builds the INSERT query.

func (InsertBaseBuilder) Insert

func (m InsertBaseBuilder) Insert(q *structs.InsertQuery) (string, []interface{}, error)

Insert builds the INSERT query.

func (InsertBaseBuilder) InsertBatch

func (m InsertBaseBuilder) InsertBatch(q *structs.InsertQuery) (string, []interface{}, error)

InsertBatch builds the INSERT query for batch insert.

func (InsertBaseBuilder) InsertIgnore

func (m InsertBaseBuilder) InsertIgnore(q *structs.InsertQuery) (string, []interface{}, error)

func (*InsertBaseBuilder) InsertUsing

func (m *InsertBaseBuilder) InsertUsing(q *structs.InsertQuery) (string, []interface{}, error)

func (InsertBaseBuilder) Upsert

func (m InsertBaseBuilder) Upsert(q *structs.InsertQuery) (string, []interface{}, error)

type JoinBaseBuilder

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

func NewJoinBaseBuilder

func NewJoinBaseBuilder(util interfaces.SQLUtils, j *structs.Joins) *JoinBaseBuilder

func (*JoinBaseBuilder) Join

func (jb *JoinBaseBuilder) Join(sb *[]byte, joins *structs.Joins) []interface{}

Join builds the JOIN query.

type LimitBaseBuilder

type LimitBaseBuilder struct {
}

func NewLimitBaseBuilder

func NewLimitBaseBuilder() *LimitBaseBuilder

func (LimitBaseBuilder) Limit

func (LimitBaseBuilder) Limit(sb *[]byte, limit structs.Limit)

type OffsetBaseBuilder

type OffsetBaseBuilder struct {
}

func NewOffsetBaseBuilder

func NewOffsetBaseBuilder() *OffsetBaseBuilder

func (OffsetBaseBuilder) Offset

func (OffsetBaseBuilder) Offset(sb *[]byte, offset structs.Offset)

type OrderByBaseBuilder

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

func NewOrderByBaseBuilder

func NewOrderByBaseBuilder(util interfaces.SQLUtils, order *[]structs.Order) *OrderByBaseBuilder

func (OrderByBaseBuilder) OrderBy

func (o OrderByBaseBuilder) OrderBy(sb *[]byte, order *[]structs.Order)

type SQLUtils

type SQLUtils struct {
}

func NewSQLUtils

func NewSQLUtils() *SQLUtils

func (*SQLUtils) Dialect

func (s *SQLUtils) Dialect() string

func (*SQLUtils) EscapeIdentifier

func (s *SQLUtils) EscapeIdentifier(sb []byte, v string) []byte

func (*SQLUtils) EscapeIdentifierAliasedValue

func (s *SQLUtils) EscapeIdentifierAliasedValue(sb []byte, value string) []byte

func (*SQLUtils) GetAlias

func (s *SQLUtils) GetAlias(value string) string

func (*SQLUtils) GetPlaceholder

func (s *SQLUtils) GetPlaceholder() string

func (*SQLUtils) GetQueryBuilderStrategy

func (s *SQLUtils) GetQueryBuilderStrategy() interfaces.QueryBuilderStrategy

type SelectBaseBuilder

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

func NewSelectBaseBuilder

func NewSelectBaseBuilder(u interfaces.SQLUtils, columnNames *[]string) *SelectBaseBuilder

func (*SelectBaseBuilder) Select

func (b *SelectBaseBuilder) Select(sb *[]byte, columns *[]structs.Column, tableName string, joins *structs.Joins) []interface{}

type UnionBaseBuilder

type UnionBaseBuilder struct {
}

func NewUnionBaseBuilder

func NewUnionBaseBuilder() *UnionBaseBuilder

func (*UnionBaseBuilder) Union

func (ub *UnionBaseBuilder) Union(sb *[]byte, unions *[]structs.Union, number int)

type UpdateBaseBuilder

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

func NewUpdateBaseBuilder

func NewUpdateBaseBuilder(util interfaces.SQLUtils, iq *structs.UpdateQuery) *UpdateBaseBuilder

func (*UpdateBaseBuilder) BuildUpdate

func (m *UpdateBaseBuilder) BuildUpdate(q *structs.UpdateQuery) (string, []interface{}, error)

UpdateBatch builds the Update query for Update.

func (*UpdateBaseBuilder) Update

type WhereBaseBuilder

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

func NewWhereBaseBuilder

func NewWhereBaseBuilder(util interfaces.SQLUtils, wg []structs.WhereGroup) *WhereBaseBuilder

func (*WhereBaseBuilder) GetConditionGroupSeparator

func (wb *WhereBaseBuilder) GetConditionGroupSeparator(cg structs.WhereGroup, index int) string

func (*WhereBaseBuilder) GetConditionOperator

func (wb *WhereBaseBuilder) GetConditionOperator(c structs.Where) string

func (*WhereBaseBuilder) GetNotSeparator

func (wb *WhereBaseBuilder) GetNotSeparator(cg structs.WhereGroup) string

func (*WhereBaseBuilder) GetParenthesesClose

func (wb *WhereBaseBuilder) GetParenthesesClose(cg structs.WhereGroup) string

func (*WhereBaseBuilder) GetParenthesesOpen

func (wb *WhereBaseBuilder) GetParenthesesOpen(cg structs.WhereGroup) string

func (*WhereBaseBuilder) HasCondition

func (wb *WhereBaseBuilder) HasCondition(wg []structs.WhereGroup) bool

func (*WhereBaseBuilder) ProcessBetweenCondition

func (wb *WhereBaseBuilder) ProcessBetweenCondition(sb *[]byte, c structs.Where) []interface{}

func (*WhereBaseBuilder) ProcessExistsQuery

func (wb *WhereBaseBuilder) ProcessExistsQuery(sb *[]byte, c structs.Where) []interface{}

func (*WhereBaseBuilder) ProcessFullText

func (wb *WhereBaseBuilder) ProcessFullText(sb *[]byte, c structs.Where) ([]interface{}, error)

func (*WhereBaseBuilder) ProcessFunction

func (wb *WhereBaseBuilder) ProcessFunction(sb *[]byte, c structs.Where) []interface{}

func (*WhereBaseBuilder) ProcessRawCondition

func (wb *WhereBaseBuilder) ProcessRawCondition(sb *[]byte, c structs.Where) []interface{}

func (*WhereBaseBuilder) ProcessSubQuery

func (wb *WhereBaseBuilder) ProcessSubQuery(sb *[]byte, c structs.Where) []interface{}

func (*WhereBaseBuilder) Where

func (wb *WhereBaseBuilder) Where(sb *[]byte, wg []structs.WhereGroup) ([]interface{}, error)

Jump to

Keyboard shortcuts

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