Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Columns ¶
type Columns interface {
// Add columns to the list.
Add(...string) Columns
// String convert Columns to string.
String() string
// Len says the size of the string.
Len() int
// Reset resets the list of columns.
Reset()
}
Columns is list of columns.
func ParseColumns ¶
ParseColumns create a new Columns based on a string(s) input. This function should be called to initiate the Columns field.
type Delete ¶
Delete is the representation of an Delete statement.
type GroupBy ¶
type GroupBy interface {
Columns
}
GroupBy is the representation of the GROUP BY clause.
func ParseGroupBy ¶
ParseGroupBy create a new GroupBy based on a string(s) input. This function should be called to initiate the GroupBy field.
type Having ¶
type Having interface {
Where
}
Having is the representation of the Having clause.
func MakeHaving ¶
MakeHaving create a new Having with complex rules. This function should be called to initiate the Having field.
func ParseHaving ¶
ParseHaving create a new Having based on string input. This function should be called to initiate the Having field.
type Insert ¶
type Insert struct {
Table string
Select Select
IgnoreMode bool
Values H
OnUpdateKeys Keys
OnUpdateRawKeys RawKeys
// contains filtered or unexported fields
}
Insert is the representation of an Insert statement.
type Join ¶
Join is the representation of the Join.
func ParseLeftJoin ¶ added in v0.0.9
ParseLeftJoin create a new left Join.
type On ¶
type On interface {
Where
}
On is the representation of the On clause.
type OrderBy ¶
type OrderBy interface {
Columns
}
OrderBy clause for the SELECT query.
func ParseOrderBy ¶
ParseOrderBy create a new OrderBy based on a string(s) input. This function should be called to initiate the OrderBy field.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is the representation of an Query statement.
func ParseQuery ¶ added in v0.0.6
ParseQuery create a new Query based on string input.
type Select ¶
type Select struct {
Table string
Columns Columns
Joins Joins
Where Where
Having Having
GroupBy GroupBy
OrderBy OrderBy
Limit uint64
Offset uint64
}
Select is the representation of the Select statement.
type Update ¶
Update is the representation of an Update statement.
type Where ¶
type Where interface {
// Args return the arguments of the where.
Args() []any
// String convert Where to string.
String() string
// And add a new condition "AND".
And(str string, args ...any) Where
// AndIf a new condition "AND" if args is Valid & and not Zero.
AndIf(str string, arg any) Where
// AndIn add a new condition "AND" with the operator IN.
AndIn(col string, s Slicer) Where
// AndNotIn add a new condition "AND" with the operator NOT IN.
AndNotIn(col string, s Slicer) Where
// AndWhere merge Where's inside parenthesis with AND condition.
// AND ( where )
AndWhere(in ...Where) Where
// Or add a new condition "OR".
Or(str string, args ...any) Where
// OrIf a new condition "or" if args is Valid & and not Zero.
OrIf(str string, arg any) Where
// OrIn add a new condition "OR" with the operator IN.
OrIn(col string, s Slicer) Where
// OrNotIn add a new condition "OR" with the operator NOT IN.
OrNotIn(col string, s Slicer) Where
// OrWhere merge Where's inside parenthesis with OR condition.
// OR ( where )
OrWhere(in ...Where) Where
// Len says the length of the string.
Len() int
}
Where clause for the SQL query.
func MakeWhere ¶
MakeWhere create a new Where with complex rules. This function should be called to initiate the Where field.
func ParseWhere ¶
ParseWhere create a new Where based on string input. This function should be called to initiate the Where field.