2021-10-21 13:39:24 +02:00
|
|
|
package sqlite
|
|
|
|
|
|
2026-05-09 01:43:14 +00:00
|
|
|
import "github.com/Gleipnir-Technology/jet/internal/jet"
|
2021-10-21 13:39:24 +02:00
|
|
|
|
|
|
|
|
// Expression is common interface for all expressions.
|
|
|
|
|
// Can be Bool, Int, Float, String, Date, Time or Timestamp expressions.
|
|
|
|
|
type Expression = jet.Expression
|
|
|
|
|
|
|
|
|
|
// BoolExpression interface
|
|
|
|
|
type BoolExpression = jet.BoolExpression
|
|
|
|
|
|
|
|
|
|
// StringExpression interface
|
|
|
|
|
type StringExpression = jet.StringExpression
|
|
|
|
|
|
2025-02-28 18:23:15 +01:00
|
|
|
// BlobExpression interface
|
|
|
|
|
type BlobExpression = jet.BlobExpression
|
|
|
|
|
|
2021-10-21 13:39:24 +02:00
|
|
|
// NumericExpression is shared interface for integer or real expression
|
|
|
|
|
type NumericExpression = jet.NumericExpression
|
|
|
|
|
|
|
|
|
|
// IntegerExpression interface
|
|
|
|
|
type IntegerExpression = jet.IntegerExpression
|
|
|
|
|
|
|
|
|
|
// FloatExpression interface
|
|
|
|
|
type FloatExpression = jet.FloatExpression
|
|
|
|
|
|
|
|
|
|
// TimeExpression interface
|
|
|
|
|
type TimeExpression = jet.TimeExpression
|
|
|
|
|
|
|
|
|
|
// DateExpression interface
|
|
|
|
|
type DateExpression = jet.DateExpression
|
|
|
|
|
|
|
|
|
|
// DateTimeExpression interface
|
|
|
|
|
type DateTimeExpression = jet.TimestampExpression
|
|
|
|
|
|
|
|
|
|
// TimestampExpression interface
|
|
|
|
|
type TimestampExpression = jet.TimestampExpression
|
|
|
|
|
|
2024-10-06 14:21:42 +02:00
|
|
|
// RowExpression interface
|
|
|
|
|
type RowExpression = jet.RowExpression
|
|
|
|
|
|
2021-10-21 13:39:24 +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.
|
|
|
|
|
var BoolExp = jet.BoolExp
|
|
|
|
|
|
|
|
|
|
// 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 StringExp = jet.StringExp
|
|
|
|
|
|
2025-02-28 18:23:15 +01:00
|
|
|
// BlobExp is blob expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as blob expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
|
|
|
|
var BlobExp = jet.BlobExp
|
|
|
|
|
|
2021-10-21 13:39:24 +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.
|
|
|
|
|
var IntExp = jet.IntExp
|
|
|
|
|
|
|
|
|
|
// 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 FloatExp = jet.FloatExp
|
|
|
|
|
|
|
|
|
|
// 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 TimeExp = jet.TimeExp
|
|
|
|
|
|
|
|
|
|
// 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 DateExp = jet.DateExp
|
|
|
|
|
|
|
|
|
|
// DateTimeExp 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 DateTimeExp = 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 TimestampExp = jet.TimestampExp
|
|
|
|
|
|
2024-10-06 14:21:42 +02:00
|
|
|
// RowExp serves as a wrapper for an arbitrary expression, treating it as a row expression.
|
|
|
|
|
// This enables the Go compiler to interpret any expression as a row expression
|
|
|
|
|
// Note: This does not modify the generated SQL builder output by adding a SQL CAST operation.
|
|
|
|
|
var RowExp = jet.RowExp
|
|
|
|
|
|
2024-07-13 17:10:26 +02:00
|
|
|
// CustomExpression is used to define custom expressions.
|
|
|
|
|
var CustomExpression = jet.CustomExpression
|
|
|
|
|
|
|
|
|
|
// Token is used to define custom token in a custom expression.
|
|
|
|
|
type Token = jet.Token
|
|
|
|
|
|
2021-10-21 13:39:24 +02:00
|
|
|
// RawArgs is type used to pass optional arguments to Raw method
|
|
|
|
|
type RawArgs = map[string]interface{}
|
|
|
|
|
|
|
|
|
|
// Raw can be used for any unsupported functions, operators or expressions.
|
|
|
|
|
// For example: Raw("current_database()")
|
|
|
|
|
// Raw helper methods for each of the sqlite types
|
|
|
|
|
var (
|
|
|
|
|
Raw = jet.Raw
|
|
|
|
|
|
2023-04-17 12:46:11 +02:00
|
|
|
RawBool = jet.RawBool
|
2021-10-21 13:39:24 +02:00
|
|
|
RawInt = jet.RawInt
|
|
|
|
|
RawFloat = jet.RawFloat
|
|
|
|
|
RawString = jet.RawString
|
|
|
|
|
RawTime = jet.RawTime
|
|
|
|
|
RawTimestamp = jet.RawTimestamp
|
|
|
|
|
RawDate = jet.RawDate
|
|
|
|
|
)
|
|
|
|
|
|
2022-01-10 16:57:57 +01:00
|
|
|
// Func can be used to call custom or unsupported database functions.
|
2021-10-21 13:39:24 +02:00
|
|
|
var Func = jet.Func
|
|
|
|
|
|
|
|
|
|
// NewEnumValue creates new named enum value
|
|
|
|
|
var NewEnumValue = jet.NewEnumValue
|
2024-03-26 15:49:17 +01:00
|
|
|
|
|
|
|
|
// BinaryOperator can be used to use custom or unsupported operators that take two operands.
|
|
|
|
|
var BinaryOperator = jet.BinaryOperator
|