# Functions
And joins the list of predicates together with the AND operator.
Array returns a new ArrayField representing a literal string value.
Avg represents the AVG() aggregate function.
AvgOver represents the AVG() OVER window function.
Bool returns a new Boolean Field representing a literal bool value.
Bytes returns a new BinaryField representing a literal []byte value.
Case creates a new SimpleCases i.e.
CaseWhen creates a new PredicateCases i.e.
Count represents the COUNT(*) aggregate function.
CountOver represents the COUNT(*) OVER window function.
CumeDistOver represents the CUME_DIST() OVER window function.
CustomJoin constructs a new JoinTable.
DeleteFrom creates a new DeleteQuery.
DenseRankOver represents the DENSE_RANK() OVER window function.
Eq returns an 'X = Y' Predicate.
Except joins the list of queries together with the EXCEPT operator.
ExceptAll joins the list of queries together with the EXCEPT ALL operator.
Excluded wraps a field to simulate the EXCLUDED.field Postgres construct for the ON CONFLICT DO UPDATE SET clause.
Exists represents the EXISTS() predicate.
Fieldf is a CustomField constructor.
FirstValueOver represents the FIRST_VALUE(field) OVER window function.
Float64 returns a new NumberField representing a literal float64 value.
From creates a new SelectQuery.
FullJoin creates a new full join.
Functionf creates a new FunctionInfo.
Ge returns an 'X >= Y' Predicate.
Gt returns an 'X > Y' Predicate.
In returns an 'X IN (Y)' Predicate.
InsertInto creates a new InsertQuery.
Int returns a new NumberField representing a literal int value.
Int64 returns a new NumberField representing a literal int64 value.
Intersect joins the list of queries together with the INTERSECT operator.
IntersectAll joins the list of queries together with the INTERSECT ALL operator.
Join creates a new inner join.
JSON returns a new JSONField representing a literal JSONable value.
JSONValue returns a new JSONField representing a driver.Valuer value.
LagOver represents the LAG(field, offset, fallback) OVER window function.
LastValueOver represents the LAST_VALUE(field) OVER window function.
Le returns an 'X <= Y' Predicate.
LeadOver represents the LEAD(field, offset, fallback) OVER window function.
LeftJoin creates a new left join.
Lt returns an 'X < Y' Predicate.
Max represents the MAX() aggregate function.
MaxOver represents the MAX() OVER window function.
Min represents the MIN() aggregate function.
MinOver represents the MIN() OVER window function.
MustJSON is like JSON but it panics on error.
Ne returns an 'X <> Y' Predicate.
NewArrayField returns a new ArrayField representing an array column.
NewBinaryField returns a new BinaryField representing a BYTEA column.
NewBooleanField returns a new BooleanField representing a boolean column.
NewEnumField returns an EnumField representing an enum column.
NewJSONField returns a new JSONField representing a JSON column.
NewNumberField returns a new NumberField representing a number TableInfo column.
NewStringField returns a new StringField representing a boolean column.
NewTimeField returns a new TimeField representing a time column.
NewUUIDField returns a new UUIDField representing a UUID column.
Not inverts the Predicate i.e.
NthValueOver represents the NTH_VALUE(field, n) OVER window function.
NtileOver represents the NTILE(n) OVER window function.
NumberFieldf creates a new number expression.
Or joins the list of predicates together with the OR operator.
OrderBy creates a new Window.
PartitionBy creates a new Window.
PercentRankOver represents the PERCENT_RANK() OVER window function.
Predicatef creates a new CustomPredicate.
RankOver represents the RANK() OVER window function.
RecursiveCTE constructs a new recursive CTE.
RightJoin creates a new right join.
RowNumberOver represents the ROW_NUMBER() OVER window function.
Select creates a new SelectQuery.
SelectDistinct creates a new SelectQuery.
SelectDistinctOn creates a new SelectQuery.
SelectOne creates a new SelectQuery.
SelectRowx creates a new SelectQuery.
Selectx creates a new SelectQuery.
String returns a new StringField representing a literal string value.
Sum represents the SUM() aggregate function.
SumOver represents the SUM() OVER window function.
Time returns a new TimeField representing a literal time.Time value.
Union joins the list of queries together with the UNION operator.
UnionAll joins the list of queries together with the UNION ALL operator.
Update creates a new UpdateQuery.
UUID returns a new UUIDField representing a literal UUID value.
With creates a new BaseQuery with the CTEs.
WithDB creates a new BaseQuery with the DB.
WithDefaultLog creates a new BaseQuery with the default logger and the LogFlag.
# Constants
ExecFlags.
ExitCodes.
JoinTypes.
JoinTypes.
JoinTypes.
JoinTypes.
LogFlags.
LogFlags.
LogFlags.
Lparse.
Possible VariadicOperators.
Possible VariadicOperators.
VariadicQueryOperators.
VariadicQueryOperators.
VariadicQueryOperators.
VariadicQueryOperators.
VariadicQueryOperators.
VariadicQueryOperators.
SelectTypes.
SelectTypes.
SelectTypes.
# Structs
ArrayField either represents an ARRAY column, or a literal slice value.
BaseQuery is a common query builder that can transform into a SelectQuery, InsertQuery, UpdateQuery or DeleteQuery depending on the method that you call on it.
BinaryField either represents a BYTEA column or a literal []byte value.
BooleanField either represents a boolean column or a literal bool value.
Column keeps track of what the values mapped to what Field in an InsertQuery/SelectQuery.
CustomAssignment is an Assignment that can render itself in an arbitrary way by calling expandValues on its Format and Values.
CustomField is a Field that can render itself in an arbitrary way by calling expandValues on its Format and Values.
CustomPredicate is a Query that can render itself in an arbitrary way as defined by its Format string.
DeleteQuery represents a DELETE query.
FieldAssignment represents a Field and Value set.
FunctionInfo is struct that implements the Table/Field interface, containing all the information needed to call itself a Table/Field.
InsertConflict holds the intermediate state of an InsertQuery that may experience a conflict.
InsertQuery represents an INSERT query.
JoinTable represents an SQL join.
JSONField either represents a JSON column or a literal value that can be marshalled into a JSON string.
NumberField either represents a number column, a number expression or a literal number value.
PredicateCase represents a Predicate and the Result if the Predicate is true.
PredicateCases is the general form of the CASE expression.
Row represents the state of a row after a call to rows.Next().
SelectQuery represents a SELECT query.
SimpleCase represents a Value to be compared against and the Result if it matches.
SimpleCases is the simple form of the CASE expression.
StringField either represents a string column or a literal string value.
TableInfo is struct that implements the Table interface, containing all the information needed to call itself a Table.
TimeField either represents a time column or a literal time.Time value.
UpdateQuery represents an UPDATE query.
UUIDField represents a UUID column or a literal UUID value.
VariadicPredicate represents the "x AND y AND z..." or "x OR y OR z..." SQL construct.
VariadicQuery represents a variadic number of queries joined together by an VariadicQueryOperator.
Window represents a window usable in a window function.
# Interfaces
Assignment is an interface representing an SQL Assignment 'Field = Value'.
BaseTable is an interface that specialises the Table interface.
DB is an interface providing database querying abilities.
Field is an interface that represents either a Table column or an SQL value.
Logger is an interface that provides logging.
Predicate is an interface that evaluates to true or false in SQL.
Query is an interface that specialises the Table interface.
No description provided by the author
No description provided by the author
Table is an interface representing anything that you can SELECT FROM or JOIN.
# Type aliases
Assignments is a list of Assignments, when translated to SQL it looks something like "SET field1 = value1, field2 = value2, etc...".
CTE represents an SQL CTE.
EnumField is a type alias for StringField.
ExecFlag is a flag that affects the behavior of Exec.
ExitCode represents a reason for terminating the rows.Next() loop.
FieldLiteral is a Field where its underlying string is literally plugged into the SQL query.
Fields represents the "field1, field2, etc..." SQL construct.
IntermediateCTE is a CTE used to hold the intermediate state of a recursive CTE just after the CTE's initial query is declared.
JoinTables is a list of JoinTables.
JoinType represents the various types of SQL joins.
Literal allows for the underlying string to be literally plugged into the SQL query.
LogFlag is a flag that affects the verbosity of the Logger output.
RowValue represents an SQL Row Value Expression i.e.
RowValues represents a list of RowValues (a, b, c...), (d, e, f...), (g, h, i...).
SelectType represents the various SQL selects.
Subquery represents an SQL subquery.
VariadicPredicateOperator is an operator that can join a variadic number of Predicates together.
VariadicQueryOperator is an operator that can join a variadic number of queries together.
Windows is a list of Windows.