Documentation
¶
Index ¶
- Constants
- Variables
- func AsString(n NodeFormatter) string
- func AsStringWithFlags(n NodeFormatter, f FmtFlags) string
- func ContainsVars(expr Expr) bool
- func ExprDebugString(expr Expr) string
- func FindEqualComparisonFunction(leftType, rightType Type) (func(*EvalContext, Datum, Datum) (Datum, error), bool)
- func FormatNode(buf *bytes.Buffer, f FmtFlags, n NodeFormatter)
- func HasReturningClause(clause ReturningClause) bool
- func IsIdentAggregate(f AggregateFunc) bool
- func IsNumericOne(expr TypedExpr) bool
- func IsNumericZero(expr TypedExpr) bool
- func PGDisplayName(typ Type) string
- func PGIOBuiltinPrefix(typ Type) string
- func ReNormalizeName(name string) string
- func Serialize(n NodeFormatter) string
- func SimilarEscape(pattern string) string
- func StmtDebugString(stmt Statement) string
- func ValidateRestartCheckpoint(savepoint string) error
- func WalkExprConst(v Visitor, expr Expr)
- type AggregateFunc
- type AliasClause
- type AliasedTableExpr
- type AllColumnsSelector
- func (expr *AllColumnsSelector) Eval(ctx *EvalContext) (Datum, error)
- func (a *AllColumnsSelector) Format(buf *bytes.Buffer, f FmtFlags)
- func (a *AllColumnsSelector) NormalizeVarName() (VarName, error)
- func (*AllColumnsSelector) ResolvedType() Type
- func (a *AllColumnsSelector) String() string
- func (expr *AllColumnsSelector) TypeCheck(_ *SemaContext, desired Type) (TypedExpr, error)
- func (a *AllColumnsSelector) Variable()
- func (expr *AllColumnsSelector) Walk(_ Visitor) Expr
- type AllTablesSelector
- type AlterTable
- type AlterTableAddColumn
- type AlterTableAddConstraint
- type AlterTableCmd
- type AlterTableCmds
- type AlterTableDropColumn
- type AlterTableDropConstraint
- type AlterTableDropNotNull
- type AlterTableSetDefault
- type AlterTableValidateConstraint
- type AndExpr
- func (expr *AndExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *AndExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta AndExpr) ResolvedType() Type
- func (node *AndExpr) String() string
- func (expr *AndExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *AndExpr) TypedLeft() TypedExpr
- func (node *AndExpr) TypedRight() TypedExpr
- func (expr *AndExpr) Walk(v Visitor) Expr
- type AnnotateTypeExpr
- func (node *AnnotateTypeExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (node *AnnotateTypeExpr) String() string
- func (expr *AnnotateTypeExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *AnnotateTypeExpr) TypedInnerExpr() TypedExpr
- func (expr *AnnotateTypeExpr) Walk(v Visitor) Expr
- type ArgTypes
- type Array
- func (t *Array) Eval(ctx *EvalContext) (Datum, error)
- func (node *Array) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta Array) ResolvedType() Type
- func (node *Array) String() string
- func (expr *Array) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *Array) Walk(v Visitor) Expr
- type ArrayColType
- type ArrayFlatten
- func (t *ArrayFlatten) Eval(ctx *EvalContext) (Datum, error)
- func (node *ArrayFlatten) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta ArrayFlatten) ResolvedType() Type
- func (node *ArrayFlatten) String() string
- func (expr *ArrayFlatten) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *ArrayFlatten) Walk(v Visitor) Expr
- type ArraySubscript
- type ArraySubscripts
- type AsOfClause
- type Backup
- type BeginTransaction
- type BinOp
- type BinaryExpr
- func (expr *BinaryExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *BinaryExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta BinaryExpr) ResolvedType() Type
- func (node *BinaryExpr) String() string
- func (expr *BinaryExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *BinaryExpr) TypedLeft() TypedExpr
- func (node *BinaryExpr) TypedRight() TypedExpr
- func (expr *BinaryExpr) Walk(v Visitor) Expr
- type BinaryOperator
- type BoolColType
- type Builtin
- type BytesColType
- type CaseExpr
- func (expr *CaseExpr) CopyNode() *CaseExpr
- func (expr *CaseExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *CaseExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta CaseExpr) ResolvedType() Type
- func (node *CaseExpr) String() string
- func (expr *CaseExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *CaseExpr) Walk(v Visitor) Expr
- type CastExpr
- func (expr *CastExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *CastExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta CastExpr) ResolvedType() Type
- func (node *CastExpr) String() string
- func (expr *CastExpr) TypeCheck(ctx *SemaContext, _ Type) (TypedExpr, error)
- func (expr *CastExpr) Walk(v Visitor) Expr
- type CastTargetType
- type CheckConstraintTableDef
- type CmpOp
- type CoalesceExpr
- func (expr *CoalesceExpr) CopyNode() *CoalesceExpr
- func (expr *CoalesceExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *CoalesceExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta CoalesceExpr) ResolvedType() Type
- func (node *CoalesceExpr) String() string
- func (expr *CoalesceExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *CoalesceExpr) TypedExprAt(idx int) TypedExpr
- func (expr *CoalesceExpr) Walk(v Visitor) Expr
- type CollateExpr
- func (expr *CollateExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *CollateExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta CollateExpr) ResolvedType() Type
- func (node *CollateExpr) String() string
- func (expr *CollateExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *CollateExpr) Walk(v Visitor) Expr
- type CollatedStringColType
- type CollationEnvironment
- type ColumnCheckConstraint
- type ColumnCollation
- type ColumnDefault
- type ColumnFKConstraint
- type ColumnFamilyConstraint
- type ColumnID
- type ColumnItem
- func (c *ColumnItem) Column() string
- func (expr *ColumnItem) Eval(ctx *EvalContext) (Datum, error)
- func (c *ColumnItem) Format(buf *bytes.Buffer, f FmtFlags)
- func (c *ColumnItem) NormalizeVarName() (VarName, error)
- func (c *ColumnItem) ResolvedType() Type
- func (c *ColumnItem) String() string
- func (expr *ColumnItem) TypeCheck(_ *SemaContext, desired Type) (TypedExpr, error)
- func (c *ColumnItem) Variable()
- func (expr *ColumnItem) Walk(_ Visitor) Expr
- type ColumnMutationCmd
- type ColumnQualification
- type ColumnTableDef
- type ColumnTableDefCheckExpr
- type ColumnType
- type CommitTransaction
- type ComparisonExpr
- func (expr *ComparisonExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *ComparisonExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (node *ComparisonExpr) IsMixedTypeComparison() bool
- func (ta ComparisonExpr) ResolvedType() Type
- func (node *ComparisonExpr) String() string
- func (expr *ComparisonExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *ComparisonExpr) TypedLeft() TypedExpr
- func (node *ComparisonExpr) TypedRight() TypedExpr
- func (expr *ComparisonExpr) Walk(v Visitor) Expr
- type ComparisonOperator
- type CompositeDatum
- type Constant
- type ConstraintTableDef
- type ContainsWindowVisitor
- type CopyFrom
- type CreateDatabase
- type CreateIndex
- type CreateTable
- type CreateUser
- type CreateView
- type DArray
- func (*DArray) AmbiguousFormat() bool
- func (d *DArray) Append(v Datum) error
- func (d *DArray) Compare(ctx *EvalContext, other Datum) int
- func (t *DArray) Eval(_ *EvalContext) (Datum, error)
- func (d *DArray) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DArray) IsMax() bool
- func (d *DArray) IsMin() bool
- func (d *DArray) Len() int
- func (d *DArray) Next() (Datum, bool)
- func (d *DArray) Prev() (Datum, bool)
- func (d *DArray) ResolvedType() Type
- func (d *DArray) Size() uintptr
- func (node *DArray) String() string
- func (d *DArray) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DArray) Walk(_ Visitor) Expr
- type DBool
- func (*DBool) AmbiguousFormat() bool
- func (d *DBool) Compare(ctx *EvalContext, other Datum) int
- func (t *DBool) Eval(_ *EvalContext) (Datum, error)
- func (d *DBool) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DBool) IsMax() bool
- func (d *DBool) IsMin() bool
- func (*DBool) Next() (Datum, bool)
- func (*DBool) Prev() (Datum, bool)
- func (*DBool) ResolvedType() Type
- func (d *DBool) Size() uintptr
- func (node *DBool) String() string
- func (d *DBool) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DBool) Walk(_ Visitor) Expr
- type DBytes
- func (*DBytes) AmbiguousFormat() bool
- func (d *DBytes) Compare(ctx *EvalContext, other Datum) int
- func (t *DBytes) Eval(_ *EvalContext) (Datum, error)
- func (d *DBytes) Format(buf *bytes.Buffer, f FmtFlags)
- func (*DBytes) IsMax() bool
- func (d *DBytes) IsMin() bool
- func (d *DBytes) Next() (Datum, bool)
- func (d *DBytes) Prev() (Datum, bool)
- func (*DBytes) ResolvedType() Type
- func (d *DBytes) Size() uintptr
- func (node *DBytes) String() string
- func (d *DBytes) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DBytes) Walk(_ Visitor) Expr
- type DCollatedString
- func (*DCollatedString) AmbiguousFormat() bool
- func (d *DCollatedString) Compare(ctx *EvalContext, other Datum) int
- func (t *DCollatedString) Eval(_ *EvalContext) (Datum, error)
- func (d *DCollatedString) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DCollatedString) IsComposite() bool
- func (*DCollatedString) IsMax() bool
- func (d *DCollatedString) IsMin() bool
- func (d *DCollatedString) Next() (Datum, bool)
- func (d *DCollatedString) Prev() (Datum, bool)
- func (d *DCollatedString) ResolvedType() Type
- func (d *DCollatedString) Size() uintptr
- func (node *DCollatedString) String() string
- func (d *DCollatedString) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DCollatedString) Walk(_ Visitor) Expr
- type DDate
- func (*DDate) AmbiguousFormat() bool
- func (d *DDate) Compare(ctx *EvalContext, other Datum) int
- func (t *DDate) Eval(_ *EvalContext) (Datum, error)
- func (d *DDate) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DDate) IsMax() bool
- func (d *DDate) IsMin() bool
- func (d *DDate) Next() (Datum, bool)
- func (d *DDate) Prev() (Datum, bool)
- func (*DDate) ResolvedType() Type
- func (d *DDate) Size() uintptr
- func (node *DDate) String() string
- func (d *DDate) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DDate) Walk(_ Visitor) Expr
- type DDecimal
- func (*DDecimal) AmbiguousFormat() bool
- func (d *DDecimal) Compare(ctx *EvalContext, other Datum) int
- func (t *DDecimal) Eval(_ *EvalContext) (Datum, error)
- func (d *DDecimal) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DDecimal) IsComposite() bool
- func (*DDecimal) IsMax() bool
- func (*DDecimal) IsMin() bool
- func (d *DDecimal) Next() (Datum, bool)
- func (d *DDecimal) Prev() (Datum, bool)
- func (*DDecimal) ResolvedType() Type
- func (d *DDecimal) SetString(s string) error
- func (d *DDecimal) Size() uintptr
- func (node *DDecimal) String() string
- func (d *DDecimal) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DDecimal) Walk(_ Visitor) Expr
- type DFloat
- func (*DFloat) AmbiguousFormat() bool
- func (d *DFloat) Compare(ctx *EvalContext, other Datum) int
- func (t *DFloat) Eval(_ *EvalContext) (Datum, error)
- func (d *DFloat) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DFloat) IsComposite() bool
- func (d *DFloat) IsMax() bool
- func (d *DFloat) IsMin() bool
- func (d *DFloat) Next() (Datum, bool)
- func (d *DFloat) Prev() (Datum, bool)
- func (*DFloat) ResolvedType() Type
- func (d *DFloat) Size() uintptr
- func (node *DFloat) String() string
- func (d *DFloat) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DFloat) Walk(_ Visitor) Expr
- type DInt
- func (*DInt) AmbiguousFormat() bool
- func (d *DInt) Compare(ctx *EvalContext, other Datum) int
- func (t *DInt) Eval(_ *EvalContext) (Datum, error)
- func (d *DInt) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DInt) IsMax() bool
- func (d *DInt) IsMin() bool
- func (d *DInt) Next() (Datum, bool)
- func (d *DInt) Prev() (Datum, bool)
- func (*DInt) ResolvedType() Type
- func (d *DInt) Size() uintptr
- func (node *DInt) String() string
- func (d *DInt) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DInt) Walk(_ Visitor) Expr
- type DInterval
- func (*DInterval) AmbiguousFormat() bool
- func (d *DInterval) Compare(ctx *EvalContext, other Datum) int
- func (t *DInterval) Eval(_ *EvalContext) (Datum, error)
- func (d *DInterval) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DInterval) IsMax() bool
- func (d *DInterval) IsMin() bool
- func (d *DInterval) Next() (Datum, bool)
- func (d *DInterval) Prev() (Datum, bool)
- func (*DInterval) ResolvedType() Type
- func (d *DInterval) Size() uintptr
- func (node *DInterval) String() string
- func (d *DInterval) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (d *DInterval) ValueAsString() string
- func (expr *DInterval) Walk(_ Visitor) Expr
- type DOid
- func (*DOid) AmbiguousFormat() bool
- func (d *DOid) AsRegProc(name string) *DOid
- func (d *DOid) Compare(ctx *EvalContext, other Datum) int
- func (t *DOid) Eval(_ *EvalContext) (Datum, error)
- func (d *DOid) Format(buf *bytes.Buffer, flags FmtFlags)
- func (d *DOid) IsMax() bool
- func (d *DOid) IsMin() bool
- func (d *DOid) Next() (Datum, bool)
- func (d *DOid) Prev() (Datum, bool)
- func (d *DOid) ResolvedType() Type
- func (d *DOid) Size() uintptr
- func (node *DOid) String() string
- func (d *DOid) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DOid) Walk(_ Visitor) Expr
- type DOidWrapper
- func (d *DOidWrapper) AmbiguousFormat() bool
- func (d *DOidWrapper) Compare(ctx *EvalContext, other Datum) int
- func (t *DOidWrapper) Eval(_ *EvalContext) (Datum, error)
- func (d *DOidWrapper) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DOidWrapper) IsMax() bool
- func (d *DOidWrapper) IsMin() bool
- func (d *DOidWrapper) Next() (Datum, bool)
- func (d *DOidWrapper) Prev() (Datum, bool)
- func (d *DOidWrapper) ResolvedType() Type
- func (d *DOidWrapper) Size() uintptr
- func (node *DOidWrapper) String() string
- func (d *DOidWrapper) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DOidWrapper) Walk(_ Visitor) Expr
- type DString
- func (*DString) AmbiguousFormat() bool
- func (d *DString) Compare(ctx *EvalContext, other Datum) int
- func (t *DString) Eval(_ *EvalContext) (Datum, error)
- func (d *DString) Format(buf *bytes.Buffer, f FmtFlags)
- func (*DString) IsMax() bool
- func (d *DString) IsMin() bool
- func (d *DString) Next() (Datum, bool)
- func (d *DString) Prev() (Datum, bool)
- func (*DString) ResolvedType() Type
- func (d *DString) Size() uintptr
- func (node *DString) String() string
- func (d *DString) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DString) Walk(_ Visitor) Expr
- type DTable
- func (*DTable) AmbiguousFormat() bool
- func (t *DTable) Compare(ctx *EvalContext, other Datum) int
- func (t *DTable) Eval(_ *EvalContext) (Datum, error)
- func (t *DTable) Format(buf *bytes.Buffer, _ FmtFlags)
- func (*DTable) IsMax() bool
- func (*DTable) IsMin() bool
- func (*DTable) Next() (Datum, bool)
- func (*DTable) Prev() (Datum, bool)
- func (t *DTable) ResolvedType() Type
- func (*DTable) Size() uintptr
- func (node *DTable) String() string
- func (d *DTable) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DTable) Walk(_ Visitor) Expr
- type DTimestamp
- func (*DTimestamp) AmbiguousFormat() bool
- func (d *DTimestamp) Compare(ctx *EvalContext, other Datum) int
- func (t *DTimestamp) Eval(_ *EvalContext) (Datum, error)
- func (d *DTimestamp) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DTimestamp) IsMax() bool
- func (d *DTimestamp) IsMin() bool
- func (d *DTimestamp) Next() (Datum, bool)
- func (d *DTimestamp) Prev() (Datum, bool)
- func (*DTimestamp) ResolvedType() Type
- func (d *DTimestamp) Size() uintptr
- func (node *DTimestamp) String() string
- func (d *DTimestamp) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DTimestamp) Walk(_ Visitor) Expr
- type DTimestampTZ
- func (*DTimestampTZ) AmbiguousFormat() bool
- func (d *DTimestampTZ) Compare(ctx *EvalContext, other Datum) int
- func (t *DTimestampTZ) Eval(_ *EvalContext) (Datum, error)
- func (d *DTimestampTZ) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DTimestampTZ) IsMax() bool
- func (d *DTimestampTZ) IsMin() bool
- func (d *DTimestampTZ) Next() (Datum, bool)
- func (d *DTimestampTZ) Prev() (Datum, bool)
- func (*DTimestampTZ) ResolvedType() Type
- func (d *DTimestampTZ) Size() uintptr
- func (node *DTimestampTZ) String() string
- func (d *DTimestampTZ) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DTimestampTZ) Walk(_ Visitor) Expr
- type DTuple
- func (*DTuple) AmbiguousFormat() bool
- func (d *DTuple) AssertSorted()
- func (d *DTuple) Compare(ctx *EvalContext, other Datum) int
- func (t *DTuple) Eval(_ *EvalContext) (Datum, error)
- func (d *DTuple) Format(buf *bytes.Buffer, f FmtFlags)
- func (d *DTuple) IsMax() bool
- func (d *DTuple) IsMin() bool
- func (d *DTuple) Next() (Datum, bool)
- func (d *DTuple) Normalize(ctx *EvalContext)
- func (d *DTuple) Prev() (Datum, bool)
- func (d *DTuple) ResolvedType() Type
- func (d *DTuple) SearchSorted(ctx *EvalContext, target Datum) (int, bool)
- func (d *DTuple) SetSorted() *DTuple
- func (d *DTuple) Size() uintptr
- func (d *DTuple) SortedDifference(ctx *EvalContext, other *DTuple) *DTuple
- func (node *DTuple) String() string
- func (d *DTuple) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (expr *DTuple) Walk(_ Visitor) Expr
- type DateColType
- type Datum
- type Datums
- type Deallocate
- type DecimalColType
- type DefaultVal
- func (expr DefaultVal) Eval(ctx *EvalContext) (Datum, error)
- func (node DefaultVal) Format(buf *bytes.Buffer, f FmtFlags)
- func (DefaultVal) ResolvedType() Type
- func (node DefaultVal) String() string
- func (expr DefaultVal) TypeCheck(_ *SemaContext, desired Type) (TypedExpr, error)
- func (expr DefaultVal) Walk(_ Visitor) Expr
- type Delete
- type Direction
- type DropBehavior
- type DropDatabase
- type DropIndex
- type DropTable
- type DropView
- type EvalContext
- func (ctx *EvalContext) GetClusterTimestamp() *DDecimal
- func (ctx *EvalContext) GetClusterTimestampRaw() hlc.Timestamp
- func (ctx *EvalContext) GetLocation() *time.Location
- func (ctx *EvalContext) GetStmtTimestamp() time.Time
- func (ctx *EvalContext) GetTxnTimestamp(precision time.Duration) *DTimestampTZ
- func (ctx *EvalContext) GetTxnTimestampNoZone(precision time.Duration) *DTimestamp
- func (ctx *EvalContext) GetTxnTimestampRaw() time.Time
- func (ctx *EvalContext) NormalizeExpr(typedExpr TypedExpr) (TypedExpr, error)
- func (ctx *EvalContext) SetClusterTimestamp(ts hlc.Timestamp)
- func (ctx *EvalContext) SetStmtTimestamp(ts time.Time)
- func (ctx *EvalContext) SetTxnTimestamp(ts time.Time)
- type EvalPlanner
- type Execute
- type ExistsExpr
- func (t *ExistsExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *ExistsExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta ExistsExpr) ResolvedType() Type
- func (node *ExistsExpr) String() string
- func (expr *ExistsExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *ExistsExpr) Walk(v Visitor) Expr
- type Explain
- type Expr
- type Exprs
- type FamilyTableDef
- type FloatColType
- type FmtFlags
- func FmtExpr(base FmtFlags, showTypes bool, symbolicVars bool, showTableAliases bool) FmtFlags
- func FmtIndexedVarFormat(base FmtFlags, ...) FmtFlags
- func FmtReformatTableNames(base FmtFlags, fn func(*NormalizableTableName, *bytes.Buffer, FmtFlags)) FmtFlags
- func FmtStarDatumFormat(base FmtFlags, fn func(buf *bytes.Buffer, f FmtFlags)) FmtFlags
- func StripTypeFormatting(f FmtFlags) FmtFlags
- type ForeignKeyConstraintTableDef
- type From
- type FuncExpr
- func (expr *FuncExpr) CopyNode() *FuncExpr
- func (expr *FuncExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *FuncExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (node *FuncExpr) GetAggregateConstructor() func(*EvalContext) AggregateFunc
- func (node *FuncExpr) GetWindowConstructor() func(*EvalContext) WindowFunc
- func (node *FuncExpr) IsDistSQLBlacklist() bool
- func (node *FuncExpr) IsImpure() bool
- func (node *FuncExpr) IsWindowFunctionApplication() bool
- func (ta FuncExpr) ResolvedType() Type
- func (node *FuncExpr) String() string
- func (expr *FuncExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *FuncExpr) Walk(v Visitor) Expr
- type FunctionClass
- type FunctionDefinition
- type FunctionReference
- type Grant
- type GroupBy
- type Help
- type HiddenFromStats
- type HomogeneousType
- type ID
- type IfExpr
- func (expr *IfExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *IfExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta IfExpr) ResolvedType() Type
- func (node *IfExpr) String() string
- func (expr *IfExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *IfExpr) TypedCondExpr() TypedExpr
- func (node *IfExpr) TypedElseExpr() TypedExpr
- func (node *IfExpr) TypedTrueExpr() TypedExpr
- func (expr *IfExpr) Walk(v Visitor) Expr
- type IndependentFromParallelizedPriors
- type IndexElem
- type IndexElemList
- type IndexHints
- type IndexID
- type IndexTableDef
- type IndexedRow
- type IndexedVar
- func (v *IndexedVar) Eval(ctx *EvalContext) (Datum, error)
- func (v *IndexedVar) Format(buf *bytes.Buffer, f FmtFlags)
- func (v *IndexedVar) ResolvedType() Type
- func (node *IndexedVar) String() string
- func (v *IndexedVar) TypeCheck(_ *SemaContext, desired Type) (TypedExpr, error)
- func (*IndexedVar) Variable()
- func (v *IndexedVar) Walk(_ Visitor) Expr
- type IndexedVarContainer
- type IndexedVarHelper
- func (h *IndexedVarHelper) AppendSlot() int
- func (h *IndexedVarHelper) BindIfUnbound(ivar *IndexedVar) (*IndexedVar, error)
- func (h *IndexedVarHelper) GetIndexedVars() []IndexedVar
- func (h *IndexedVarHelper) IndexedVar(idx int) *IndexedVar
- func (h *IndexedVarHelper) IndexedVarUsed(idx int) bool
- func (h *IndexedVarHelper) NumVars() int
- func (h *IndexedVarHelper) Rebind(expr TypedExpr, alsoReset, normalizeToNonNil bool) TypedExpr
- func (h *IndexedVarHelper) Reset()
- func (*IndexedVarHelper) VisitPost(expr Expr) Expr
- func (h *IndexedVarHelper) VisitPre(expr Expr) (recurse bool, newExpr Expr)
- type IndirectionExpr
- func (expr *IndirectionExpr) CopyNode() *IndirectionExpr
- func (expr *IndirectionExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *IndirectionExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta IndirectionExpr) ResolvedType() Type
- func (node *IndirectionExpr) String() string
- func (expr *IndirectionExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *IndirectionExpr) Walk(v Visitor) Expr
- type Insert
- func (stmt *Insert) CopyNode() *Insert
- func (node *Insert) DefaultValues() bool
- func (node *Insert) Format(buf *bytes.Buffer, f FmtFlags)
- func (*Insert) StatementTag() string
- func (n *Insert) StatementType() StatementType
- func (n *Insert) String() string
- func (stmt *Insert) WalkStmt(v Visitor) Statement
- type IntColType
- type InterleaveDef
- type IntervalColType
- type IsAggregateVisitor
- type IsOfTypeExpr
- func (expr *IsOfTypeExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *IsOfTypeExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta IsOfTypeExpr) ResolvedType() Type
- func (node *IsOfTypeExpr) String() string
- func (expr *IsOfTypeExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *IsOfTypeExpr) Walk(v Visitor) Expr
- type IsolationLevel
- type JoinCond
- type JoinTableExpr
- type KVOption
- type KVOptions
- type Limit
- type MaxAggregate
- type MinAggregate
- type MultipleResultsError
- type Name
- type NameColType
- type NameList
- type NamePart
- type NameParts
- type NamedColumnQualification
- type NaturalJoinCond
- type NoReturningClause
- type NodeFormatter
- type NormalizableTableName
- func (nt NormalizableTableName) Format(buf *bytes.Buffer, f FmtFlags)
- func (nt *NormalizableTableName) Normalize() (*TableName, error)
- func (nt *NormalizableTableName) NormalizeWithDatabaseName(database string) (*TableName, error)
- func (nt NormalizableTableName) String() string
- func (nt *NormalizableTableName) TableName() *TableName
- type NotExpr
- func (expr *NotExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *NotExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta NotExpr) ResolvedType() Type
- func (node *NotExpr) String() string
- func (expr *NotExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *NotExpr) TypedInnerExpr() TypedExpr
- func (expr *NotExpr) Walk(v Visitor) Expr
- type NotNullConstraint
- type NullConstraint
- type NullIfExpr
- func (expr *NullIfExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *NullIfExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta NullIfExpr) ResolvedType() Type
- func (node *NullIfExpr) String() string
- func (expr *NullIfExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *NullIfExpr) Walk(v Visitor) Expr
- type Nullability
- type NumVal
- func (expr *NumVal) AsInt64() (int64, error)
- func (expr *NumVal) AvailableTypes() []Type
- func (expr *NumVal) Format(buf *bytes.Buffer, f FmtFlags)
- func (expr *NumVal) ResolveAsType(ctx *SemaContext, typ Type) (Datum, error)
- func (expr *NumVal) ShouldBeInt64() bool
- func (node *NumVal) String() string
- func (expr *NumVal) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *NumVal) Walk(_ Visitor) Expr
- type OidColType
- type OnConflict
- type OnJoinCond
- type OrExpr
- func (expr *OrExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *OrExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta OrExpr) ResolvedType() Type
- func (node *OrExpr) String() string
- func (expr *OrExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *OrExpr) TypedLeft() TypedExpr
- func (node *OrExpr) TypedRight() TypedExpr
- func (expr *OrExpr) Walk(v Visitor) Expr
- type Order
- type OrderBy
- type ParenExpr
- func (expr *ParenExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *ParenExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta ParenExpr) ResolvedType() Type
- func (node *ParenExpr) String() string
- func (expr *ParenExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *ParenExpr) TypedInnerExpr() TypedExpr
- func (expr *ParenExpr) Walk(v Visitor) Expr
- type ParenSelect
- type ParenTableExpr
- type Parser
- func (p *Parser) AggregateInExpr(expr Expr, searchPath SearchPath) bool
- func (p *Parser) AssertNoAggregationOrWindowing(expr Expr, op string, searchPath SearchPath) error
- func (p *Parser) IsAggregate(n *SelectClause, searchPath SearchPath) bool
- func (p *Parser) NormalizeExpr(ctx *EvalContext, typedExpr TypedExpr) (TypedExpr, error)
- func (p *Parser) Parse(sql string) (stmts StatementList, err error)
- func (p *Parser) WindowFuncInExpr(expr Expr) bool
- func (p *Parser) WindowFuncInExprs(exprs []TypedExpr) bool
- type Placeholder
- func (node *Placeholder) Eval(_ *EvalContext) (Datum, error)
- func (node *Placeholder) Format(buf *bytes.Buffer, f FmtFlags)
- func (node *Placeholder) ResolvedType() Type
- func (node *Placeholder) String() string
- func (expr *Placeholder) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (*Placeholder) Variable()
- func (expr *Placeholder) Walk(_ Visitor) Expr
- type PlaceholderInfo
- func (p *PlaceholderInfo) AssertAllAssigned() error
- func (p *PlaceholderInfo) Assign(src *PlaceholderInfo)
- func (p *PlaceholderInfo) Clear()
- func (p *PlaceholderInfo) FillUnassigned()
- func (p *PlaceholderInfo) IsUnresolvedPlaceholder(expr Expr) bool
- func (p *PlaceholderInfo) SetType(name string, typ Type) error
- func (p *PlaceholderInfo) SetTypes(src PlaceholderTypes)
- func (p *PlaceholderInfo) SetValue(name string, val Datum)
- func (p *PlaceholderInfo) Type(name string) (Type, bool)
- func (p *PlaceholderInfo) Value(name string) (TypedExpr, bool)
- type PlaceholderTypes
- type Prepare
- type PrimaryKeyConstraint
- type QueryArguments
- type RangeCond
- func (expr *RangeCond) Eval(ctx *EvalContext) (Datum, error)
- func (node *RangeCond) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta RangeCond) ResolvedType() Type
- func (node *RangeCond) String() string
- func (expr *RangeCond) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *RangeCond) TypedFrom() TypedExpr
- func (node *RangeCond) TypedLeft() TypedExpr
- func (node *RangeCond) TypedTo() TypedExpr
- func (expr *RangeCond) Walk(v Visitor) Expr
- type RegexpCache
- type ReleaseSavepoint
- type Relocate
- type RenameColumn
- type RenameDatabase
- type RenameIndex
- type RenameTable
- type ResolvableFunctionReference
- type Restore
- type ReturningClause
- type ReturningExprs
- type ReturningNothing
- type Revoke
- type RollbackToSavepoint
- type RollbackTransaction
- type Savepoint
- type Scanner
- type Scatter
- type SearchPath
- type Select
- type SelectClause
- func (stmt *SelectClause) CopyNode() *SelectClause
- func (node *SelectClause) Format(buf *bytes.Buffer, f FmtFlags)
- func (*SelectClause) StatementTag() string
- func (*SelectClause) StatementType() StatementType
- func (n *SelectClause) String() string
- func (stmt *SelectClause) WalkStmt(v Visitor) Statement
- type SelectExpr
- type SelectExprs
- type SelectStatement
- type SemaContext
- type Set
- type SetDefaultIsolation
- type SetMode
- type SetTimeZone
- type SetTransaction
- type Show
- type ShowColumns
- type ShowConstraints
- type ShowCreateTable
- type ShowCreateView
- type ShowDatabases
- type ShowGrants
- type ShowIndex
- type ShowRanges
- type ShowTables
- type ShowTransactionStatus
- type ShowUsers
- type SimpleVisitFn
- type Split
- type StarDatum
- func (*StarDatum) Eval(ctx *EvalContext) (Datum, error)
- func (*StarDatum) Format(buf *bytes.Buffer, f FmtFlags)
- func (*StarDatum) ResolvedType() Type
- func (s *StarDatum) String() string
- func (s *StarDatum) TypeCheck(_ *SemaContext, _ Type) (TypedExpr, error)
- func (*StarDatum) Variable()
- func (s *StarDatum) Walk(v Visitor) Expr
- type Statement
- type StatementList
- type StatementType
- type StrVal
- func (expr *StrVal) AvailableTypes() []Type
- func (expr *StrVal) Format(buf *bytes.Buffer, f FmtFlags)
- func (expr *StrVal) ResolveAsType(ctx *SemaContext, typ Type) (Datum, error)
- func (node *StrVal) String() string
- func (expr *StrVal) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *StrVal) Walk(_ Visitor) Expr
- type StringColType
- type Subquery
- type TArray
- type TCollatedString
- func (t TCollatedString) Equivalent(other Type) bool
- func (TCollatedString) FamilyEqual(other Type) bool
- func (t TCollatedString) IsAmbiguous() bool
- func (TCollatedString) Oid() oid.Oid
- func (TCollatedString) SQLName() string
- func (TCollatedString) Size() (uintptr, bool)
- func (t TCollatedString) String() string
- type TPlaceholder
- type TTable
- type TTuple
- type TableDef
- type TableDefs
- type TableExpr
- type TableExprs
- type TableName
- func (t *TableName) Database() string
- func (t *TableName) Format(buf *bytes.Buffer, f FmtFlags)
- func (t *TableName) NormalizeTableName() (*TableName, error)
- func (t *TableName) NormalizeTablePattern() (TablePattern, error)
- func (t *TableName) NormalizedTableName() TableName
- func (t *TableName) QualifyWithDatabase(database string) error
- func (t *TableName) String() string
- func (t *TableName) Table() string
- type TableNameReference
- type TableNameReferences
- type TableNameWithIndex
- type TableNameWithIndexList
- type TableNames
- type TablePattern
- type TablePatterns
- type TableRef
- type TargetList
- type TimestampColType
- type TimestampTZColType
- type Truncate
- type Tuple
- func (t *Tuple) Eval(ctx *EvalContext) (Datum, error)
- func (node *Tuple) Format(buf *bytes.Buffer, f FmtFlags)
- func (node *Tuple) ResolvedType() Type
- func (node *Tuple) String() string
- func (expr *Tuple) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (expr *Tuple) Walk(v Visitor) Expr
- type Type
- type TypedExpr
- type TypedExprs
- type UnaryExpr
- func (expr *UnaryExpr) Eval(ctx *EvalContext) (Datum, error)
- func (node *UnaryExpr) Format(buf *bytes.Buffer, f FmtFlags)
- func (ta UnaryExpr) ResolvedType() Type
- func (node *UnaryExpr) String() string
- func (expr *UnaryExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
- func (node *UnaryExpr) TypedInnerExpr() TypedExpr
- func (expr *UnaryExpr) Walk(v Visitor) Expr
- type UnaryOp
- type UnaryOperator
- type UnionClause
- type UnionType
- type UniqueConstraint
- type UniqueConstraintTableDef
- type UnqualifiedStar
- func (expr UnqualifiedStar) Eval(ctx *EvalContext) (Datum, error)
- func (UnqualifiedStar) Format(buf *bytes.Buffer, _ FmtFlags)
- func (u UnqualifiedStar) NormalizeVarName() (VarName, error)
- func (UnqualifiedStar) ResolvedType() Type
- func (u UnqualifiedStar) String() string
- func (expr UnqualifiedStar) TypeCheck(_ *SemaContext, desired Type) (TypedExpr, error)
- func (UnqualifiedStar) Variable()
- func (expr UnqualifiedStar) Walk(_ Visitor) Expr
- type UnresolvedName
- func (expr UnresolvedName) Eval(ctx *EvalContext) (Datum, error)
- func (u UnresolvedName) Format(buf *bytes.Buffer, f FmtFlags)
- func (n UnresolvedName) NormalizeTableName() (*TableName, error)
- func (n UnresolvedName) NormalizeTablePattern() (TablePattern, error)
- func (n UnresolvedName) NormalizeUnqualifiedColumnItem() (*ColumnItem, error)
- func (n UnresolvedName) NormalizeVarName() (VarName, error)
- func (n UnresolvedName) ResolveFunction(searchPath SearchPath) (*FunctionDefinition, error)
- func (UnresolvedName) ResolvedType() Type
- func (u UnresolvedName) String() string
- func (expr UnresolvedName) TypeCheck(s *SemaContext, desired Type) (TypedExpr, error)
- func (UnresolvedName) Variable()
- func (expr UnresolvedName) Walk(_ Visitor) Expr
- type UnresolvedNames
- type Update
- type UpdateExpr
- type UpdateExprs
- type UserPriority
- type UsingJoinCond
- type ValidationBehavior
- type ValueGenerator
- type ValuesClause
- type VarName
- type VariableExpr
- type VariadicType
- type VectorColType
- type Visitor
- type WalkableStmt
- type When
- type Where
- type Window
- type WindowDef
- type WindowFrame
- type WindowFunc
Constants ¶
const ( DistinctFuncType funcType AllFuncType )
FuncExpr.Type
const ACTION = 57362
const ADD = 57363
const ALL = 57364
const ALTER = 57365
const ANALYSE = 57366
const ANALYZE = 57367
const AND = 57368
const ANNOTATE_TYPE = 57370
const ANY = 57369
const ARRAY = 57371
const AS = 57372
const ASC = 57373
const ASYMMETRIC = 57374
const AS_LA = 57652
const AT = 57375
const BACKUP = 57376
const BCONST = 57348
const BEGIN = 57377
const BETWEEN = 57378
const BIGINT = 57379
const BIGSERIAL = 57380
const BIT = 57381
const BLOB = 57382
const BOOL = 57383
const BOOLEAN = 57384
const BOTH = 57385
const BY = 57386
const BYTEA = 57387
const BYTES = 57388
const CASCADE = 57389
const CASE = 57390
const CAST = 57391
const CHAR = 57392
const CHARACTER = 57393
const CHARACTERISTICS = 57394
const CHECK = 57395
const CLUSTER = 57396
const COALESCE = 57397
const COLLATE = 57398
const COLLATION = 57399
const COLUMN = 57400
const COLUMNS = 57401
const COMMIT = 57402
const COMMITTED = 57403
const CONCAT = 57404
const CONFLICT = 57405
const CONSTRAINT = 57406
const CONSTRAINTS = 57407
const COPY = 57408
const COVERING = 57409
const CREATE = 57410
const CROSS = 57411
const CUBE = 57412
const CURRENT = 57413
const CURRENT_CATALOG = 57414
const CURRENT_DATE = 57415
const CURRENT_ROLE = 57416
const CURRENT_TIME = 57417
const CURRENT_TIMESTAMP = 57418
const CURRENT_USER = 57419
const CYCLE = 57420
const DATA = 57421
const DATABASE = 57422
const DATABASES = 57423
const DATE = 57424
const DAY = 57425
const DEALLOCATE = 57429
const DEC = 57426
const DECIMAL = 57427
const DEFAULT = 57428
const DEFERRABLE = 57430
const DELETE = 57431
const DESC = 57432
const DISTINCT = 57433
const DO = 57434
const DOT_DOT = 57354
const DOUBLE = 57435
const DROP = 57436
const ELSE = 57437
const ENCODING = 57438
const END = 57439
const ERROR = 57361
const ESCAPE = 57440
const EXCEPT = 57441
const EXECUTE = 57443
const EXISTS = 57442
const EXPLAIN = 57444
const EXTRACT = 57445
const EXTRACT_DURATION = 57446
const FALSE = 57447
const FAMILY = 57448
const FCONST = 57350
const FETCH = 57449
const FILTER = 57450
const FIRST = 57451
const FLOAT = 57452
const FLOORDIV = 57453
const FOLLOWING = 57454
const FOR = 57455
const FORCE_INDEX = 57456
const FOREIGN = 57457
const FROM = 57458
const FULL = 57459
const GRANT = 57460
const GRANTS = 57461
const GREATER_EQUALS = 57356
const GREATEST = 57462
const GROUP = 57463
const GROUPING = 57464
const HAVING = 57465
const HELP = 57466
const HIGH = 57467
const HOUR = 57468
const ICONST = 57349
const IDENT = 57346
const IF = 57470
const IFNULL = 57471
const ILIKE = 57472
const IN = 57473
const INCREMENTAL = 57469
const INDEX = 57475
const INDEXES = 57476
const INITIALLY = 57477
const INNER = 57478
const INSERT = 57479
const INT = 57480
const INT2VECTOR = 57481
const INT64 = 57483
const INT8 = 57482
const INTEGER = 57484
const INTERLEAVE = 57474
const INTERSECT = 57485
const INTERVAL = 57486
const INTO = 57487
const IS = 57488
const ISOLATION = 57489
const InvalidColIdx = -1
InvalidColIdx is the index value of a non-initialized IndexedVar.
const JOIN = 57490
const KEY = 57491
const KEYS = 57492
const LATERAL = 57493
const LC_COLLATE = 57495
const LC_CTYPE = 57494
const LEADING = 57496
const LEAST = 57497
const LEFT = 57498
const LESS_EQUALS = 57355
const LEVEL = 57499
const LIKE = 57500
const LIMIT = 57501
const LOCAL = 57502
const LOCALTIME = 57503
const LOCALTIMESTAMP = 57504
const LOW = 57505
const LSHIFT = 57506
const MATCH = 57507
const MINUTE = 57508
const MONTH = 57509
const MaxInt = int(MaxUint >> 1)
MaxInt is the maximum value of an int.
const MaxUint = ^uint(0)
MaxUint is the maximum value of an uint.
const NAME = 57511
const NAMES = 57512
const NAN = 57510
const NATURAL = 57513
const NEXT = 57514
const NO = 57515
const NORMAL = 57517
const NOT = 57518
const NOTHING = 57519
const NOT_EQUALS = 57357
const NOT_LA = 57650
const NOT_REGIMATCH = 57360
const NOT_REGMATCH = 57358
const NO_INDEX_JOIN = 57516
const NULL = 57520
const NULLIF = 57521
const NULLS = 57522
const NUMERIC = 57523
const OF = 57524
const OFF = 57525
const OFFSET = 57526
const OID = 57527
const ON = 57528
const ONLY = 57529
const OPTIONS = 57530
const OR = 57531
const ORDER = 57532
const ORDINALITY = 57533
const OUT = 57534
const OUTER = 57535
const OVER = 57536
const OVERLAPS = 57537
const OVERLAY = 57538
const PARENT = 57539
const PARTIAL = 57540
const PARTITION = 57541
const PASSWORD = 57542
const PLACEHOLDER = 57351
const PLACING = 57543
const POSITION = 57544
const POSTFIXOP = 57653
const PRECEDING = 57545
const PRECISION = 57546
const PREPARE = 57547
const PRIMARY = 57548
const PRIORITY = 57549
const RANGE = 57550
const READ = 57551
const REAL = 57552
const RECURSIVE = 57553
const REF = 57554
const REFERENCES = 57555
const REGCLASS = 57556
const REGIMATCH = 57359
const REGNAMESPACE = 57559
const REGPROC = 57557
const REGPROCEDURE = 57558
const REGTYPE = 57560
const RELEASE = 57563
const RENAME = 57561
const REPEATABLE = 57562
const RESET = 57564
const RESTORE = 57565
const RESTRICT = 57566
const RETURNING = 57567
const REVOKE = 57568
const RIGHT = 57569
const ROLLBACK = 57570
const ROLLUP = 57571
const ROW = 57572
const ROWS = 57573
const RSHIFT = 57574
const RestartSavepointName string = "COCKROACH_RESTART"
RestartSavepointName is the only savepoint name that we accept, modulo capitalization.
const SAVEPOINT = 57575
const SCATTER = 57576
const SCONST = 57347
const SEARCH = 57577
const SECOND = 57578
const SELECT = 57579
const SERIAL = 57580
const SERIALIZABLE = 57581
const SESSION = 57582
const SESSION_USER = 57583
const SET = 57584
const SETTING = 57585
const SETTINGS = 57586
const SHOW = 57587
const SIMILAR = 57588
const SIMPLE = 57589
const SMALLINT = 57590
const SMALLSERIAL = 57591
const SNAPSHOT = 57592
const SOME = 57593
const SPLIT = 57594
const SQL = 57595
const START = 57596
const STATUS = 57597
const STDIN = 57598
const STORING = 57601
const STRICT = 57599
const STRING = 57600
const SUBSTRING = 57602
const SYMMETRIC = 57603
const SYSTEM = 57604
const TABLE = 57605
const TABLES = 57606
const TEMPLATE = 57607
const TESTING_RANGES = 57608
const TESTING_RELOCATE = 57609
const TEXT = 57610
const THEN = 57611
const TIME = 57612
const TIMESTAMP = 57613
const TIMESTAMPTZ = 57614
const TO = 57615
const TRAILING = 57616
const TRANSACTION = 57617
const TREAT = 57618
const TRIM = 57619
const TRUE = 57620
const TRUNCATE = 57621
const TYPE = 57622
const TYPEANNOTATE = 57353
const TYPECAST = 57352
const (
// TimestampOutputFormat is used to output all timestamps.
TimestampOutputFormat = "2006-01-02 15:04:05.999999-07:00"
)
time.Time formats.
const UMINUS = 57654
const UNBOUNDED = 57623
const UNCOMMITTED = 57624
const UNION = 57625
const UNIQUE = 57626
const UNKNOWN = 57627
const UPDATE = 57628
const UPSERT = 57629
const USER = 57630
const USERS = 57631
const USING = 57632
const VALID = 57633
const VALIDATE = 57634
const VALUE = 57635
const VALUES = 57636
const VARCHAR = 57637
const VARIADIC = 57638
const VARYING = 57640
const VIEW = 57639
const WHEN = 57641
const WHERE = 57642
const WINDOW = 57643
const WITH = 57644
const WITHIN = 57645
const WITHOUT = 57646
const WITH_LA = 57651
const WRITE = 57647
const YEAR = 57648
const ZONE = 57649
Variables ¶
var ( // DBoolTrue is a pointer to the DBool(true) value and can be used in // comparisons against Datum types. DBoolTrue = &constDBoolTrue // DBoolFalse is a pointer to the DBool(false) value and can be used in // comparisons against Datum types. DBoolFalse = &constDBoolFalse // DNull is the NULL Datum. DNull Datum = dNull{} // DZero is the zero-valued integer Datum. DZero = NewDInt(0) )
var ( // DecimalCtx is the default context for decimal operations. Any change // in the exponent limits must still guarantee a safe conversion to the // postegrs binary decimal format in the wire protocol, which uses an // int16. See pgwire/types.go. DecimalCtx = &apd.Context{ Precision: 20, Rounding: apd.RoundHalfUp, MaxExponent: 2000, MinExponent: -2000, Traps: apd.DefaultTraps, } // ExactCtx is a decimal context with exact precision. ExactCtx = DecimalCtx.WithPrecision(0) // HighPrecisionCtx is a decimal context with high precision. HighPrecisionCtx = DecimalCtx.WithPrecision(2000) // RoundCtx is a decimal context with high precision and RoundHalfEven // rounding. RoundCtx = func() *apd.Context { ctx := *HighPrecisionCtx ctx.Rounding = apd.RoundHalfEven return &ctx }() )
var ( // TypeNull is the type of a DNull. Can be compared with ==. TypeNull Type = tNull{} // TypeBool is the type of a DBool. Can be compared with ==. TypeBool Type = tBool{} // TypeInt is the type of a DInt. Can be compared with ==. TypeInt Type = tInt{} // TypeFloat is the type of a DFloat. Can be compared with ==. TypeFloat Type = tFloat{} // TypeDecimal is the type of a DDecimal. Can be compared with ==. TypeDecimal Type = tDecimal{} // TypeString is the type of a DString. Can be compared with ==. TypeString Type = tString{} // TypeCollatedString is the type family of a DString. CANNOT be compared with // ==. TypeCollatedString Type = TCollatedString{} // TypeBytes is the type of a DBytes. Can be compared with ==. TypeBytes Type = tBytes{} // TypeDate is the type of a DDate. Can be compared with ==. TypeDate Type = tDate{} // TypeTimestamp is the type of a DTimestamp. Can be compared with ==. TypeTimestamp Type = tTimestamp{} // TypeTimestampTZ is the type of a DTimestampTZ. Can be compared with ==. TypeTimestampTZ Type = tTimestampTZ{} // TypeInterval is the type of a DInterval. Can be compared with ==. TypeInterval Type = tInterval{} // TypeTuple is the type family of a DTuple. CANNOT be compared with ==. TypeTuple Type = TTuple(nil) // TypeTable is the type family of a DTable. CANNOT be compared with ==. TypeTable Type = TTable{} // TypePlaceholder is the type family of a placeholder. CANNOT be compared // with ==. TypePlaceholder Type = TPlaceholder{} // TypeStringArray is the type family of a DArray containing strings. Can be // compared with ==. TypeStringArray Type = TArray{TypeString} // TypeIntArray is the type family of a DArray containing ints. Can be // compared with ==. TypeIntArray Type = TArray{TypeInt} // TypeAnyArray is the type of a DArray with a wildcard parameterized type. // Can be compared with ==. TypeAnyArray Type = TArray{TypeAny} // TypeAny can be any type. Can be compared with ==. TypeAny Type = tAny{} // TypeOid is the type of an OID. Can be compared with ==. TypeOid = tOid{oid.T_oid} // TypeRegClass is the type of an regclass OID variant. Can be compared with ==. TypeRegClass = tOid{oid.T_regclass} // TypeRegNamespace is the type of an regnamespace OID variant. Can be compared with ==. TypeRegNamespace = tOid{oid.T_regnamespace} // TypeRegProc is the type of an regproc OID variant. Can be compared with ==. TypeRegProc = tOid{oid.T_regproc} // TypeRegProcedure is the type of an regprocedure OID variant. Can be compared with ==. TypeRegProcedure = tOid{oid.T_regprocedure} // TypeRegType is the type of an regtype OID variant. Can be compared with ==. TypeRegType = tOid{oid.T_regtype} // TypeName is a type-alias for TypeString with a different OID. Can be // compared with ==. TypeName = wrapTypeWithOid(TypeString, oid.T_name) // TypeIntVector is a type-alias for a TypeIntArray with a different OID. Can // be compared with ==. TypeIntVector = wrapTypeWithOid(TypeIntArray, oid.T_int2vector) // TypeNameArray is the type family of a DArray containing the Name alias type. // Can be compared with ==. TypeNameArray Type = TArray{TypeName} // TypesAnyNonArray contains all non-array types. TypesAnyNonArray = []Type{ TypeBool, TypeInt, TypeFloat, TypeDecimal, TypeString, TypeBytes, TypeDate, TypeTimestamp, TypeTimestampTZ, TypeInterval, TypeOid, } )
var AbsentReturningClause = &NoReturningClause{}
AbsentReturningClause is a ReturningClause variant representing the absence of a RETURNING clause.
var Aggregates = map[string][]Builtin{ "array_agg": { makeAggBuiltinWithReturnType( TypeAny, func(args []TypedExpr) Type { if len(args) == 0 { return unknownReturnType } return TArray{args[0].ResolvedType()} }, newArrayAggregate, "Aggregates the selected values into an array.", ), }, "avg": { makeAggBuiltin(TypeInt, TypeDecimal, newIntAvgAggregate, "Calculates the average of the selected values."), makeAggBuiltin(TypeFloat, TypeFloat, newFloatAvgAggregate, "Calculates the average of the selected values."), makeAggBuiltin(TypeDecimal, TypeDecimal, newDecimalAvgAggregate, "Calculates the average of the selected values."), }, "bool_and": { makeAggBuiltin(TypeBool, TypeBool, newBoolAndAggregate, "Calculates the boolean value of `AND`ing all selected values."), }, "bool_or": { makeAggBuiltin(TypeBool, TypeBool, newBoolOrAggregate, "Calculates the boolean value of `OR`ing all selected values."), }, "concat_agg": { makeAggBuiltin(TypeString, TypeString, newStringConcatAggregate, "Concatenates all selected values."), makeAggBuiltin(TypeBytes, TypeBytes, newBytesConcatAggregate, "Concatenates all selected values."), }, "count": { makeAggBuiltin(TypeAny, TypeInt, newCountAggregate, "Calculates the number of selected elements."), }, "max": collectBuiltins(func(t Type) Builtin { return makeAggBuiltin(t, t, newMaxAggregate, "Identifies the maximum selected value.") }, TypesAnyNonArray...), "min": collectBuiltins(func(t Type) Builtin { return makeAggBuiltin(t, t, newMinAggregate, "Identifies the minimum selected value.") }, TypesAnyNonArray...), "sum_int": { makeAggBuiltin(TypeInt, TypeInt, newSmallIntSumAggregate, "Calculates the sum of the selected values."), }, "sum": { makeAggBuiltin(TypeInt, TypeDecimal, newIntSumAggregate, "Calculates the sum of the selected values."), makeAggBuiltin(TypeFloat, TypeFloat, newFloatSumAggregate, "Calculates the sum of the selected values."), makeAggBuiltin(TypeDecimal, TypeDecimal, newDecimalSumAggregate, "Calculates the sum of the selected values."), makeAggBuiltin(TypeInterval, TypeInterval, newIntervalSumAggregate, "Calculates the sum of the selected values."), }, "variance": { makeAggBuiltin(TypeInt, TypeDecimal, newIntVarianceAggregate, "Calculates the variance of the selected values."), makeAggBuiltin(TypeDecimal, TypeDecimal, newDecimalVarianceAggregate, "Calculates the variance of the selected values."), makeAggBuiltin(TypeFloat, TypeFloat, newFloatVarianceAggregate, "Calculates the variance of the selected values."), }, "stddev": { makeAggBuiltin(TypeInt, TypeDecimal, newIntStdDevAggregate, "Calculates the standard deviation of the selected values."), makeAggBuiltin(TypeDecimal, TypeDecimal, newDecimalStdDevAggregate, "Calculates the standard deviation of the selected values."), makeAggBuiltin(TypeFloat, TypeFloat, newFloatStdDevAggregate, "Calculates the standard deviation of the selected values."), }, }
Aggregates are a special class of builtin functions that are wrapped at execution in a bucketing layer to combine (aggregate) the result of the function being run over many rows. See `aggregateFuncHolder` in the sql package. In particular they must not be simplified during normalization (and thus must be marked as impure), even when they are given a constant argument (e.g. SUM(1)). This is because aggregate functions must return NULL when they are no rows in the source table, so their evaluation must always be delayed until query execution. Exported for use in documentation.
var BinOps = map[BinaryOperator]binOpOverload{ Bitand: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, }, Bitor: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, }, Bitxor: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, }, Plus: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, BinOp{ LeftType: TypeFloat, RightType: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDate, RightType: TypeInt, ReturnType: TypeDate, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDate, ReturnType: TypeDate, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestamp, RightType: TypeInterval, ReturnType: TypeTimestamp, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeTimestamp, ReturnType: TypeTimestamp, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestampTZ, RightType: TypeInterval, ReturnType: TypeTimestampTZ, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeTimestampTZ, ReturnType: TypeTimestampTZ, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeInterval, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDate, RightType: TypeInterval, ReturnType: TypeTimestampTZ, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeDate, ReturnType: TypeTimestampTZ, // contains filtered or unexported fields }, }, Minus: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, BinOp{ LeftType: TypeFloat, RightType: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDate, RightType: TypeInt, ReturnType: TypeDate, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDate, RightType: TypeDate, ReturnType: TypeInt, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestamp, RightType: TypeTimestamp, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestampTZ, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestamp, RightType: TypeTimestampTZ, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestamp, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestamp, RightType: TypeInterval, ReturnType: TypeTimestamp, // contains filtered or unexported fields }, BinOp{ LeftType: TypeTimestampTZ, RightType: TypeInterval, ReturnType: TypeTimestampTZ, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDate, RightType: TypeInterval, ReturnType: TypeTimestampTZ, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeInterval, ReturnType: TypeInterval, // contains filtered or unexported fields }, }, Mult: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, BinOp{ LeftType: TypeFloat, RightType: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeInterval, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeInt, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeFloat, ReturnType: TypeInterval, // contains filtered or unexported fields }, }, Div: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeFloat, RightType: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeInt, ReturnType: TypeInterval, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInterval, RightType: TypeFloat, ReturnType: TypeInterval, // contains filtered or unexported fields }, }, FloorDiv: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, BinOp{ LeftType: TypeFloat, RightType: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, }, Mod: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, BinOp{ LeftType: TypeFloat, RightType: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, }, Concat: { BinOp{ LeftType: TypeString, RightType: TypeString, ReturnType: TypeString, // contains filtered or unexported fields }, BinOp{ LeftType: TypeBytes, RightType: TypeBytes, ReturnType: TypeBytes, // contains filtered or unexported fields }, }, LShift: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, }, RShift: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, }, Pow: { BinOp{ LeftType: TypeInt, RightType: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, BinOp{ LeftType: TypeFloat, RightType: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeDecimal, RightType: TypeInt, ReturnType: TypeDecimal, // contains filtered or unexported fields }, BinOp{ LeftType: TypeInt, RightType: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, }, }
BinOps contains the binary operations indexed by operation type.
var Builtins = map[string][]Builtin{ "length": { stringBuiltin1(func(s string) (Datum, error) { return NewDInt(DInt(utf8.RuneCountInString(s))), nil }, TypeInt, "Calculates the number of characters in `val`."), bytesBuiltin1(func(s string) (Datum, error) { return NewDInt(DInt(len(s))), nil }, TypeInt, "Calculates the number of bytes in `val`."), }, "octet_length": { stringBuiltin1(func(s string) (Datum, error) { return NewDInt(DInt(len(s))), nil }, TypeInt, "Calculates the number of bytes used to represent `val`."), bytesBuiltin1(func(s string) (Datum, error) { return NewDInt(DInt(len(s))), nil }, TypeInt, "Calculates the number of bytes in `val`."), }, "lower": {stringBuiltin1(func(s string) (Datum, error) { return NewDString(strings.ToLower(s)), nil }, TypeString, "Converts all characters in `val`to their lower-case equivalents.")}, "upper": {stringBuiltin1(func(s string) (Datum, error) { return NewDString(strings.ToUpper(s)), nil }, TypeString, "Converts all characters in `val`to their to their upper-case equivalents.")}, "substr": substringImpls, "substring": substringImpls, "concat": { Builtin{ Types: VariadicType{TypeString}, ReturnType: fixedReturnType(TypeString), Info: "Concatenates a comma-separated list of strings.", // contains filtered or unexported fields }, }, "concat_ws": { Builtin{ Types: VariadicType{TypeString}, ReturnType: fixedReturnType(TypeString), Info: "Uses the first argument as a separator between the concatenation of the " + "subsequent arguments. <br/><br/>For example `concat_ws('!','wow','great')` " + "returns `wow!great`.", // contains filtered or unexported fields }, }, "to_uuid": { Builtin{ Types: ArgTypes{{"val", TypeString}}, ReturnType: fixedReturnType(TypeBytes), Info: "Converts the character string representation of a UUID to its byte string " + "representation.", // contains filtered or unexported fields }, }, "from_uuid": { Builtin{ Types: ArgTypes{{"val", TypeBytes}}, ReturnType: fixedReturnType(TypeString), Info: "Converts the byte string representation of a UUID to its character string " + "representation.", // contains filtered or unexported fields }, }, "from_ip": { Builtin{ Types: ArgTypes{{"val", TypeBytes}}, ReturnType: fixedReturnType(TypeString), Info: "Converts the byte string representation of an IP to its character string " + "representation.", // contains filtered or unexported fields }, }, "to_ip": { Builtin{ Types: ArgTypes{{"val", TypeString}}, ReturnType: fixedReturnType(TypeBytes), Info: "Converts the character string representation of an IP to its byte string " + "representation.", // contains filtered or unexported fields }, }, "split_part": { Builtin{ Types: ArgTypes{ {"input", TypeString}, {"delimiter", TypeString}, {"return_index_pos", TypeInt}, }, ReturnType: fixedReturnType(TypeString), Info: "Splits `input` on `delimiter` and return the value in the `return_index_pos` " + "position (starting at 1). <br/><br/>For example, `split_part('123.456.789.0','.',3)`" + "returns `789`.", // contains filtered or unexported fields }, }, "repeat": { Builtin{ Types: ArgTypes{{"input", TypeString}, {"repeat_counter", TypeInt}}, ReturnType: fixedReturnType(TypeString), Info: "Concatenates `input` `repeat_counter` number of times.<br/><br/>For example, " + "`repeat('dog', 2)` returns `dogdog`.", // contains filtered or unexported fields }, }, "ascii": {stringBuiltin1(func(s string) (Datum, error) { for _, ch := range s { return NewDInt(DInt(ch)), nil } return nil, errEmptyInputString }, TypeInt, "Calculates the ASCII value for the first character in `val`.")}, "md5": {stringBuiltin1(func(s string) (Datum, error) { return NewDString(fmt.Sprintf("%x", md5.Sum([]byte(s)))), nil }, TypeString, "Calculates the MD5 hash value of `val`.")}, "sha1": {stringBuiltin1(func(s string) (Datum, error) { return NewDString(fmt.Sprintf("%x", sha1.Sum([]byte(s)))), nil }, TypeString, "Calculates the SHA1 hash value of `val`.")}, "sha256": {stringBuiltin1(func(s string) (Datum, error) { return NewDString(fmt.Sprintf("%x", sha256.Sum256([]byte(s)))), nil }, TypeString, "Calculates the SHA256 hash value of `val`.")}, "to_hex": { Builtin{ Types: ArgTypes{{"val", TypeInt}}, ReturnType: fixedReturnType(TypeString), Info: "Converts `val` to its hexadecimal representation.", // contains filtered or unexported fields }, }, "strpos": {stringBuiltin2("input", "find", func(s, substring string) (Datum, error) { index := strings.Index(s, substring) if index < 0 { return DZero, nil } return NewDInt(DInt(utf8.RuneCountInString(s[:index]) + 1)), nil }, TypeInt, "Calculates the position where the string `find` begins in `input`. <br/><br/>For"+ " example, `strpos('doggie', 'gie')` returns `4`.")}, "overlay": { Builtin{ Types: ArgTypes{ {"input", TypeString}, {"overlay_val", TypeString}, {"start_pos", TypeInt}, }, ReturnType: fixedReturnType(TypeString), Info: "Replaces characters in `input` with `overlay_val` starting at `start_pos` " + "(begins at 1). <br/><br/>For example, `overlay('doggie', 'CAT', 2)` returns " + "`dCATie`.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{ {"input", TypeString}, {"overlay_val", TypeString}, {"start_pos", TypeInt}, {"end_pos", TypeInt}, }, ReturnType: fixedReturnType(TypeString), Info: "Deletes the characters in `input` between `start_pos` and `end_pos` (count " + "starts at 1), and then insert `overlay_val` at `start_pos`.", // contains filtered or unexported fields }, }, "btrim": { stringBuiltin2("input", "trim_chars", func(s, chars string) (Datum, error) { return NewDString(strings.Trim(s, chars)), nil }, TypeString, "Removes any characters included in `trim_chars` from the beginning or end"+ " of `input` (applies recursively). <br/><br/>For example, `btrim('doggie', 'eod')` "+ "returns `ggi`."), stringBuiltin1(func(s string) (Datum, error) { return NewDString(strings.TrimSpace(s)), nil }, TypeString, "Removes all spaces from the beginning and end of `val`."), }, "ltrim": { stringBuiltin2("input", "trim_chars", func(s, chars string) (Datum, error) { return NewDString(strings.TrimLeft(s, chars)), nil }, TypeString, "Removes any characters included in `trim_chars` from the beginning "+ "(left-hand side) of `input` (applies recursively). <br/><br/>For example, "+ "`ltrim('doggie', 'od')` returns `ggie`."), stringBuiltin1(func(s string) (Datum, error) { return NewDString(strings.TrimLeftFunc(s, unicode.IsSpace)), nil }, TypeString, "Removes all spaces from the beginning (left-hand side) of `val`."), }, "rtrim": { stringBuiltin2("input", "trim_chars", func(s, chars string) (Datum, error) { return NewDString(strings.TrimRight(s, chars)), nil }, TypeString, "Removes any characters included in `trim_chars` from the end (right-hand "+ "side) of `input` (applies recursively). <br/><br/>For example, `rtrim('doggie', 'ei')` "+ "returns `dogg`."), stringBuiltin1(func(s string) (Datum, error) { return NewDString(strings.TrimRightFunc(s, unicode.IsSpace)), nil }, TypeString, "Removes all spaces from the end (right-hand side) of `val`."), }, "reverse": {stringBuiltin1(func(s string) (Datum, error) { runes := []rune(s) for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 { runes[i], runes[j] = runes[j], runes[i] } return NewDString(string(runes)), nil }, TypeString, "Reverses the order of the string's characters.")}, "replace": {stringBuiltin3( "input", "find", "replace", func(input, from, to string) (Datum, error) { return NewDString(strings.Replace(input, from, to, -1)), nil }, TypeString, "Replaces all occurrences of `find` with `replace` in `input`", )}, "translate": {stringBuiltin3( "input", "find", "replace", func(s, from, to string) (Datum, error) { const deletionRune = utf8.MaxRune + 1 translation := make(map[rune]rune, len(from)) for _, fromRune := range from { toRune, size := utf8.DecodeRuneInString(to) if toRune == utf8.RuneError { toRune = deletionRune } else { to = to[size:] } translation[fromRune] = toRune } runes := make([]rune, 0, len(s)) for _, c := range s { if t, ok := translation[c]; ok { if t != deletionRune { runes = append(runes, t) } } else { runes = append(runes, c) } } return NewDString(string(runes)), nil }, TypeString, "In `input`, replaces the first character from `find` with the first "+ "character in `replace`; repeat for each character in `find`. <br/><br/>For example, "+ "`translate('doggie', 'dog', '123');` returns `1233ie`.")}, "regexp_extract": { Builtin{ Types: ArgTypes{{"input", TypeString}, {"regex", TypeString}}, ReturnType: fixedReturnType(TypeString), Info: "Returns the first match for the Regular Expression `regex` in `input`.", // contains filtered or unexported fields }, }, "regexp_replace": { Builtin{ Types: ArgTypes{ {"input", TypeString}, {"regex", TypeString}, {"replace", TypeString}, }, ReturnType: fixedReturnType(TypeString), Info: "Replaces matches for the Regular Expression `regex` in `input` with the " + "Regular Expression `replace`.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{ {"input", TypeString}, {"regex", TypeString}, {"replace", TypeString}, {"flags", TypeString}, }, ReturnType: fixedReturnType(TypeString), Info: "Replaces matches for the Regular Expression `regex` in `input` with the Regular " + "Expression `replace` using `flags`.<br/><br/>CockroachDB supports the following " + "flags:<br/><br/>• **c**: Case-sensitive matching<br/><br/>• **g**: " + "Global matching (match each substring instead of only the first).<br/><br/>• " + "**i**: Case-insensitive matching<br/><br/>• **m** or **n**: Newline-sensitive " + "`.` and negated brackets (`[^...]`) do not match newline characters (preventing " + "matching: matches from crossing newlines unless explicitly defined to); `^` and " + "`$` match the space before and after newline characters respectively (so characters " + "between newline characters are treated as if they're on a separate line).<br/>" + "<br/>• **p**: Partial newline-sensitive matching: `.` and negated brackets " + "(`[^...]`) do not match newline characters (preventing matches from crossing " + "newlines unless explicitly defined to), but `^` and `$` still only match the " + "beginning and end of `val`.<br/><br/>• **s**: Newline-insensitive " + "matching *(default)*.<br/><br/>• **w**: Inverse partial newline-sensitive " + "matching:`.` and negated brackets (`[^...]`) *do* match newline characters, but `^` " + "and `$` match the space before and after newline characters respectively (so " + "characters between newline characters are treated as if they're on a separate line).", // contains filtered or unexported fields }, }, "initcap": {stringBuiltin1(func(s string) (Datum, error) { return NewDString(strings.Title(strings.ToLower(s))), nil }, TypeString, "Capitalizes the first letter of `val`.")}, "left": { Builtin{ Types: ArgTypes{{"input", TypeBytes}, {"return_set", TypeInt}}, ReturnType: fixedReturnType(TypeBytes), Info: "Returns the first `return_set` bytes from `input`.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"input", TypeString}, {"return_set", TypeInt}}, ReturnType: fixedReturnType(TypeString), Info: "Returns the first `return_set` characters from `input`.", // contains filtered or unexported fields }, }, "right": { Builtin{ Types: ArgTypes{{"input", TypeBytes}, {"return_set", TypeInt}}, ReturnType: fixedReturnType(TypeBytes), Info: "Returns the last `return_set` bytes from `input`.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"input", TypeString}, {"return_set", TypeInt}}, ReturnType: fixedReturnType(TypeString), Info: "Returns the last `return_set` characters from `input`.", // contains filtered or unexported fields }, }, "random": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeFloat), Info: "Returns a random float between 0 and 1.", // contains filtered or unexported fields }, }, "unique_rowid": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeInt), Info: "Returns a unique ID used by CockroachDB to generate unique row IDs if a " + "Primary Key isn't defined for the table. The value is a combination of the " + " insert timestamp and the ID of the node executing the statement, which " + " guarantees this combination is globally unique.", // contains filtered or unexported fields }, }, "experimental_uuid_v4": {uuidV4Impl}, "uuid_v4": {uuidV4Impl}, "greatest": { Builtin{ Types: HomogeneousType{}, ReturnType: identityReturnType(0), Info: "Returns the element with the greatest value.", // contains filtered or unexported fields }, }, "least": { Builtin{ Types: HomogeneousType{}, ReturnType: identityReturnType(0), Info: "Returns the element with the lowest value.", // contains filtered or unexported fields }, }, "experimental_strftime": { Builtin{ Types: ArgTypes{{"input", TypeTimestamp}, {"extract_format", TypeString}}, ReturnType: fixedReturnType(TypeString), Info: "From `input`, extracts and formats the time as identified in `extract_format` " + "using standard `strftime` notation (though not all formatting is supported).", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"input", TypeDate}, {"extract_format", TypeString}}, ReturnType: fixedReturnType(TypeString), Info: "From `input`, extracts and formats the time as identified in `extract_format` " + "using standard `strftime` notation (though not all formatting is supported).", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"input", TypeTimestampTZ}, {"extract_format", TypeString}}, ReturnType: fixedReturnType(TypeString), Info: "From `input`, extracts and formats the time as identified in `extract_format` " + "using standard `strftime` notation (though not all formatting is supported).", // contains filtered or unexported fields }, }, "experimental_strptime": { Builtin{ Types: ArgTypes{{"input", TypeString}, {"format", TypeString}}, ReturnType: fixedReturnType(TypeTimestampTZ), Info: "Returns `input` as a timestamptz using `format` (which uses standard " + "`strptime` formatting).", // contains filtered or unexported fields }, }, "age": { Builtin{ Types: ArgTypes{{"val", TypeTimestampTZ}}, ReturnType: fixedReturnType(TypeInterval), Info: "Calculates the interval between `val` and the current time.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"begin", TypeTimestampTZ}, {"end", TypeTimestampTZ}}, ReturnType: fixedReturnType(TypeInterval), Info: "Calculates the interval between `begin` and `end`.", // contains filtered or unexported fields }, }, "current_date": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeDate), Info: "Returns the current date.", // contains filtered or unexported fields }, }, "now": txnTSImpl, "current_timestamp": txnTSImpl, "transaction_timestamp": txnTSImpl, "statement_timestamp": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeTimestampTZ), Info: "Returns the current statement's timestamp.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeTimestamp), Info: "Returns the current statement's timestamp.", // contains filtered or unexported fields }, }, "cluster_logical_timestamp": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeDecimal), Info: "This function is used only by CockroachDB's developers for testing purposes.", // contains filtered or unexported fields }, }, "clock_timestamp": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeTimestampTZ), Info: "Returns the current wallclock time.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeTimestamp), Info: "Returns the current wallclock time.", // contains filtered or unexported fields }, }, "extract": { Builtin{ Types: ArgTypes{{"element", TypeString}, {"input", TypeTimestamp}}, ReturnType: fixedReturnType(TypeInt), Info: "Extracts `element` from `input`. Compatible `elements` are: <br/>• " + "year<br/>• quarter<br/>• month<br/>• week<br/>• " + "dayofweek<br/>• dayofyear<br/>• hour<br/>• minute<br/>• " + "second<br/>• millisecond<br/>• microsecond<br/>• epoch", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"element", TypeString}, {"input", TypeDate}}, ReturnType: fixedReturnType(TypeInt), Info: "Extracts `element` from `input`. Compatible `elements` are: <br/>• " + "year<br/>• quarter<br/>• month<br/>• week<br/>• " + "dayofweek<br/>• dayofyear<br/>• hour<br/>• minute<br/>• " + "second<br/>• millisecond<br/>• microsecond<br/>• epoch", // contains filtered or unexported fields }, }, "extract_duration": { Builtin{ Types: ArgTypes{{"element", TypeString}, {"input", TypeInterval}}, ReturnType: fixedReturnType(TypeInt), Info: "Extracts `element` from `input`. Compatible `elements` are: <br/>• hour" + "<br/>• minute<br/>• second<br/>• millisecond<br/>• " + "microsecond", // contains filtered or unexported fields }, }, "abs": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Abs(x))), nil }, "Calculates the absolute value of `val`."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { dd := &DDecimal{} dd.Abs(x) return dd, nil }, "Calculates the absolute value of `val`."), Builtin{ Types: ArgTypes{{"val", TypeInt}}, ReturnType: fixedReturnType(TypeInt), Info: "Calculates the absolute value of `val`.", // contains filtered or unexported fields }, }, "acos": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Acos(x))), nil }, "Calculates the inverse cosine of `val`."), }, "asin": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Asin(x))), nil }, "Calculates the inverse sine of `val`."), }, "atan": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Atan(x))), nil }, "Calculates the inverse tangent of `val`."), }, "atan2": { floatBuiltin2("x", "y", func(x, y float64) (Datum, error) { return NewDFloat(DFloat(math.Atan2(x, y))), nil }, "Calculates the inverse tangent of `x`/`y`."), }, "cbrt": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Cbrt(x))), nil }, "Calculates the cube root (∛) of `val`."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { dd := &DDecimal{} _, err := DecimalCtx.Cbrt(&dd.Decimal, x) return dd, err }, "Calculates the cube root (∛) of `val`."), }, "ceil": ceilImpl, "ceiling": ceilImpl, "cos": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Cos(x))), nil }, "Calculates the cosine of `val`."), }, "cot": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(1 / math.Tan(x))), nil }, "Calculates the cotangent of `val`."), }, "degrees": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(180.0 * x / math.Pi)), nil }, "Converts `val` as a radian value to a degree value."), }, "div": { floatBuiltin2("x", "y", func(x, y float64) (Datum, error) { return NewDFloat(DFloat(math.Trunc(x / y))), nil }, "Calculates the integer quotient of `x`/`y`."), decimalBuiltin2("x", "y", func(x, y *apd.Decimal) (Datum, error) { if y.Sign() == 0 { return nil, errDivByZero } dd := &DDecimal{} _, err := HighPrecisionCtx.QuoInteger(&dd.Decimal, x, y) return dd, err }, "Calculates the integer quotient of `x`/`y`."), { Types: ArgTypes{{"x", TypeInt}, {"y", TypeInt}}, ReturnType: fixedReturnType(TypeInt), Info: "Calculates the integer quotient of `x`/`y`.", // contains filtered or unexported fields }, }, "exp": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Exp(x))), nil }, "Calculates *e* ^ `val`."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { dd := &DDecimal{} _, err := DecimalCtx.Exp(&dd.Decimal, x) return dd, err }, "Calculates *e* ^ `val`."), }, "floor": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Floor(x))), nil }, "Calculates the largest integer not greater than `val`."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { dd := &DDecimal{} _, err := ExactCtx.Floor(&dd.Decimal, x) return dd, err }, "Calculates the largest integer not greater than `val`."), }, "isnan": { Builtin{ Types: ArgTypes{{"val", TypeFloat}}, ReturnType: fixedReturnType(TypeBool), Info: "Returns true if `val` is NaN, false otherwise.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"val", TypeDecimal}}, ReturnType: fixedReturnType(TypeBool), Info: "Returns true if `val` is NaN, false otherwise.", // contains filtered or unexported fields }, }, "ln": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Log(x))), nil }, "Calculates the natural log of `val`."), decimalLogFn(DecimalCtx.Ln, "Calculates the natural log of `val`."), }, "log": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Log10(x))), nil }, "Calculates the base 10 log of `val`."), decimalLogFn(DecimalCtx.Log10, "Calculates the base 10 log of `val`."), }, "mod": { floatBuiltin2("x", "y", func(x, y float64) (Datum, error) { return NewDFloat(DFloat(math.Mod(x, y))), nil }, "Calculates `x`%`y`."), decimalBuiltin2("x", "y", func(x, y *apd.Decimal) (Datum, error) { if y.Sign() == 0 { return nil, errZeroModulus } dd := &DDecimal{} _, err := HighPrecisionCtx.Rem(&dd.Decimal, x, y) return dd, err }, "Calculates `x`%`y`."), Builtin{ Types: ArgTypes{{"x", TypeInt}, {"y", TypeInt}}, ReturnType: fixedReturnType(TypeInt), Info: "Calculates `x`%`y`.", // contains filtered or unexported fields }, }, "pi": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeFloat), Info: "Returns the value for pi (3.141592653589793).", // contains filtered or unexported fields }, }, "pow": powImpls, "power": powImpls, "radians": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(x * math.Pi / 180.0)), nil }, "Converts `val` as a degree value to a radians value."), }, "round": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(round(x))), nil }, "Rounds `val` to the nearest integer using half to even (banker's) rounding."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { return roundDecimal(x, 0) }, "Rounds `val` to the nearest integer, half away from zero: "+ "ROUND(+/-2.4) = +/-2, ROUND(+/-2.5) = +/-3."), Builtin{ Types: ArgTypes{{"input", TypeFloat}, {"decimal_accuracy", TypeInt}}, ReturnType: fixedReturnType(TypeFloat), Info: "Keeps `decimal_accuracy` number of figures to the right of the zero position " + " in `input` using half to even (banker's) rounding.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{{"input", TypeDecimal}, {"decimal_accuracy", TypeInt}}, ReturnType: fixedReturnType(TypeDecimal), Info: "Keeps `decimal_accuracy` number of figures to the right of the zero position " + " in `input using half away from zero rounding. If `decimal_accuracy` " + "is not in the range -2^31...(2^31-1), the results are undefined.", // contains filtered or unexported fields }, }, "sin": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Sin(x))), nil }, "Calculates the sine of `val`."), }, "sign": { floatBuiltin1(func(x float64) (Datum, error) { switch { case x < 0: return NewDFloat(-1), nil case x == 0: return NewDFloat(0), nil } return NewDFloat(1), nil }, "Determines the sign of `val`: **1** for positive; **0** for 0 values; **-1** for "+ "negative."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { d := &DDecimal{} d.Decimal.SetCoefficient(int64(x.Sign())) return d, nil }, "Determines the sign of `val`: **1** for positive; **0** for 0 values; **-1** for "+ "negative."), Builtin{ Types: ArgTypes{{"val", TypeInt}}, ReturnType: fixedReturnType(TypeInt), Info: "Determines the sign of `val`: **1** for positive; **0** for 0 values; **-1** " + "for negative.", // contains filtered or unexported fields }, }, "sqrt": { floatBuiltin1(func(x float64) (Datum, error) { if x < 0 { return nil, errSqrtOfNegNumber } return NewDFloat(DFloat(math.Sqrt(x))), nil }, "Calculates the square root of `val`."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { if x.Sign() < 0 { return nil, errSqrtOfNegNumber } dd := &DDecimal{} _, err := DecimalCtx.Sqrt(&dd.Decimal, x) return dd, err }, "Calculates the square root of `val`."), }, "tan": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Tan(x))), nil }, "Calculates the tangent of `val`."), }, "trunc": { floatBuiltin1(func(x float64) (Datum, error) { return NewDFloat(DFloat(math.Trunc(x))), nil }, "Truncates the decimal values of `val`."), decimalBuiltin1(func(x *apd.Decimal) (Datum, error) { dd := &DDecimal{} frac := new(apd.Decimal) x.Modf(&dd.Decimal, frac) return dd, nil }, "Truncates the decimal values of `val`."), }, "to_english": { Builtin{ Types: ArgTypes{{"val", TypeInt}}, ReturnType: fixedReturnType(TypeString), Info: "This function enunciates the value of its argument using English cardinals.", // contains filtered or unexported fields }, }, "array_length": { Builtin{ Types: ArgTypes{{"input", TypeAnyArray}, {"array_dimension", TypeInt}}, ReturnType: fixedReturnType(TypeInt), Info: "Calculates the length of `input` on the provided `array_dimension`. However, " + "because CockroachDB doesn't yet support multi-dimensional arrays, the only supported" + " `array_dimension` is **1**.", // contains filtered or unexported fields }, }, "array_lower": { Builtin{ Types: ArgTypes{{"input", TypeAnyArray}, {"array_dimension", TypeInt}}, ReturnType: fixedReturnType(TypeInt), Info: "Calculates the minimum value of `input` on the provided `array_dimension`. " + "However, because CockroachDB doesn't yet support multi-dimensional arrays, the only " + "supported `array_dimension` is **1**.", // contains filtered or unexported fields }, }, "array_upper": { Builtin{ Types: ArgTypes{{"input", TypeAnyArray}, {"array_dimension", TypeInt}}, ReturnType: fixedReturnType(TypeInt), Info: "Calculates the maximum value of `input` on the provided `array_dimension`. " + "However, because CockroachDB doesn't yet support multi-dimensional arrays, the only " + "supported `array_dimension` is **1**.", // contains filtered or unexported fields }, }, "version": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeString), Info: "Returns the node's version of CockroachDB.", // contains filtered or unexported fields }, }, "current_database": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeString), Info: "Returns the current database.", // contains filtered or unexported fields }, }, "current_schema": { Builtin{ Types: ArgTypes{}, ReturnType: fixedReturnType(TypeString), Info: "Returns the current schema. This function is provided for " + "compatibility with PostgreSQL. For a new CockroachDB application, " + "consider using current_database() instead.", // contains filtered or unexported fields }, }, "current_schemas": { Builtin{ Types: ArgTypes{{"include_pg_catalog", TypeBool}}, ReturnType: fixedReturnType(TypeStringArray), Info: "Returns the current search path for unqualified names.", // contains filtered or unexported fields }, }, "crdb_internal.force_internal_error": { Builtin{ Types: ArgTypes{{"msg", TypeString}}, ReturnType: fixedReturnType(TypeInt), Info: "This function is used only by CockroachDB's developers for testing purposes.", // contains filtered or unexported fields }, }, "crdb_internal.force_panic": { Builtin{ Types: ArgTypes{{"msg", TypeString}}, ReturnType: fixedReturnType(TypeInt), Info: "This function is used only by CockroachDB's developers for testing purposes.", // contains filtered or unexported fields }, }, "crdb_internal.force_log_fatal": { Builtin{ Types: ArgTypes{{"msg", TypeString}}, ReturnType: fixedReturnType(TypeInt), Info: "This function is used only by CockroachDB's developers for testing purposes.", // contains filtered or unexported fields }, }, "crdb_internal.force_retry": { Builtin{ Types: ArgTypes{{"val", TypeInterval}}, ReturnType: fixedReturnType(TypeInt), Info: "This function is used only by CockroachDB's developers for testing purposes.", // contains filtered or unexported fields }, Builtin{ Types: ArgTypes{ {"val", TypeInterval}, {"txnID", TypeString}}, ReturnType: fixedReturnType(TypeInt), Info: "This function is used only by CockroachDB's developers for testing purposes.", // contains filtered or unexported fields }, }, }
Builtins contains the built-in functions indexed by name.
var CmpOps = map[ComparisonOperator]cmpOpOverload{ EQ: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeCollatedString, RightType: TypeCollatedString, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeBytes, RightType: TypeBytes, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeBool, RightType: TypeBool, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInterval, RightType: TypeInterval, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeOid, RightType: TypeOid, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTuple, RightType: TypeTuple, // contains filtered or unexported fields }, }, LT: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeCollatedString, RightType: TypeCollatedString, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeBytes, RightType: TypeBytes, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeBool, RightType: TypeBool, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInterval, RightType: TypeInterval, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTuple, RightType: TypeTuple, // contains filtered or unexported fields }, }, LE: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeCollatedString, RightType: TypeCollatedString, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeBytes, RightType: TypeBytes, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeBool, RightType: TypeBool, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeInt, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInt, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDecimal, RightType: TypeFloat, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeFloat, RightType: TypeDecimal, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeTimestampTZ, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeDate, RightType: TypeTimestamp, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestampTZ, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTimestamp, RightType: TypeDate, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeInterval, RightType: TypeInterval, // contains filtered or unexported fields }, CmpOp{ LeftType: TypeTuple, RightType: TypeTuple, // contains filtered or unexported fields }, }, In: { makeEvalTupleIn(TypeBool), makeEvalTupleIn(TypeInt), makeEvalTupleIn(TypeFloat), makeEvalTupleIn(TypeDecimal), makeEvalTupleIn(TypeString), makeEvalTupleIn(TypeCollatedString), makeEvalTupleIn(TypeBytes), makeEvalTupleIn(TypeDate), makeEvalTupleIn(TypeTimestamp), makeEvalTupleIn(TypeTimestampTZ), makeEvalTupleIn(TypeInterval), makeEvalTupleIn(TypeTuple), makeEvalTupleIn(TypeOid), }, Like: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, }, ILike: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, }, SimilarTo: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, }, RegMatch: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, }, RegIMatch: { CmpOp{ LeftType: TypeString, RightType: TypeString, // contains filtered or unexported fields }, }, }
CmpOps contains the comparison operations indexed by operation type.
var Generators = map[string][]Builtin{ "generate_series": { makeGeneratorBuiltin( ArgTypes{{"start", TypeInt}, {"end", TypeInt}}, TTuple{TypeInt}, makeSeriesGenerator, "Produces a virtual table containing the integer values from `start` to `end`, inclusive.", ), makeGeneratorBuiltin( ArgTypes{{"start", TypeInt}, {"end", TypeInt}, {"step", TypeInt}}, TTuple{TypeInt}, makeSeriesGenerator, "Produces a virtual table containing the integer values from `start` to `end`, inclusive, by increment of `step`.", ), }, "unnest": { makeGeneratorBuiltinWithReturnType( ArgTypes{{"input", TypeAnyArray}}, func(args []TypedExpr) Type { if len(args) == 0 { return unknownReturnType } return TTable{Cols: TTuple{args[0].ResolvedType().(TArray).Typ}} }, makeArrayGenerator, "Returns the input array as a set of rows", ), }, }
Generators is a map from name to slice of Builtins for all built-in generators.
var OidToType = map[oid.Oid]Type{ oid.T_anyelement: TypeAny, oid.T_bool: TypeBool, oid.T_bytea: TypeBytes, oid.T_date: TypeDate, oid.T_float4: typeFloat4, oid.T_float8: TypeFloat, oid.T_int2: typeInt2, oid.T_int4: typeInt4, oid.T_int8: TypeInt, oid.T_int2vector: TypeIntVector, oid.T_interval: TypeInterval, oid.T_name: TypeName, oid.T_numeric: TypeDecimal, oid.T_oid: TypeOid, oid.T_regclass: TypeRegClass, oid.T_regnamespace: TypeRegNamespace, oid.T_regproc: TypeRegProc, oid.T_regprocedure: TypeRegProcedure, oid.T_regtype: TypeRegType, oid.T__text: TypeStringArray, oid.T__int2: typeInt2Array, oid.T__int4: typeInt4Array, oid.T__int8: TypeIntArray, oid.T_record: TypeTuple, oid.T_text: TypeString, oid.T_timestamp: TypeTimestamp, oid.T_timestamptz: TypeTimestampTZ, oid.T_varchar: typeVarChar, }
OidToType maps Postgres object IDs to CockroachDB types.
var StarDatumInstance = &StarDatum{}
StarDatumInstance can be used as common instance for all uses of StarDatum.
var UnaryOps = map[UnaryOperator]unaryOpOverload{ UnaryPlus: { UnaryOp{ Typ: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, UnaryOp{ Typ: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, UnaryOp{ Typ: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, }, UnaryMinus: { UnaryOp{ Typ: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, UnaryOp{ Typ: TypeFloat, ReturnType: TypeFloat, // contains filtered or unexported fields }, UnaryOp{ Typ: TypeDecimal, ReturnType: TypeDecimal, // contains filtered or unexported fields }, UnaryOp{ Typ: TypeInterval, ReturnType: TypeInterval, // contains filtered or unexported fields }, }, UnaryComplement: { UnaryOp{ Typ: TypeInt, ReturnType: TypeInt, // contains filtered or unexported fields }, }, }
UnaryOps contains the unary operations indexed by operation type.
Functions ¶
func AsStringWithFlags ¶
func AsStringWithFlags(n NodeFormatter, f FmtFlags) string
AsStringWithFlags pretty prints a node to a string given specific flags.
func ContainsVars ¶
ContainsVars returns true if the expression contains any variables. (variables = sub-expressions, placeholders, indexed vars, etc.)
func ExprDebugString ¶
ExprDebugString generates a multi-line debug string with one node per line in Go format.
func FindEqualComparisonFunction ¶
func FindEqualComparisonFunction( leftType, rightType Type, ) (func(*EvalContext, Datum, Datum) (Datum, error), bool)
FindEqualComparisonFunction looks up an overload of the "=" operator for a given pair of input operand types.
func FormatNode ¶
func FormatNode(buf *bytes.Buffer, f FmtFlags, n NodeFormatter)
FormatNode recurses into a node for pretty-printing. Flag-driven special cases can hook into this.
func HasReturningClause ¶
func HasReturningClause(clause ReturningClause) bool
HasReturningClause determines if a ReturningClause is present, given a variant of the ReturningClause interface.
func IsIdentAggregate ¶
func IsIdentAggregate(f AggregateFunc) bool
IsIdentAggregate returns true for identAggregate.
func IsNumericOne ¶
IsNumericOne returns true if the datum is a number and equal to one.
func IsNumericZero ¶
IsNumericZero returns true if the datum is a number and equal to zero.
func PGDisplayName ¶
PGDisplayName returns the Postgres display name for a given type.
func PGIOBuiltinPrefix ¶
PGIOBuiltinPrefix returns the string prefix to a type's IO functions. This is either the type's postgres display name or the type's postgres display name plus an underscore, depending on the type.
func ReNormalizeName ¶
ReNormalizeName performs the same work as NormalizeName but when the string originates from the database. We define a different function so as to be able to track usage of this function (cf. #8200).
func Serialize ¶
func Serialize(n NodeFormatter) string
Serialize pretty prints a node to a string using FmtParsable; it is appropriate when we store expressions into strings that are later parsed back into expressions.
func SimilarEscape ¶
SimilarEscape converts a SQL:2008 regexp pattern to POSIX style, so it can be used by our regexp engine.
func StmtDebugString ¶
StmtDebugString generates multi-line debug strings in Go format for the expressions that are part of the given statement.
func ValidateRestartCheckpoint ¶
ValidateRestartCheckpoint checks that a checkpoint name is our magic restart value. We accept everything with the desired prefix because at least the C++ libpqxx appends sequence numbers to the savepoint name specified by the user.
func WalkExprConst ¶
WalkExprConst is a variant of WalkExpr for visitors that do not modify the expression.
Types ¶
type AggregateFunc ¶
type AggregateFunc interface { // Add accumulates the passed datum into the AggregateFunc. Add(context.Context, Datum) error // Result returns the current value of the accumulation. This value // will be a deep copy of any AggregateFunc internal state, so that // it will not be mutated by additional calls to Add. Result() (Datum, error) // Close closes out the AggregateFunc and allows it to release any memory it // requested during aggregation, and must be called upon completion of the // aggregation. Close(context.Context) }
AggregateFunc accumulates the result of a function of a Datum.
func NewIdentAggregate ¶
func NewIdentAggregate(*EvalContext) AggregateFunc
NewIdentAggregate returns an identAggregate (see comment on struct).
type AliasClause ¶
AliasClause represents an alias, optionally with a column list: "AS name" or "AS name(col1, col2)".
type AliasedTableExpr ¶
type AliasedTableExpr struct { Expr TableExpr Hints *IndexHints Ordinality bool As AliasClause }
AliasedTableExpr represents a table expression coupled with an optional alias.
func (*AliasedTableExpr) Format ¶
func (node *AliasedTableExpr) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AliasedTableExpr) String ¶
func (node *AliasedTableExpr) String() string
type AllColumnsSelector ¶
type AllColumnsSelector struct {
TableName
}
AllColumnsSelector corresponds to a selection of all columns in a table when used in a SELECT clause. (e.g. `table.*`)
func (*AllColumnsSelector) Eval ¶
func (expr *AllColumnsSelector) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*AllColumnsSelector) Format ¶
func (a *AllColumnsSelector) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AllColumnsSelector) NormalizeVarName ¶
func (a *AllColumnsSelector) NormalizeVarName() (VarName, error)
NormalizeVarName is a no-op for AllColumnsSelector (already normalized)
func (*AllColumnsSelector) ResolvedType ¶
func (*AllColumnsSelector) ResolvedType() Type
ResolvedType implements the TypedExpr interface.
func (*AllColumnsSelector) String ¶
func (a *AllColumnsSelector) String() string
func (*AllColumnsSelector) TypeCheck ¶
func (expr *AllColumnsSelector) TypeCheck(_ *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*AllColumnsSelector) Variable ¶
func (a *AllColumnsSelector) Variable()
Variable implements the VariableExpr interface. Although, the AllColumnsSelector ought to be replaced to an IndexedVar before the points the VariableExpr interface is used.
func (*AllColumnsSelector) Walk ¶
func (expr *AllColumnsSelector) Walk(_ Visitor) Expr
Walk implements the Expr interface.
type AllTablesSelector ¶
type AllTablesSelector struct {
Database Name
}
AllTablesSelector corresponds to a selection of all tables in a database, e.g. when used with GRANT.
func (*AllTablesSelector) Format ¶
func (at *AllTablesSelector) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AllTablesSelector) NormalizeTablePattern ¶
func (at *AllTablesSelector) NormalizeTablePattern() (TablePattern, error)
NormalizeTablePattern implements the TablePattern interface.
func (*AllTablesSelector) QualifyWithDatabase ¶
func (at *AllTablesSelector) QualifyWithDatabase(database string) error
QualifyWithDatabase adds an indirection for the database, if it's missing. It transforms: * -> database.*
func (*AllTablesSelector) String ¶
func (at *AllTablesSelector) String() string
type AlterTable ¶
type AlterTable struct { IfExists bool Table NormalizableTableName Cmds AlterTableCmds }
AlterTable represents an ALTER TABLE statement.
func (*AlterTable) Format ¶
func (node *AlterTable) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AlterTable) StatementTag ¶
func (*AlterTable) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*AlterTable) StatementType ¶
func (*AlterTable) StatementType() StatementType
StatementType implements the Statement interface.
func (*AlterTable) String ¶
func (n *AlterTable) String() string
type AlterTableAddColumn ¶
type AlterTableAddColumn struct { IfNotExists bool ColumnDef *ColumnTableDef // contains filtered or unexported fields }
AlterTableAddColumn represents an ADD COLUMN command.
func (*AlterTableAddColumn) Format ¶
func (node *AlterTableAddColumn) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AlterTableAddColumn) String ¶
func (n *AlterTableAddColumn) String() string
type AlterTableAddConstraint ¶
type AlterTableAddConstraint struct { ConstraintDef ConstraintTableDef ValidationBehavior ValidationBehavior }
AlterTableAddConstraint represents an ADD CONSTRAINT command.
func (*AlterTableAddConstraint) Format ¶
func (node *AlterTableAddConstraint) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AlterTableAddConstraint) String ¶
func (n *AlterTableAddConstraint) String() string
type AlterTableCmd ¶
type AlterTableCmd interface { NodeFormatter // contains filtered or unexported methods }
AlterTableCmd represents a table modification operation.
type AlterTableCmds ¶
type AlterTableCmds []AlterTableCmd
AlterTableCmds represents a list of table alterations.
func (AlterTableCmds) Format ¶
func (node AlterTableCmds) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (AlterTableCmds) String ¶
func (n AlterTableCmds) String() string
type AlterTableDropColumn ¶
type AlterTableDropColumn struct { IfExists bool Column Name DropBehavior DropBehavior // contains filtered or unexported fields }
AlterTableDropColumn represents a DROP COLUMN command.
func (*AlterTableDropColumn) Format ¶
func (node *AlterTableDropColumn) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AlterTableDropColumn) String ¶
func (n *AlterTableDropColumn) String() string
type AlterTableDropConstraint ¶
type AlterTableDropConstraint struct { IfExists bool Constraint Name DropBehavior DropBehavior }
AlterTableDropConstraint represents a DROP CONSTRAINT command.
func (*AlterTableDropConstraint) Format ¶
func (node *AlterTableDropConstraint) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AlterTableDropConstraint) String ¶
func (n *AlterTableDropConstraint) String() string
type AlterTableDropNotNull ¶
type AlterTableDropNotNull struct { Column Name // contains filtered or unexported fields }
AlterTableDropNotNull represents an ALTER COLUMN DROP NOT NULL command.
func (*AlterTableDropNotNull) Format ¶
func (node *AlterTableDropNotNull) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AlterTableDropNotNull) GetColumn ¶
func (node *AlterTableDropNotNull) GetColumn() Name
GetColumn implements the ColumnMutationCmd interface.
func (*AlterTableDropNotNull) String ¶
func (n *AlterTableDropNotNull) String() string
type AlterTableSetDefault ¶
type AlterTableSetDefault struct { Column Name Default Expr // contains filtered or unexported fields }
AlterTableSetDefault represents an ALTER COLUMN SET DEFAULT or DROP DEFAULT command.
func (*AlterTableSetDefault) Format ¶
func (node *AlterTableSetDefault) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AlterTableSetDefault) GetColumn ¶
func (node *AlterTableSetDefault) GetColumn() Name
GetColumn implements the ColumnMutationCmd interface.
func (*AlterTableSetDefault) String ¶
func (n *AlterTableSetDefault) String() string
type AlterTableValidateConstraint ¶
type AlterTableValidateConstraint struct {
Constraint Name
}
AlterTableValidateConstraint represents a VALIDATE CONSTRAINT command.
type AndExpr ¶
type AndExpr struct {
Left, Right Expr
// contains filtered or unexported fields
}
AndExpr represents an AND expression.
func NewTypedAndExpr ¶
NewTypedAndExpr returns a new AndExpr that is verified to be well-typed.
func (*AndExpr) Eval ¶
func (expr *AndExpr) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (AndExpr) ResolvedType ¶
func (ta AndExpr) ResolvedType() Type
func (*AndExpr) TypeCheck ¶
func (expr *AndExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*AndExpr) TypedRight ¶
TypedRight returns the AndExpr's right expression as a TypedExpr.
type AnnotateTypeExpr ¶
type AnnotateTypeExpr struct { Expr Expr Type CastTargetType // contains filtered or unexported fields }
AnnotateTypeExpr represents a ANNOTATE_TYPE(expr, type) expression.
func (*AnnotateTypeExpr) Format ¶
func (node *AnnotateTypeExpr) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*AnnotateTypeExpr) String ¶
func (node *AnnotateTypeExpr) String() string
func (*AnnotateTypeExpr) TypeCheck ¶
func (expr *AnnotateTypeExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*AnnotateTypeExpr) TypedInnerExpr ¶
func (node *AnnotateTypeExpr) TypedInnerExpr() TypedExpr
TypedInnerExpr returns the AnnotateTypeExpr's inner expression as a TypedExpr.
func (*AnnotateTypeExpr) Walk ¶
func (expr *AnnotateTypeExpr) Walk(v Visitor) Expr
Walk implements the Expr interface.
type ArgTypes ¶
ArgTypes is very similar to ArgTypes except it allows keeping a string name for each argument as well and using those when printing the human-readable signature.
type Array ¶
type Array struct { Exprs Exprs // contains filtered or unexported fields }
Array represents an array constructor.
func (*Array) Eval ¶
func (t *Array) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (Array) ResolvedType ¶
func (ta Array) ResolvedType() Type
type ArrayColType ¶
type ArrayColType struct { Name string // ParamTyp is the type of the elements in this array. ParamType ColumnType BoundsExprs Exprs }
ArrayColType represents an ARRAY column type.
func (*ArrayColType) Format ¶
func (node *ArrayColType) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*ArrayColType) String ¶
func (node *ArrayColType) String() string
type ArrayFlatten ¶
type ArrayFlatten struct { Subquery Expr // contains filtered or unexported fields }
ArrayFlatten represents a subquery array constructor.
func (*ArrayFlatten) Eval ¶
func (t *ArrayFlatten) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*ArrayFlatten) Format ¶
func (node *ArrayFlatten) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (ArrayFlatten) ResolvedType ¶
func (ta ArrayFlatten) ResolvedType() Type
func (*ArrayFlatten) String ¶
func (node *ArrayFlatten) String() string
func (*ArrayFlatten) TypeCheck ¶
func (expr *ArrayFlatten) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*ArrayFlatten) Walk ¶
func (expr *ArrayFlatten) Walk(v Visitor) Expr
Walk implements the Expr interface.
type ArraySubscript ¶
ArraySubscript corresponds to the syntax `<name>[ ... ]`.
type ArraySubscripts ¶
type ArraySubscripts []*ArraySubscript
ArraySubscripts represents a sequence of one or more array subscripts.
type Backup ¶
type Backup struct { Targets TargetList To Expr IncrementalFrom Exprs AsOf AsOfClause Options KVOptions }
Backup represents a BACKUP statement.
func (*Backup) StatementTag ¶
StatementTag returns a short string identifying the type of statement.
func (*Backup) StatementType ¶
func (*Backup) StatementType() StatementType
StatementType implements the Statement interface.
type BeginTransaction ¶
type BeginTransaction struct { Isolation IsolationLevel UserPriority UserPriority }
BeginTransaction represents a BEGIN statement
func (*BeginTransaction) Format ¶
func (node *BeginTransaction) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*BeginTransaction) StatementTag ¶
func (*BeginTransaction) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*BeginTransaction) StatementType ¶
func (*BeginTransaction) StatementType() StatementType
StatementType implements the Statement interface.
func (*BeginTransaction) String ¶
func (n *BeginTransaction) String() string
type BinOp ¶
type BinOp struct { LeftType Type RightType Type ReturnType Type // contains filtered or unexported fields }
BinOp is a binary operator.
type BinaryExpr ¶
type BinaryExpr struct { Operator BinaryOperator Left, Right Expr // contains filtered or unexported fields }
BinaryExpr represents a binary value expression.
func (*BinaryExpr) Eval ¶
func (expr *BinaryExpr) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*BinaryExpr) Format ¶
func (node *BinaryExpr) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (BinaryExpr) ResolvedType ¶
func (ta BinaryExpr) ResolvedType() Type
func (*BinaryExpr) String ¶
func (node *BinaryExpr) String() string
func (*BinaryExpr) TypeCheck ¶
func (expr *BinaryExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*BinaryExpr) TypedLeft ¶
func (node *BinaryExpr) TypedLeft() TypedExpr
TypedLeft returns the BinaryExpr's left expression as a TypedExpr.
func (*BinaryExpr) TypedRight ¶
func (node *BinaryExpr) TypedRight() TypedExpr
TypedRight returns the BinaryExpr's right expression as a TypedExpr.
func (*BinaryExpr) Walk ¶
func (expr *BinaryExpr) Walk(v Visitor) Expr
Walk implements the Expr interface.
type BinaryOperator ¶
type BinaryOperator int
BinaryOperator represents a binary operator.
const ( Bitand BinaryOperator = iota Bitor Bitxor Plus Minus Mult Div FloorDiv Mod Pow Concat LShift RShift )
BinaryExpr.Operator
func (BinaryOperator) String ¶
func (i BinaryOperator) String() string
type BoolColType ¶
type BoolColType struct {
Name string
}
BoolColType represents a BOOLEAN type.
func (*BoolColType) Format ¶
func (node *BoolColType) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*BoolColType) String ¶
func (node *BoolColType) String() string
type Builtin ¶
type Builtin struct { Types typeList ReturnType returnTyper // Info is a description of the function, which is surfaced on the CockroachDB // docs site on the "Functions and Operators" page. Descriptions typically use // third-person with the function as an implicit subject (e.g. "Calculates // infinity"), but should focus more on ease of understanding so other structures // might be more appropriate. Info string AggregateFunc func([]Type, *EvalContext) AggregateFunc WindowFunc func([]Type, *EvalContext) WindowFunc // contains filtered or unexported fields }
Builtin is a built-in function.
func (Builtin) Class ¶
func (b Builtin) Class() FunctionClass
Class returns the FunctionClass of this builtin.
func (Builtin) DistSQLBlacklist ¶
DistSQLBlacklist returns true if the builtin is not supported by DistSQL. See distsqlBlacklist.
func (Builtin) FixedReturnType ¶
FixedReturnType returns a fixed type that the function returns, returning Any if the return type is based on the function's arguments.
type BytesColType ¶
type BytesColType struct {
Name string
}
BytesColType represents a BYTES or BLOB type.
func (*BytesColType) Format ¶
func (node *BytesColType) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*BytesColType) String ¶
func (node *BytesColType) String() string
type CaseExpr ¶
type CaseExpr struct { Expr Expr Whens []*When Else Expr // contains filtered or unexported fields }
CaseExpr represents a CASE expression.
func (*CaseExpr) CopyNode ¶
CopyNode makes a copy of this Expr without recursing in any child Exprs.
func (*CaseExpr) Eval ¶
func (expr *CaseExpr) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (CaseExpr) ResolvedType ¶
func (ta CaseExpr) ResolvedType() Type
type CastExpr ¶
type CastExpr struct { Expr Expr Type CastTargetType // contains filtered or unexported fields }
CastExpr represents a CAST(expr AS type) expression.
func (*CastExpr) Eval ¶
func (expr *CastExpr) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (CastExpr) ResolvedType ¶
func (ta CastExpr) ResolvedType() Type
type CastTargetType ¶
type CastTargetType interface { fmt.Stringer NodeFormatter // contains filtered or unexported methods }
CastTargetType represents a type that is a valid cast target.
func ParseType ¶ added in v1.0.3
func ParseType(sql string) (CastTargetType, error)
ParseType parses a column type.
type CheckConstraintTableDef ¶
CheckConstraintTableDef represents a check constraint within a CREATE TABLE statement.
type CoalesceExpr ¶
CoalesceExpr represents a COALESCE or IFNULL expression.
func (*CoalesceExpr) CopyNode ¶
func (expr *CoalesceExpr) CopyNode() *CoalesceExpr
CopyNode makes a copy of this Expr without recursing in any child Exprs.
func (*CoalesceExpr) Eval ¶
func (expr *CoalesceExpr) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*CoalesceExpr) Format ¶
func (node *CoalesceExpr) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (CoalesceExpr) ResolvedType ¶
func (ta CoalesceExpr) ResolvedType() Type
func (*CoalesceExpr) String ¶
func (node *CoalesceExpr) String() string
func (*CoalesceExpr) TypeCheck ¶
func (expr *CoalesceExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*CoalesceExpr) TypedExprAt ¶
func (node *CoalesceExpr) TypedExprAt(idx int) TypedExpr
TypedExprAt returns the expression at the specified index as a TypedExpr.
func (*CoalesceExpr) Walk ¶
func (expr *CoalesceExpr) Walk(v Visitor) Expr
Walk implements the Expr interface.
type CollateExpr ¶
CollateExpr represents an (expr COLLATE locale) expression.
func (*CollateExpr) Eval ¶
func (expr *CollateExpr) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*CollateExpr) Format ¶
func (node *CollateExpr) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (CollateExpr) ResolvedType ¶
func (ta CollateExpr) ResolvedType() Type
func (*CollateExpr) String ¶
func (node *CollateExpr) String() string
func (*CollateExpr) TypeCheck ¶
func (expr *CollateExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*CollateExpr) Walk ¶
func (expr *CollateExpr) Walk(v Visitor) Expr
Walk implements the Expr interface.
type CollatedStringColType ¶
CollatedStringColType represents a STRING, CHAR or VARCHAR type with a collation locale.
func (*CollatedStringColType) Format ¶
func (node *CollatedStringColType) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*CollatedStringColType) String ¶
func (node *CollatedStringColType) String() string
type CollationEnvironment ¶
type CollationEnvironment struct {
// contains filtered or unexported fields
}
CollationEnvironment stores the state needed by NewDCollatedString to construct collation keys efficiently.
type ColumnCheckConstraint ¶
type ColumnCheckConstraint struct {
Expr Expr
}
ColumnCheckConstraint represents either a check on a column.
type ColumnCollation ¶
type ColumnCollation string
ColumnCollation represents a COLLATE clause for a column.
type ColumnDefault ¶
type ColumnDefault struct {
Expr Expr
}
ColumnDefault represents a DEFAULT clause for a column.
type ColumnFKConstraint ¶
type ColumnFKConstraint struct { Table NormalizableTableName Col Name // empty-string means use PK }
ColumnFKConstraint represents a FK-constaint on a column.
type ColumnFamilyConstraint ¶
ColumnFamilyConstraint represents FAMILY on a column.
type ColumnItem ¶
type ColumnItem struct { // TableName holds the table prefix, if the name refers to a column. TableName TableName // ColumnName names the designated column. ColumnName Name // Selector defines which sub-part of the variable is being // accessed. Selector NameParts }
ColumnItem corresponds to the name of a column or sub-item of a column in an expression.
func (*ColumnItem) Column ¶
func (c *ColumnItem) Column() string
Column retrieves the unqualified column name.
func (*ColumnItem) Eval ¶
func (expr *ColumnItem) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*ColumnItem) Format ¶
func (c *ColumnItem) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*ColumnItem) NormalizeVarName ¶
func (c *ColumnItem) NormalizeVarName() (VarName, error)
NormalizeVarName is a no-op for ColumnItem (already normalized)
func (*ColumnItem) ResolvedType ¶
func (c *ColumnItem) ResolvedType() Type
ResolvedType implements the TypedExpr interface.
func (*ColumnItem) String ¶
func (c *ColumnItem) String() string
func (*ColumnItem) TypeCheck ¶
func (expr *ColumnItem) TypeCheck(_ *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface. This function has a valid implementation only for testing within this package. During query execution, ColumnItems are replaced to IndexedVars prior to type checking.
func (*ColumnItem) Variable ¶
func (c *ColumnItem) Variable()
Variable implements the VariableExpr interface. Although, the ColumnItem ought to be replaced to an IndexedVar before the points the VariableExpr interface is used.
func (*ColumnItem) Walk ¶
func (expr *ColumnItem) Walk(_ Visitor) Expr
Walk implements the Expr interface.
type ColumnMutationCmd ¶
type ColumnMutationCmd interface { AlterTableCmd GetColumn() Name }
ColumnMutationCmd is the subset of AlterTableCmds that modify an existing column.
type ColumnQualification ¶
type ColumnQualification interface {
// contains filtered or unexported methods
}
ColumnQualification represents a constraint on a column.
type ColumnTableDef ¶
type ColumnTableDef struct { Name Name Type ColumnType Nullable struct { Nullability Nullability ConstraintName Name } PrimaryKey bool Unique bool UniqueConstraintName Name DefaultExpr struct { Expr Expr ConstraintName Name } CheckExprs []ColumnTableDefCheckExpr References struct { Table NormalizableTableName Col Name ConstraintName Name } Family struct { Name Name Create bool IfNotExists bool } }
ColumnTableDef represents a column definition within a CREATE TABLE statement.
func (*ColumnTableDef) Format ¶
func (node *ColumnTableDef) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*ColumnTableDef) HasColumnFamily ¶
func (node *ColumnTableDef) HasColumnFamily() bool
HasColumnFamily returns if the ColumnTableDef has a column family.
func (*ColumnTableDef) HasDefaultExpr ¶
func (node *ColumnTableDef) HasDefaultExpr() bool
HasDefaultExpr returns if the ColumnTableDef has a default expression.
func (*ColumnTableDef) HasFKConstraint ¶
func (node *ColumnTableDef) HasFKConstraint() bool
HasFKConstraint returns if the ColumnTableDef has a foreign key constraint.
type ColumnTableDefCheckExpr ¶
ColumnTableDefCheckExpr represents a check constraint on a column definition within a CREATE TABLE statement.
type ColumnType ¶
type ColumnType interface { CastTargetType // contains filtered or unexported methods }
ColumnType represents a type in a column definition.
func DatumTypeToColumnType ¶
func DatumTypeToColumnType(t Type) (ColumnType, error)
DatumTypeToColumnType produces a SQL column type equivalent to the given Datum type. Used to generate CastExpr nodes during normalization.
type CommitTransaction ¶
type CommitTransaction struct{}
CommitTransaction represents a COMMIT statement.
func (*CommitTransaction) Format ¶
func (node *CommitTransaction) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*CommitTransaction) StatementTag ¶
func (*CommitTransaction) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*CommitTransaction) StatementType ¶
func (*CommitTransaction) StatementType() StatementType
StatementType implements the Statement interface.
func (*CommitTransaction) String ¶
func (n *CommitTransaction) String() string
type ComparisonExpr ¶
type ComparisonExpr struct { Operator ComparisonOperator SubOperator ComparisonOperator // used for array operators (when Operator is Any, Some, or All) Left, Right Expr // contains filtered or unexported fields }
ComparisonExpr represents a two-value comparison expression.
func NewTypedComparisonExpr ¶
func NewTypedComparisonExpr(op ComparisonOperator, left, right TypedExpr) *ComparisonExpr
NewTypedComparisonExpr returns a new ComparisonExpr that is verified to be well-typed.
func (*ComparisonExpr) Eval ¶
func (expr *ComparisonExpr) Eval(ctx *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*ComparisonExpr) Format ¶
func (node *ComparisonExpr) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*ComparisonExpr) IsMixedTypeComparison ¶
func (node *ComparisonExpr) IsMixedTypeComparison() bool
IsMixedTypeComparison returns true when the two sides of a comparison operator have different types.
func (ComparisonExpr) ResolvedType ¶
func (ta ComparisonExpr) ResolvedType() Type
func (*ComparisonExpr) String ¶
func (node *ComparisonExpr) String() string
func (*ComparisonExpr) TypeCheck ¶
func (expr *ComparisonExpr) TypeCheck(ctx *SemaContext, desired Type) (TypedExpr, error)
TypeCheck implements the Expr interface.
func (*ComparisonExpr) TypedLeft ¶
func (node *ComparisonExpr) TypedLeft() TypedExpr
TypedLeft returns the ComparisonExpr's left expression as a TypedExpr.
func (*ComparisonExpr) TypedRight ¶
func (node *ComparisonExpr) TypedRight() TypedExpr
TypedRight returns the ComparisonExpr's right expression as a TypedExpr.
func (*ComparisonExpr) Walk ¶
func (expr *ComparisonExpr) Walk(v Visitor) Expr
Walk implements the Expr interface.
type ComparisonOperator ¶
type ComparisonOperator int
ComparisonOperator represents a binary operator.
const ( EQ ComparisonOperator = iota LT GT LE GE NE In NotIn Like NotLike ILike NotILike SimilarTo NotSimilarTo RegMatch NotRegMatch RegIMatch NotRegIMatch IsDistinctFrom IsNotDistinctFrom Is IsNot // The following operators will always be used with an associated SubOperator. // If Go had algebraic data types they would be defined in a self-contained // manner like: // // Any(ComparisonOperator) // Some(ComparisonOperator) // ... // // where the internal ComparisonOperator qualifies the behavior of the primary // operator. Instead, a secondary ComparisonOperator is optionally included in // ComparisonExpr for the cases where these operators are the primary op. // // ComparisonOperator.hasSubOperator returns true for ops in this group. Any Some All )
ComparisonExpr.Operator
func (ComparisonOperator) String ¶
func (i ComparisonOperator) String() string
type CompositeDatum ¶
type CompositeDatum interface { Datum // IsComposite returns true if this datum is not round-tripable in a key // encoding. IsComposite() bool }
CompositeDatum is a Datum that may require composite encoding in indexes. Any Datum implementing this interface must also add itself to sqlbase/HasCompositeKeyEncoding.
type Constant ¶
type Constant interface { Expr // AvailableTypes returns the ordered set of types that the Constant is able to // be resolved into. The order of the type slice provides a notion of precedence, // with the first element in the ordering being the Constant's "natural type". AvailableTypes() []Type // ResolveAsType resolves the Constant as the Datum type specified, or returns an // error if the Constant could not be resolved as that type. The method should only // be passed a type returned from AvailableTypes and should never be called more than // once for a given Constant. ResolveAsType(*SemaContext, Type) (Datum, error) }
Constant is an constant literal expression which may be resolved to more than one type.
type ConstraintTableDef ¶
type ConstraintTableDef interface { TableDef // contains filtered or unexported methods }
ConstraintTableDef represents a constraint definition within a CREATE TABLE statement.
type ContainsWindowVisitor ¶
type ContainsWindowVisitor struct {
// contains filtered or unexported fields
}
ContainsWindowVisitor checks if walked expressions contain window functions.
func (*ContainsWindowVisitor) ContainsWindowFunc ¶
func (v *ContainsWindowVisitor) ContainsWindowFunc(expr Expr) bool
ContainsWindowFunc determines if an Expr contains a window function.
func (*ContainsWindowVisitor) VisitPost ¶
func (*ContainsWindowVisitor) VisitPost(expr Expr) Expr
VisitPost satisfies the Visitor interface.
type CopyFrom ¶
type CopyFrom struct { Table NormalizableTableName Columns UnresolvedNames Stdin bool }
CopyFrom represents a COPY FROM statement.
func (*CopyFrom) StatementTag ¶
StatementTag returns a short string identifying the type of statement.
func (*CopyFrom) StatementType ¶
func (*CopyFrom) StatementType() StatementType
StatementType implements the Statement interface.
type CreateDatabase ¶
type CreateDatabase struct { IfNotExists bool Name Name Template string Encoding string Collate string CType string }
CreateDatabase represents a CREATE DATABASE statement.
func (*CreateDatabase) Format ¶
func (node *CreateDatabase) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*CreateDatabase) StatementTag ¶
func (*CreateDatabase) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*CreateDatabase) StatementType ¶
func (*CreateDatabase) StatementType() StatementType
StatementType implements the Statement interface.
func (*CreateDatabase) String ¶
func (n *CreateDatabase) String() string
type CreateIndex ¶
type CreateIndex struct { Name Name Table NormalizableTableName Unique bool IfNotExists bool Columns IndexElemList // Extra columns to be stored together with the indexed ones as an optimization // for improved reading performance. Storing NameList Interleave *InterleaveDef }
CreateIndex represents a CREATE INDEX statement.
func (*CreateIndex) Format ¶
func (node *CreateIndex) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*CreateIndex) StatementTag ¶
func (*CreateIndex) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*CreateIndex) StatementType ¶
func (*CreateIndex) StatementType() StatementType
StatementType implements the Statement interface.
func (*CreateIndex) String ¶
func (n *CreateIndex) String() string
type CreateTable ¶
type CreateTable struct { IfNotExists bool Table NormalizableTableName Interleave *InterleaveDef Defs TableDefs AsSource *Select AsColumnNames NameList // Only to be used in conjunction with AsSource }
CreateTable represents a CREATE TABLE statement.
func (*CreateTable) As ¶
func (node *CreateTable) As() bool
As returns true if this table represents a CREATE TABLE ... AS statement, false otherwise.
func (*CreateTable) Format ¶
func (node *CreateTable) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*CreateTable) StatementTag ¶
func (n *CreateTable) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*CreateTable) StatementType ¶
func (*CreateTable) StatementType() StatementType
StatementType implements the Statement interface.
func (*CreateTable) String ¶
func (n *CreateTable) String() string
type CreateUser ¶
type CreateUser struct { Name Name Password *string // pointer so that empty and nil can be differentiated }
CreateUser represents a CREATE USER statement.
func (*CreateUser) Format ¶
func (node *CreateUser) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*CreateUser) HasPassword ¶
func (node *CreateUser) HasPassword() bool
HasPassword returns if the CreateUser has a password.
func (*CreateUser) StatementTag ¶
func (*CreateUser) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*CreateUser) StatementType ¶
func (*CreateUser) StatementType() StatementType
StatementType implements the Statement interface.
func (*CreateUser) String ¶
func (n *CreateUser) String() string
type CreateView ¶
type CreateView struct { Name NormalizableTableName ColumnNames NameList AsSource *Select }
CreateView represents a CREATE VIEW statement.
func (*CreateView) Format ¶
func (node *CreateView) Format(buf *bytes.Buffer, f FmtFlags)
Format implements the NodeFormatter interface.
func (*CreateView) StatementTag ¶
func (*CreateView) StatementTag() string
StatementTag returns a short string identifying the type of statement.
func (*CreateView) StatementType ¶
func (*CreateView) StatementType() StatementType
StatementType implements the Statement interface.
func (*CreateView) String ¶
func (n *CreateView) String() string
type DArray ¶
type DArray struct { ParamTyp Type Array Datums // HasNulls is set to true if any of the datums within the array are null. // This is used in the binary array serialization format. HasNulls bool }
DArray is the array Datum. Any Datum inserted into a DArray are treated as text during serialization.
func AsDArray ¶
AsDArray attempts to retrieve a *DArray from an Expr, returning a *DArray and a flag signifying whether the assertion was successful. The function should be used instead of direct type assertions wherever a *DArray wrapped by a *DOidWrapper is possible.
func MustBeDArray ¶
MustBeDArray attempts to retrieve a *DArray from an Expr, panicking if the assertion fails.
func (*DArray) AmbiguousFormat ¶
AmbiguousFormat implements the Datum interface.
func (*DArray) Append ¶
Append appends a Datum to the array, whose parameterized type must be consistent with the type of the Datum.
func (*DArray) Compare ¶
func (d *DArray) Compare(ctx *EvalContext, other Datum) int
Compare implements the Datum interface.
func (*DArray) Eval ¶
func (t *DArray) Eval(_ *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*DArray) ResolvedType ¶
ResolvedType implements the TypedExpr interface.
type DBool ¶
type DBool bool
DBool is the boolean Datum.
func MakeDBool ¶
MakeDBool converts its argument to a *DBool, returning either DBoolTrue or DBoolFalse.
func ParseDBool ¶
ParseDBool parses and returns the *DBool Datum value represented by the provided string, or an error if parsing is unsuccessful.
func (*DBool) AmbiguousFormat ¶
AmbiguousFormat implements the Datum interface.
func (*DBool) Compare ¶
func (d *DBool) Compare(ctx *EvalContext, other Datum) int
Compare implements the Datum interface.
func (*DBool) Eval ¶
func (t *DBool) Eval(_ *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*DBool) ResolvedType ¶
ResolvedType implements the TypedExpr interface.
type DBytes ¶
type DBytes string
DBytes is the bytes Datum. The underlying type is a string because we want the immutability, but this may contain arbitrary bytes.
func (*DBytes) AmbiguousFormat ¶
AmbiguousFormat implements the Datum interface.
func (*DBytes) Compare ¶
func (d *DBytes) Compare(ctx *EvalContext, other Datum) int
Compare implements the Datum interface.
func (*DBytes) Eval ¶
func (t *DBytes) Eval(_ *EvalContext) (Datum, error)
Eval implements the TypedExpr interface.
func (*DBytes) ResolvedType ¶
ResolvedType implements the TypedExpr interface.
type DCollatedString ¶
type DCollatedString struct { Contents string Locale string // Key is the collation key. Key []byte }
DCollatedString is the Datum for strings with a locale. The struct members are intended to be immutable.
func NewDCollatedString ¶
func NewDCollatedString( contents string, locale string, env *CollationEnvironment, ) *DCollatedString
NewDCollatedString is a helper routine to create a *DCollatedString. Panics if locale is invalid. Not safe for concurrent use.
func (*DCollatedString) AmbiguousFormat ¶
func (*DCollatedString) AmbiguousFormat() bool
AmbiguousFormat implements the Datum interface.