2019-08-03 14:10:47 +02:00
|
|
|
package postgres
|
|
|
|
|
|
2020-06-27 18:48:19 +02:00
|
|
|
import "github.com/go-jet/jet/v2/internal/jet"
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// Expression is common interface for all expressions.
|
|
|
|
|
// Can be Bool, Int, Float, String, Date, Time, Timez, Timestamp or Timestampz expressions.
|
2019-09-26 11:44:46 +02:00
|
|
|
type Expression = jet.Expression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// BoolExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type BoolExpression = jet.BoolExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// StringExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type StringExpression = jet.StringExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2020-02-09 18:37:48 +01:00
|
|
|
// NumericExpression interface
|
|
|
|
|
type NumericExpression = jet.NumericExpression
|
|
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// IntegerExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type IntegerExpression = jet.IntegerExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2022-08-23 12:38:16 +02:00
|
|
|
// FloatExpression is interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type FloatExpression = jet.FloatExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// TimeExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type TimeExpression = jet.TimeExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// TimezExpression interface for 'time with time zone' types
|
2019-09-26 11:44:46 +02:00
|
|
|
type TimezExpression = jet.TimezExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// DateExpression is interface for date types
|
2019-09-26 11:44:46 +02:00
|
|
|
type DateExpression = jet.DateExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// TimestampExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type TimestampExpression = jet.TimestampExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// TimestampzExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type TimestampzExpression = jet.TimestampzExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var BoolExp = jet.BoolExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var IntExp = jet.IntExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var FloatExp = jet.FloatExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var TimeExp = jet.TimeExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-13 10:16:26 +02:00
|
|
|
var StringExp = jet.StringExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var TimezExp = jet.TimezExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var DateExp = jet.DateExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var TimestampExp = jet.TimestampExp
|
2019-08-17 14:49:35 +02:00
|
|
|
|
|
|
|
|
// 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.
|
2019-08-06 10:29:04 +02:00
|
|
|
var TimestampzExp = jet.TimestampzExp
|
|
|
|
|
|
2021-05-14 12:15:35 +02:00
|
|
|
// RawArgs is type used to pass optional arguments to Raw method
|
|
|
|
|
type RawArgs = map[string]interface{}
|
|
|
|
|
|
2021-05-16 19:10:43 +02:00
|
|
|
// Raw can be used for any unsupported functions, operators or expressions.
|
|
|
|
|
// For example: Raw("current_database()")
|
|
|
|
|
// Raw helper methods for each of the postgres types
|
2021-05-14 12:15:35 +02:00
|
|
|
var (
|
|
|
|
|
Raw = jet.Raw
|
|
|
|
|
|
|
|
|
|
RawInt = jet.RawInt
|
|
|
|
|
RawFloat = jet.RawFloat
|
|
|
|
|
RawString = jet.RawString
|
|
|
|
|
RawTime = jet.RawTime
|
|
|
|
|
RawTimez = jet.RawTimez
|
|
|
|
|
RawTimestamp = jet.RawTimestamp
|
|
|
|
|
RawTimestampz = jet.RawTimestampz
|
|
|
|
|
RawDate = jet.RawDate
|
|
|
|
|
)
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2022-01-10 16:57:57 +01:00
|
|
|
// Func can be used to call custom or unsupported database functions.
|
2020-09-29 15:29:35 -07:00
|
|
|
var Func = jet.Func
|
|
|
|
|
|
2019-08-17 14:49:35 +02:00
|
|
|
// NewEnumValue creates new named enum value
|
2019-08-06 10:29:04 +02:00
|
|
|
var NewEnumValue = jet.NewEnumValue
|