Documentation ¶
Index ¶
- Constants
- Variables
- func CAST(expr Expression) cast
- func EXCEPT(lhs, rhs jet.SerializerStatement) setStatement
- func EXCEPT_ALL(lhs, rhs jet.SerializerStatement) setStatement
- func FOLLOWING(offset int64) jet.FrameExtent
- func INTERSECT(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
- func INTERSECT_ALL(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
- func PRECEDING(offset int64) jet.FrameExtent
- func SET(assigments ...ColumnAssigment) conflictAction
- func UNION(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
- func UNION_ALL(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
- func WITH(cte ...jet.CommonTableExpressionDefinition) func(statement jet.Statement) Statement
- type BoolExpression
- type Column
- type ColumnAssigment
- type ColumnBool
- type ColumnDate
- type ColumnFloat
- type ColumnInteger
- type ColumnInterval
- type ColumnList
- type ColumnString
- type ColumnTime
- type ColumnTimestamp
- type ColumnTimestampz
- type ColumnTimez
- type CommonTableExpression
- func (r CommonTableExpression) CROSS_JOIN(table ReadableTable) ReadableTable
- func (r CommonTableExpression) FULL_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
- func (r CommonTableExpression) INNER_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
- func (r CommonTableExpression) LEFT_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
- func (r CommonTableExpression) RIGHT_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
- func (r CommonTableExpression) SELECT(projection1 Projection, projections ...Projection) SelectStatement
- type DateExpression
- type DeleteStatement
- type Expression
- type FloatExpression
- type InsertStatement
- type IntegerExpression
- type IntervalExpression
- type LockStatement
- type NumericExpression
- type PrintableStatement
- type Projection
- type ProjectionList
- type ReadableTable
- type RowLock
- type SelectStatement
- type SelectTable
- type Statement
- type StringExpression
- type Table
- type TableLockMode
- type TimeExpression
- type TimestampExpression
- type TimestampzExpression
- type TimezExpression
- type UpdateStatement
- type WritableTable
Constants ¶
const ( YEAR quantityAndUnit = 123456789 + iota MONTH WEEK DAY HOUR MINUTE SECOND MILLISECOND MICROSECOND DECADE CENTURY MILLENNIUM )
Interval unit types
const ( // DEFAULT is jet equivalent of SQL DEFAULT DEFAULT = jet.DEFAULT )
Variables ¶
var ( // NULL is jet equivalent of SQL NULL NULL = jet.NULL // STAR is jet equivalent of SQL * STAR = jet.STAR )
var ( UPDATE = jet.NewRowLock("UPDATE") NO_KEY_UPDATE = jet.NewRowLock("NO KEY UPDATE") SHARE = jet.NewRowLock("SHARE") KEY_SHARE = jet.NewRowLock("KEY SHARE") )
Row lock types
var ( PARTITION_BY = jet.PARTITION_BY ORDER_BY = jet.ORDER_BY UNBOUNDED = int64(math.MaxInt64) CURRENT_ROW = jet.CURRENT_ROW )
Window function clauses
var ABSf = jet.ABSf
ABSf calculates absolute value from float expression
var ABSi = jet.ABSi
ABSi calculates absolute value from int expression
var AVG = jet.AVG
AVG is aggregate function used to calculate avg value from numeric expression
var BIT_AND = jet.BIT_AND
BIT_AND is aggregate function used to calculates the bitwise AND of all non-null input values, or null if none.
var BIT_LENGTH = jet.BIT_LENGTH
BIT_LENGTH returns number of bits in string expression
var BIT_NOT = jet.BIT_NOT
BIT_NOT inverts every bit in integer expression result
var BIT_OR = jet.BIT_OR
BIT_OR is aggregate function used to calculates the bitwise OR of all non-null input values, or null if none.
var BOOL_AND = jet.BOOL_AND
BOOL_AND is aggregate function. Returns true if all input values are true, otherwise false
var BOOL_OR = jet.BOOL_OR
BOOL_OR is aggregate function. Returns true if at least one input value is true, otherwise false
var BTRIM = jet.BTRIM
BTRIM removes the longest string consisting only of characters in characters (a space by default) from the start and end of string
var Bool = jet.Bool
Bool creates new bool literal expression
var BoolColumn = jet.BoolColumn
BoolColumn creates named bool column.
var BoolExp = jet.BoolExp
BoolExp is bool expression wrapper around arbitrary expression. Allows go compiler to see any expression as bool expression. Does not add sql cast to generated sql builder output.
var Bytea = func(value string) StringExpression { return CAST(jet.String(value)).AS_BYTEA() }
Bytea craates new bytea literal expression
var CASE = jet.CASE
CASE create CASE operator with optional list of expressions
var CBRT = jet.CBRT
CBRT calculates cube root of numeric expression
var CEIL = jet.CEIL
CEIL calculates ceil of float expression
var CHAR_LENGTH = jet.CHAR_LENGTH
CHAR_LENGTH returns number of characters in string expression
var CHR = jet.CHR
CHR returns character with the given code.
var COALESCE = jet.COALESCE
COALESCE function returns the first of its arguments that is not null.
var CONCAT = func(expressions ...Expression) StringExpression { return jet.CONCAT(explicitLiteralCasts(expressions...)...) }
CONCAT adds two or more expressions together
var CONVERT = jet.CONVERT
CONVERT converts string to dest_encoding. The original encoding is specified by src_encoding. The string must be valid in this encoding.
var CONVERT_FROM = jet.CONVERT_FROM
CONVERT_FROM converts string to the database encoding. The original encoding is specified by src_encoding. The string must be valid in this encoding.
var CONVERT_TO = jet.CONVERT_TO
CONVERT_TO converts string to dest_encoding.
var COUNT = jet.COUNT
COUNT is aggregate function. Returns number of input rows for which the value of expression is not null.
var CUME_DIST = jet.CUME_DIST
CUME_DIST calculates cumulative distribution: (number of partition rows preceding or peer with current row) / total partition rows
var CURRENT_DATE = jet.CURRENT_DATE
CURRENT_DATE returns current date
var CURRENT_TIME = jet.CURRENT_TIME
CURRENT_TIME returns current time with time zone
var CURRENT_TIMESTAMP = jet.CURRENT_TIMESTAMP
CURRENT_TIMESTAMP returns current timestamp with time zone
var DECODE = jet.DECODE
DECODE decodes binary data from textual representation in string. Options for format are same as in encode.
var DENSE_RANK = jet.DENSE_RANK
DENSE_RANK returns rank of the current row without gaps; this function counts peer groups
var Date = func(year int, month time.Month, day int) DateExpression { return CAST(jet.Date(year, month, day)).AS_DATE() }
Date creates new date literal expression
var DateColumn = jet.DateColumn
DateColumn creates named date column.
var DateExp = jet.DateExp
DateExp is date expression wrapper around arbitrary expression. Allows go compiler to see any expression as date expression. Does not add sql cast to generated sql builder output.
var DateT = func(t time.Time) DateExpression { return CAST(jet.DateT(t)).AS_DATE() }
DateT creates new date literal expression from time.Time object
var Dialect = newDialect()
Dialect is implementation of postgres dialect for SQL Builder serialisation.
var ENCODE = jet.ENCODE
ENCODE encodes binary data into a textual representation. Supported formats are: base64, hex, escape. escape converts zero bytes and high-bit-set bytes to octal sequences (\nnn) and doubles backslashes.
var EVERY = jet.EVERY
EVERY is aggregate function. Returns true if all input values are true, otherwise false
var EXISTS = jet.EXISTS
EXISTS checks for existence of the rows in subQuery
var FIRST_VALUE = jet.FIRST_VALUE
FIRST_VALUE returns value evaluated at the row that is the first row of the window frame
var FLOOR = jet.FLOOR
FLOOR calculates floor of float expression
var Float = jet.Float
Float creates new float literal expression
var FloatColumn = jet.FloatColumn
FloatColumn creates named float column.
var FloatExp = jet.FloatExp
FloatExp is date expression wrapper around arbitrary expression. Allows go compiler to see any expression as float expression. Does not add sql cast to generated sql builder output.
var GREATEST = jet.GREATEST
GREATEST selects the largest value from a list of expressions
var INITCAP = jet.INITCAP
INITCAP converts the first letter of each word to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters.
var Int = jet.Int
Int creates new integer literal expression
var IntExp = jet.IntExp
IntExp is int expression wrapper around arbitrary expression. Allows go compiler to see any expression as int expression. Does not add sql cast to generated sql builder output.
var IntegerColumn = jet.IntegerColumn
IntegerColumn creates named integer column.
var LAG = jet.LAG
LAG returns value evaluated at the row that is offset rows before the current row within the partition; if there is no such row, instead return default (which must be of the same type as value). Both offset and default are evaluated with respect to the current row. If omitted, offset defaults to 1 and default to null
var LAST_VALUE = jet.LAST_VALUE
LAST_VALUE returns value evaluated at the row that is the last row of the window frame
var LEAD = jet.LEAD
LEAD returns value evaluated at the row that is offset rows after the current row within the partition; if there is no such row, instead return default (which must be of the same type as value). Both offset and default are evaluated with respect to the current row. If omitted, offset defaults to 1 and default to null
var LEAST = jet.LEAST
LEAST selects the smallest value from a list of expressions
var LEFT = jet.LEFT
LEFT returns first n characters in the string. When n is negative, return all but last |n| characters.
var LENGTH = jet.LENGTH
LENGTH returns number of characters in string with a given encoding
var LN = jet.LN
LN calculates natural algorithm of float expression
var LOCALTIME = jet.LOCALTIME
LOCALTIME returns local time of day using optional precision
var LOCALTIMESTAMP = jet.LOCALTIMESTAMP
LOCALTIMESTAMP returns current date and time using optional precision
var LOG = jet.LOG
LOG calculates logarithm of float expression
var LOWER = jet.LOWER
LOWER returns string expression in lower case
var LPAD = jet.LPAD
LPAD fills up the string to length length by prepending the characters fill (a space by default). If the string is already longer than length then it is truncated (on the right).
var LTRIM = jet.LTRIM
LTRIM removes the longest string containing only characters from characters (a space by default) from the start of string
var MAX = jet.MAX
MAX is aggregate function. Returns maximum value of expression across all input values
var MAXf = jet.MAXf
MAXf is aggregate function. Returns maximum value of float expression across all input values
var MAXi = jet.MAXi
MAXi is aggregate function. Returns maximum value of int expression across all input values
var MD5 = jet.MD5
MD5 calculates the MD5 hash of string, returning the result in hexadecimal
var MIN = jet.MIN
MIN is aggregate function. Returns minimum value of expression across all input values.
var MINf = jet.MINf
MINf is aggregate function. Returns minimum value of float expression across all input values
var MINi = jet.MINi
MINi is aggregate function. Returns minimum value of int expression across all input values
var NOT = jet.NOT
NOT returns negation of bool expression result
var NOW = jet.NOW
NOW returns current date and time
var NTH_VALUE = jet.NTH_VALUE
NTH_VALUE returns value evaluated at the row that is the nth row of the window frame (counting from 1); null if no such row
var NTILE = jet.NTILE
NTILE returns integer ranging from 1 to the argument value, dividing the partition as equally as possible
var NULLIF = jet.NULLIF
NULLIF function returns a null value if value1 equals value2; otherwise it returns value1.
var NewEnumValue = jet.NewEnumValue
NewEnumValue creates new named enum value
var OCTET_LENGTH = jet.OCTET_LENGTH
OCTET_LENGTH returns number of bytes in string expression
var PERCENT_RANK = jet.PERCENT_RANK
PERCENT_RANK calculates relative rank of the current row: (rank - 1) / (total partition rows - 1)
var POW = jet.POW
POW calculates power of base with exponent
var POWER = jet.POWER
POWER calculates power of base with exponent
var RANK = jet.RANK
RANK of the current row with gaps; same as row_number of its first peer
var REPEAT = jet.REPEAT
REPEAT repeats string the specified number of times
var REPLACE = jet.REPLACE
REPLACE replaces all occurrences in string of substring from with substring to
var REVERSE = jet.REVERSE
REVERSE returns reversed string.
var RIGHT = jet.RIGHT
RIGHT returns last n characters in the string. When n is negative, return all but first |n| characters.
var ROUND = jet.ROUND
ROUND calculates round of a float expressions with optional precision
var ROW = jet.ROW
ROW is construct one table row from list of expressions.
var ROW_NUMBER = jet.ROW_NUMBER
ROW_NUMBER returns number of the current row within its partition, counting from 1
var RPAD = jet.RPAD
RPAD fills up the string to length length by appending the characters fill (a space by default). If the string is already longer than length then it is truncated.
var RTRIM = jet.RTRIM
RTRIM removes the longest string containing only characters from characters (a space by default) from the end of string
var Raw = jet.Raw
Raw can be used for any unsupported functions, operators or expressions. For example: Raw("current_database()")
var SIGN = jet.SIGN
SIGN returns sign of float expression
var SQRT = jet.SQRT
SQRT calculates square root of numeric expression
var STRPOS = jet.STRPOS
STRPOS returns location of specified substring (same as position(substring in string), but note the reversed argument order)
var SUBSTR = jet.SUBSTR
SUBSTR extracts substring
var SUM = jet.SUM
SUM is aggregate function. Returns sum of all expressions
var SUMf = jet.SUMf
SUMf is aggregate function. Returns sum of expression across all float expressions
var SUMi = jet.SUMi
SUMi is aggregate function. Returns sum of expression across all integer expression.
var SetLogger = jet.SetLoggerFunc
SetLogger sets automatic statement logging
var String = jet.String
String creates new string literal expression
var StringColumn = jet.StringColumn
StringColumn creates named string column.
var StringExp = jet.StringExp
StringExp is string expression wrapper around arbitrary expression. Allows go compiler to see any expression as string expression. Does not add sql cast to generated sql builder output.
var TO_ASCII = jet.TO_ASCII
TO_ASCII convert string to ASCII from another encoding
var TO_CHAR = jet.TO_CHAR
TO_CHAR converts expression to string with format
var TO_DATE = jet.TO_DATE
TO_DATE converts string to date using format
var TO_HEX = jet.TO_HEX
TO_HEX converts number to its equivalent hexadecimal representation
var TO_NUMBER = jet.TO_NUMBER
TO_NUMBER converts string to numeric using format
var TO_TIMESTAMP = jet.TO_TIMESTAMP
TO_TIMESTAMP converts string to time stamp with time zone using format
var TRUNC = jet.TRUNC
TRUNC calculates trunc of float expression with optional precision
var Time = func(hour, minute, second int, nanoseconds ...time.Duration) TimeExpression { return CAST(jet.Time(hour, minute, second, nanoseconds...)).AS_TIME() }
Time creates new time literal expression
var TimeColumn = jet.TimeColumn
TimeColumn creates named time column
var TimeExp = jet.TimeExp
TimeExp is time expression wrapper around arbitrary expression. Allows go compiler to see any expression as time expression. Does not add sql cast to generated sql builder output.
var TimeT = func(t time.Time) TimeExpression { return CAST(jet.TimeT(t)).AS_TIME() }
TimeT creates new time literal expression from time.Time object
var Timestamp = func(year int, month time.Month, day, hour, minute, second int, milliseconds ...time.Duration) TimestampExpression { return CAST(jet.Timestamp(year, month, day, hour, minute, second, milliseconds...)).AS_TIMESTAMP() }
Timestamp creates new timestamp literal expression
var TimestampColumn = jet.TimestampColumn
TimestampColumn creates named timestamp column
var TimestampExp = jet.TimestampExp
TimestampExp is timestamp expression wrapper around arbitrary expression. Allows go compiler to see any expression as timestamp expression. Does not add sql cast to generated sql builder output.
var TimestampT = func(t time.Time) TimestampExpression { return CAST(jet.TimestampT(t)).AS_TIMESTAMP() }
TimestampT creates new timestamp literal expression from time.Time object
var Timestampz = func(year int, month time.Month, day, hour, minute, second int, milliseconds time.Duration, timezone string) TimestampzExpression { return CAST(jet.Timestampz(year, month, day, hour, minute, second, milliseconds, timezone)).AS_TIMESTAMPZ() }
Timestampz creates new timestamp with time zone literal expression
var TimestampzColumn = jet.TimestampzColumn
TimestampzColumn creates named timestamp with time zone column.
var TimestampzExp = jet.TimestampzExp
TimestampzExp is timestamp with time zone expression wrapper around arbitrary expression. Allows go compiler to see any expression as timestamp with time zone expression. Does not add sql cast to generated sql builder output.
var TimestampzT = func(t time.Time) TimestampzExpression { return CAST(jet.TimestampzT(t)).AS_TIMESTAMPZ() }
TimestampzT creates new timestamp literal expression from time.Time object
var Timez = func(hour, minute, second int, milliseconds time.Duration, timezone string) TimezExpression { return CAST(jet.Timez(hour, minute, second, milliseconds, timezone)).AS_TIMEZ() }
Timez creates new time with time zone literal expression
var TimezColumn = jet.TimezColumn
TimezColumn creates named time with time zone column.
var TimezExp = jet.TimezExp
TimezExp is time with time zone expression wrapper around arbitrary expression. Allows go compiler to see any expression as time with time zone expression. Does not add sql cast to generated sql builder output.
var TimezT = func(t time.Time) TimezExpression { return CAST(jet.TimezT(t)).AS_TIMEZ() }
TimezT creates new time with time zone literal expression from time.Time object
var UPPER = jet.UPPER
UPPER returns string expression in upper case
var Window = jet.WindowName
Window definition reference
Functions ¶
func CAST ¶
func CAST(expr Expression) cast
CAST function converts a expr (of any type) into latter specified datatype.
func EXCEPT ¶
func EXCEPT(lhs, rhs jet.SerializerStatement) setStatement
EXCEPT returns all rows that are in the result of query lhs but not in the result of query rhs. It eliminates duplicate rows from its result.
func EXCEPT_ALL ¶
func EXCEPT_ALL(lhs, rhs jet.SerializerStatement) setStatement
EXCEPT_ALL returns all rows that are in the result of query lhs but not in the result of query rhs. It does not eliminates duplicate rows from its result.
func INTERSECT ¶
func INTERSECT(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
INTERSECT returns all rows that are in query results. It eliminates duplicate rows from its result.
func INTERSECT_ALL ¶
func INTERSECT_ALL(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
INTERSECT_ALL returns all rows that are in query results. It does not eliminates duplicate rows from its result.
func SET ¶
func SET(assigments ...ColumnAssigment) conflictAction
SET creates conflict action for ON_CONFLICT clause
func UNION ¶
func UNION(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
UNION effectively appends the result of sub-queries(select statements) into single query. It eliminates duplicate rows from its result.
func UNION_ALL ¶
func UNION_ALL(lhs, rhs jet.SerializerStatement, selects ...jet.SerializerStatement) setStatement
UNION_ALL effectively appends the result of sub-queries(select statements) into single query. It does not eliminates duplicate rows from its result.
Types ¶
type Column ¶
type Column = jet.ColumnExpression
Column is common column interface for all types of columns.
type ColumnAssigment ¶
type ColumnAssigment = jet.ColumnAssigment
ColumnAssigment is interface wrapper around column assigment
type ColumnFloat ¶
type ColumnFloat = jet.ColumnFloat
ColumnFloat is interface for SQL real, numeric, decimal or double precision column.
type ColumnInteger ¶
type ColumnInteger = jet.ColumnInteger
ColumnInteger is interface for SQL smallint, integer, bigint columns.
type ColumnInterval ¶
type ColumnInterval interface { IntervalExpression jet.Column From(subQuery SelectTable) ColumnInterval }
ColumnInterval is interface of PostgreSQL interval columns.
func IntervalColumn ¶
func IntervalColumn(name string) ColumnInterval
IntervalColumn creates named interval column.
type ColumnList ¶
type ColumnList = jet.ColumnList
ColumnList function returns list of columns that be used as projection or column list for UPDATE and INSERT statement.
type ColumnString ¶
type ColumnString = jet.ColumnString
ColumnString is interface for SQL text, character, character varying bytea, uuid columns and enums types.
type ColumnTimestamp ¶
type ColumnTimestamp = jet.ColumnTimestamp
ColumnTimestamp is interface of SQL timestamp columns.
type ColumnTimestampz ¶
type ColumnTimestampz = jet.ColumnTimestampz
ColumnTimestampz is interface of SQL timestamp with timezone columns.
type ColumnTimez ¶
type ColumnTimez = jet.ColumnTimez
ColumnTimez is interface of SQL time with time zone columns.
type CommonTableExpression ¶
type CommonTableExpression struct { jet.CommonTableExpression // contains filtered or unexported fields }
CommonTableExpression contains information about a CTE.
func (CommonTableExpression) CROSS_JOIN ¶
func (r CommonTableExpression) CROSS_JOIN(table ReadableTable) ReadableTable
func (CommonTableExpression) FULL_JOIN ¶
func (r CommonTableExpression) FULL_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
func (CommonTableExpression) INNER_JOIN ¶
func (r CommonTableExpression) INNER_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
Creates a inner join tableName Expression using onCondition.
func (CommonTableExpression) LEFT_JOIN ¶
func (r CommonTableExpression) LEFT_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
Creates a left join tableName Expression using onCondition.
func (CommonTableExpression) RIGHT_JOIN ¶
func (r CommonTableExpression) RIGHT_JOIN(table ReadableTable, onCondition BoolExpression) ReadableTable
Creates a right join tableName Expression using onCondition.
func (CommonTableExpression) SELECT ¶
func (r CommonTableExpression) SELECT(projection1 Projection, projections ...Projection) SelectStatement
Generates a select query on the current tableName.
type DateExpression ¶
type DateExpression = jet.DateExpression
DateExpression is interface for date types
type DeleteStatement ¶
type DeleteStatement interface { jet.SerializerStatement WHERE(expression BoolExpression) DeleteStatement RETURNING(projections ...jet.Projection) DeleteStatement }
DeleteStatement is interface for PostgreSQL DELETE statement
type Expression ¶
type Expression = jet.Expression
Expression is common interface for all expressions. Can be Bool, Int, Float, String, Date, Time, Timez, Timestamp or Timestampz expressions.
type InsertStatement ¶
type InsertStatement interface { jet.SerializerStatement // Insert row of values VALUES(value interface{}, values ...interface{}) InsertStatement // Insert row of values, where value for each column is extracted from filed of structure data. // If data is not struct or there is no field for every column selected, this method will panic. MODEL(data interface{}) InsertStatement MODELS(data interface{}) InsertStatement QUERY(selectStatement SelectStatement) InsertStatement ON_CONFLICT(indexExpressions ...jet.ColumnExpression) onConflict RETURNING(projections ...Projection) InsertStatement }
InsertStatement is interface for SQL INSERT statements
type IntervalExpression ¶
type IntervalExpression interface { jet.IsInterval jet.Expression EQ(rhs IntervalExpression) BoolExpression NOT_EQ(rhs IntervalExpression) BoolExpression IS_DISTINCT_FROM(rhs IntervalExpression) BoolExpression IS_NOT_DISTINCT_FROM(rhs IntervalExpression) BoolExpression LT(rhs IntervalExpression) BoolExpression LT_EQ(rhs IntervalExpression) BoolExpression GT(rhs IntervalExpression) BoolExpression GT_EQ(rhs IntervalExpression) BoolExpression ADD(rhs IntervalExpression) IntervalExpression SUB(rhs IntervalExpression) IntervalExpression MUL(rhs NumericExpression) IntervalExpression DIV(rhs NumericExpression) IntervalExpression }
IntervalExpression is representation of postgres INTERVAL
func INTERVAL ¶
func INTERVAL(quantityAndUnit ...quantityAndUnit) IntervalExpression
INTERVAL creates new interval expression from the list of quantity-unit pairs. For example: INTERVAL(1, DAY, 3, MINUTE)
func INTERVALd ¶
func INTERVALd(duration time.Duration) IntervalExpression
INTERVALd creates interval expression from time.Duration
func IntervalExp ¶
func IntervalExp(expression Expression) IntervalExpression
IntervalExp is interval expression wrapper around arbitrary expression. Allows go compiler to see any expression as interval expression. Does not add sql cast to generated sql builder output.
type LockStatement ¶
type LockStatement interface { Statement IN(lockMode TableLockMode) LockStatement NOWAIT() LockStatement }
LockStatement is interface for MySQL LOCK tables
func LOCK ¶
func LOCK(tables ...jet.SerializerTable) LockStatement
LOCK creates LockStatement from list of tables
type PrintableStatement ¶
type PrintableStatement = jet.PrintableStatement
PrintableStatement is a statement which sql query can be logged
type Projection ¶
type Projection = jet.Projection
Projection is interface for all projection types. Types that can be part of, for instance SELECT clause.
type ProjectionList ¶
type ProjectionList = jet.ProjectionList
ProjectionList can be used to create conditional constructed projection list.
type ReadableTable ¶
type ReadableTable interface { jet.Serializer // contains filtered or unexported methods }
ReadableTable interface
type SelectStatement ¶
type SelectStatement interface { Statement jet.HasProjections Expression DISTINCT() SelectStatement FROM(table ReadableTable) SelectStatement WHERE(expression BoolExpression) SelectStatement GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement HAVING(boolExpression BoolExpression) SelectStatement WINDOW(name string) windowExpand ORDER_BY(orderByClauses ...jet.OrderByClause) SelectStatement LIMIT(limit int64) SelectStatement OFFSET(offset int64) SelectStatement FOR(lock RowLock) SelectStatement UNION(rhs SelectStatement) setStatement UNION_ALL(rhs SelectStatement) setStatement INTERSECT(rhs SelectStatement) setStatement INTERSECT_ALL(rhs SelectStatement) setStatement EXCEPT(rhs SelectStatement) setStatement EXCEPT_ALL(rhs SelectStatement) setStatement AsTable(alias string) SelectTable }
SelectStatement is interface for PostgreSQL SELECT statement
func SELECT ¶
func SELECT(projection Projection, projections ...Projection) SelectStatement
SELECT creates new SelectStatement with list of projections
type SelectTable ¶
type SelectTable interface { jet.SelectTable // contains filtered or unexported methods }
SelectTable is interface for MySQL sub-queries
type Statement ¶
Statement is common interface for all statements(SELECT, INSERT, UPDATE, DELETE, LOCK)
type StringExpression ¶
type StringExpression = jet.StringExpression
StringExpression interface
func CONCAT_WS ¶
func CONCAT_WS(separator Expression, expressions ...Expression) StringExpression
CONCAT_WS adds two or more expressions together with a separator.
func FORMAT ¶
func FORMAT(formatStr StringExpression, formatArgs ...Expression) StringExpression
FORMAT formats a number to a format like "#,###,###.##", rounded to a specified number of decimal places, then it returns the result as a string.
type Table ¶
type Table interface { jet.SerializerTable // contains filtered or unexported methods }
Table is interface for MySQL tables
type TableLockMode ¶
type TableLockMode string
TableLockMode is a type of possible SQL table lock
const ( LOCK_ACCESS_SHARE TableLockMode = "ACCESS SHARE" LOCK_ROW_SHARE TableLockMode = "ROW SHARE" LOCK_ROW_EXCLUSIVE TableLockMode = "ROW EXCLUSIVE" LOCK_SHARE_UPDATE_EXCLUSIVE TableLockMode = "SHARE UPDATE EXCLUSIVE" LOCK_SHARE TableLockMode = "SHARE" LOCK_SHARE_ROW_EXCLUSIVE TableLockMode = "SHARE ROW EXCLUSIVE" LOCK_EXCLUSIVE TableLockMode = "EXCLUSIVE" LOCK_ACCESS_EXCLUSIVE TableLockMode = "ACCESS EXCLUSIVE" )
Lock types for LockStatement.
type TimestampExpression ¶
type TimestampExpression = jet.TimestampExpression
TimestampExpression interface
type TimestampzExpression ¶
type TimestampzExpression = jet.TimestampzExpression
TimestampzExpression interface
type TimezExpression ¶
type TimezExpression = jet.TimezExpression
TimezExpression interface for 'time with time zone' types
type UpdateStatement ¶
type UpdateStatement interface { jet.SerializerStatement SET(value interface{}, values ...interface{}) UpdateStatement MODEL(data interface{}) UpdateStatement WHERE(expression BoolExpression) UpdateStatement RETURNING(projections ...jet.Projection) UpdateStatement }
UpdateStatement is interface of SQL UPDATE statement
type WritableTable ¶
type WritableTable interface { jet.Table jet.Serializer // contains filtered or unexported methods }
WritableTable interface
Source Files ¶
- cast.go
- clause.go
- columns.go
- conflict_action.go
- delete_statement.go
- dialect.go
- expressions.go
- functions.go
- insert_statement.go
- interval_expression.go
- keywords.go
- literal.go
- lock_statement.go
- operators.go
- select_statement.go
- select_table.go
- set_statement.go
- table.go
- types.go
- update_statement.go
- with_statement.go