Documentation
¶
Overview ¶
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Copyright 2025 Supabase, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Supabase, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL AST expression node definitions. Ported from postgres/src/include/nodes/primnodes.h
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides interval-related constants. Ported from postgres/src/include/utils/datetime.h and utils/timestamp.h
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL AST node definitions and interfaces. Ported from postgres/src/include/nodes/nodes.h and related header files.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL AST parse infrastructure node definitions. This file contains core parsing infrastructure nodes essential for lexer/parser integration. Ported from postgres/src/include/nodes/parsenodes.h
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL AST query execution node definitions. These nodes are essential for basic SQL query functionality including SELECT operations, JOIN processing, subquery support, and modern SQL features like CTEs and window functions. Ported from postgres/src/include/nodes/parsenodes.h and primnodes.h
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL AST range table and FROM clause node definitions. This file contains range table infrastructure nodes essential for FROM clause and JOIN support. Ported from postgres/src/include/nodes/parsenodes.h and primnodes.h
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2026, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast: replication command nodes. Ported from postgres/src/include/nodes/replnodes.h (PG 17.6).
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL AST statement node definitions. Ported from postgres/src/include/nodes/parsenodes.h
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL AST type coercion and advanced expression node definitions. These nodes handle PostgreSQL's sophisticated type system including type casting, field access, array operations, and various test expressions. Ported from postgres/src/include/nodes/primnodes.h
PostgreSQL Database Management System (also known as Postgres, formerly known as Postgres95)
Portions Copyright (c) 2025, Supabase, Inc Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package ast provides PostgreSQL utility statement node definitions. Ported from postgres/src/include/nodes/parsenodes.h
Index ¶
- Constants
- Variables
- func BoolVal(node Node) bool
- func CloneSliceOfBool(n []bool) []bool
- func CloneSliceOfInt(n []int) []int
- func CloneSliceOfInt32(n []int32) []int32
- func CloneSliceOfString(n []string) []string
- func CountArgs(expr Node) int
- func DollarQuoteString(s string) string
- func ExtractTablesUsed(stmt Stmt) []string
- func FindNonTemporaryNonFailoverReplicationSlotCall(stmt Stmt) (string, bool)
- func FindNonTemporaryReplicationSlotCall(stmt Stmt) (string, bool)
- func FingerprintSQL(sql string) string
- func FloatVal(node Node) float64
- func FormatAlias(aliasName string) string
- func FormatColumnList(columns []string) string
- func FormatCommaList(items []string) string
- func FormatFullyQualifiedName(database, schema, name string) string
- func FormatList(elements []string, separator string) string
- func FormatOptionalClause(keyword, content string) string
- func FormatParentheses(content string) string
- func FormatQualifiedName(parts ...string) string
- func FormatSchemaQualifiedName(schema, name string) string
- func GetCaseWhenCount(expr Node) int
- func HasAggregateFilter(expr Node) bool
- func HasCaseElse(expr Node) bool
- func HasSubLinkTest(expr Node) bool
- func IntVal(node Node) int
- func IntervalMask(field int) int
- func IntervalPrecision(typmod int) int
- func IntervalRange(typmod int) int
- func IntervalTypmod(precision, rangeVal int) int
- func IsAggref(expr Node) bool
- func IsAggregate(expr Node) bool
- func IsAllowedInAbortedTransaction(stmt Stmt) bool
- func IsArrayExpr(expr Node) bool
- func IsArraySublink(expr Node) bool
- func IsBeginStatement(stmt Stmt) bool
- func IsBuiltInType(typeName string) bool
- func IsCaseExpr(expr Node) bool
- func IsCoalesceExpr(expr Node) bool
- func IsCommitStatement(stmt Stmt) bool
- func IsConstant(expr Node) bool
- func IsDistinctAggregate(expr Node) bool
- func IsExistsSublink(expr Node) bool
- func IsFunction(expr Node) bool
- func IsInExpr(expr Node) bool
- func IsKeyword(name string) bool
- func IsMultiDimArray(expr Node) bool
- func IsNode(v any) bool
- func IsNotInExpr(expr Node) bool
- func IsOrderedSetAggregate(expr Node) bool
- func IsReservedKeyword(name string) bool
- func IsRollbackStatement(stmt Stmt) bool
- func IsRowExpr(expr Node) bool
- func IsScalarArrayOpExpr(expr Node) bool
- func IsScalarSublink(expr Node) bool
- func IsSimpleWindowAgg(expr Node) bool
- func IsStarAggregate(expr Node) bool
- func IsSubLink(expr Node) bool
- func IsTableGroupDDL(stmt Stmt) bool
- func IsVariable(expr Node) bool
- func IsWindowFunc(expr Node) bool
- func KeywordNames() []string
- func KeywordNeedsFunctionQuoting(name string) bool
- func LocationOf(v any) int
- func MaxParamRef(node Node) int
- func PrintAExprConst(expr Expression) string
- func PrintAST(node Node, indent int)
- func QuoteArgLabel(name string) string
- func QuoteConfValue(value string) (string, error)
- func QuoteFunctionName(name string) string
- func QuoteIdentifier(name string) string
- func QuoteIdentifierOrOperator(name string) string
- func QuoteQualifiedIdentifier(name string) string
- func QuoteStringLiteral(value string) string
- func ReconstructSQL(normalizedAST Stmt, bindValues []*A_Const) string
- func RedactIfCredentialBearing(stmt Stmt) (redacted string, ok bool)
- func StrVal(node Node) string
- func WalkNodes(node Node, walker NodeWalker)
- type A_ArrayExpr
- type A_Const
- type A_Expr
- type A_Expr_Kind
- type A_Indices
- type A_Indirection
- type A_Star
- type AccessPriv
- type AclMode
- type AggSplit
- type Aggref
- type Alias
- type AlterCollationStmt
- type AlterCompositeTypeStmt
- type AlterDatabaseRefreshCollStmt
- type AlterDatabaseSetStmt
- type AlterDatabaseStmt
- type AlterDefaultPrivilegesStmt
- type AlterDomainStmt
- type AlterEnumStmt
- type AlterEventTrigStmt
- type AlterExtensionContentsStmt
- type AlterExtensionStmt
- type AlterFdwStmt
- type AlterForeignServerStmt
- type AlterFunctionStmt
- type AlterMigrationStmt
- type AlterObjectDependsStmt
- type AlterObjectSchemaStmt
- type AlterOpFamilyStmt
- type AlterOperatorStmt
- type AlterOwnerStmt
- type AlterPolicyStmt
- type AlterPublicationStmt
- type AlterPublicationType
- type AlterReplicationSlotCmd
- type AlterRoleSetStmt
- type AlterRoleStmt
- type AlterSeqStmt
- type AlterStatsStmt
- type AlterSubscriptionStmt
- type AlterSubscriptionType
- type AlterSystemStmt
- type AlterTSConfigType
- type AlterTSConfigurationStmt
- type AlterTSDictionaryStmt
- type AlterTableCmd
- func CloneRefOfAlterTableCmd(n *AlterTableCmd) *AlterTableCmd
- func NewAddColumnCmd(columnName string, columnDef Node) *AlterTableCmd
- func NewAddConstraintCmd(constraint *Constraint) *AlterTableCmd
- func NewAlterTableCmd(subtype AlterTableType, name string, def Node) *AlterTableCmd
- func NewDropColumnCmd(columnName string, behavior DropBehavior) *AlterTableCmd
- func NewDropConstraintCmd(constraintName string, behavior DropBehavior) *AlterTableCmd
- type AlterTableGroupAction
- type AlterTableGroupStmt
- type AlterTableMoveAllStmt
- type AlterTableSpaceStmt
- type AlterTableStmt
- type AlterTableType
- type AlterTypeStmt
- type AlterUserMappingStmt
- type AlternativeSubPlan
- type AmType
- type ApplyFunc
- type ArrayCoerceExpr
- type ArrayExpr
- type AttrNumber
- type BaseExpr
- type BaseNode
- type BitString
- type BoolExpr
- type BoolExprType
- type BoolTestType
- type Boolean
- type BooleanTest
- type CTECycleClause
- type CTEMaterialized
- type CTESearchClause
- type CallStmt
- type Cardinality
- type CaseExpr
- type CaseTestExpr
- type CaseWhen
- type CheckPointStmt
- type ClosePortalStmt
- type ClusterStmt
- type CmdType
- type CoalesceExpr
- type CoerceToDomain
- type CoerceToDomainValue
- type CoerceViaIO
- type CoercionContext
- type CoercionForm
- type CollateClause
- type CollateExpr
- type ColumnDef
- type ColumnRef
- type CommentStmt
- type CommonTableExpr
- type CompositeTypeStmt
- type Const
- type ConstrType
- type Constraint
- func CloneRefOfConstraint(n *Constraint) *Constraint
- func CloneSliceOfRefOfConstraint(n []*Constraint) []*Constraint
- func NewCheckConstraint(conname string, rawExpr Node) *Constraint
- func NewConstraint(contype ConstrType) *Constraint
- func NewForeignKeyConstraint(conname string, fkAttrs []string, pktable *RangeVar, pkAttrs []string) *Constraint
- func NewNotNullConstraint(conname string) *Constraint
- func NewPrimaryKeyConstraint(conname string, keys []string) *Constraint
- func NewUniqueConstraint(conname string, keys []string) *Constraint
- func NewUniqueConstraintNullsNotDistinct(conname string, keys []string) *Constraint
- type ConstraintsSetStmt
- type ConvertRowtypeExpr
- type CopyStmt
- type CreateAmStmt
- type CreateAssertionStmt
- type CreateCastStmt
- type CreateConnectionStmt
- type CreateConversionStmt
- type CreateDomainStmt
- type CreateEnumStmt
- type CreateEventTrigStmt
- type CreateExtensionStmt
- type CreateFdwStmt
- type CreateForeignServerStmt
- type CreateForeignTableStmt
- type CreateFunctionStmt
- type CreateMigrationStmt
- type CreateOpClassItem
- func CloneRefOfCreateOpClassItem(n *CreateOpClassItem) *CreateOpClassItem
- func NewCreateOpClassItem(itemType OpClassItemType, name *ObjectWithArgs, number int, ...) *CreateOpClassItem
- func NewOpClassItemFunction(number int, name *ObjectWithArgs, classArgs *NodeList) *CreateOpClassItem
- func NewOpClassItemOperator(number int, name *ObjectWithArgs, orderFamily *NodeList) *CreateOpClassItem
- func NewOpClassItemStorage(storedType *TypeName) *CreateOpClassItem
- type CreateOpClassStmt
- type CreateOpFamilyStmt
- type CreatePLangStmt
- type CreatePolicyStmt
- type CreatePublicationStmt
- type CreateRangeStmt
- type CreateReplicationSlotCmd
- type CreateRoleStmt
- type CreateSchemaStmt
- type CreateSeqStmt
- type CreateStatsStmt
- type CreateStmt
- type CreateSubscriptionStmt
- type CreateTableAsStmt
- type CreateTableGroupStmt
- type CreateTableSpaceStmt
- type CreateTransformStmt
- type CreateTriggerStmt
- func CloneRefOfCreateTriggerStmt(n *CreateTriggerStmt) *CreateTriggerStmt
- func NewAfterUpdateTrigger(trigname string, relation *RangeVar, funcname *NodeList) *CreateTriggerStmt
- func NewBeforeInsertTrigger(trigname string, relation *RangeVar, funcname *NodeList) *CreateTriggerStmt
- func NewConstraintTrigger(trigname string, relation *RangeVar, funcname *NodeList, timing int16, ...) *CreateTriggerStmt
- func NewCreateTriggerStmt(trigname string, relation *RangeVar, funcname *NodeList, timing int16, ...) *CreateTriggerStmt
- func NewDeferrableConstraintTrigger(trigname string, relation *RangeVar, funcname *NodeList, timing int16, ...) *CreateTriggerStmt
- type CreateUserMappingStmt
- type CreatedbStmt
- type CurrentOfExpr
- type Cursor
- type Datum
- type DeallocateStmt
- type DeclareCursorStmt
- type DefElem
- type DefElemAction
- type DefineStmt
- type DeleteStmt
- type DiscardMode
- type DiscardStmt
- type DistinctExpr
- type DoStmt
- type DropBehavior
- type DropConnectionStmt
- type DropMigrationStmt
- type DropOwnedStmt
- type DropReplicationSlotCmd
- type DropRoleStmt
- type DropStmt
- type DropTableSpaceStmt
- type DropUserMappingStmt
- type DropdbStmt
- type ExecuteStmt
- type ExplainStmt
- type Expr
- type Expression
- type FetchDirection
- type FetchStmt
- type FieldSelect
- type FieldStore
- type Float
- type FromExpr
- type FuncCall
- type FuncExpr
- type FunctionParameter
- type FunctionParameterMode
- type GrantRoleStmt
- func CloneRefOfGrantRoleStmt(n *GrantRoleStmt) *GrantRoleStmt
- func NewGrantRoleStmt(grantedRoles, granteeRoles *NodeList) *GrantRoleStmt
- func NewGrantRoleStmtWithOptions(grantedRoles, granteeRoles *NodeList, opt *NodeList) *GrantRoleStmt
- func NewRevokeRoleStmt(grantedRoles, granteeRoles *NodeList) *GrantRoleStmt
- type GrantStmt
- type GrantTargetType
- type GroupClause
- type GroupingFunc
- type GroupingSet
- type GroupingSetKind
- type Identifier
- type IdentifySystemCmd
- type ImportForeignSchemaStmt
- type ImportForeignSchemaType
- type Index
- type IndexElem
- type IndexStmt
- type InferClause
- type InferenceElem
- type InsertStmt
- type Integer
- type IntoClause
- type JoinExpr
- type JoinType
- type JsonAggConstructor
- type JsonArgument
- type JsonArrayAgg
- type JsonArrayConstructor
- type JsonArrayQueryConstructor
- type JsonBehavior
- type JsonBehaviorType
- type JsonConstructorExpr
- type JsonConstructorType
- type JsonEncoding
- type JsonExpr
- type JsonExprOp
- type JsonFormat
- type JsonFormatType
- type JsonFuncExpr
- type JsonIsPredicate
- type JsonKeyValue
- type JsonObjectAgg
- type JsonObjectConstructor
- type JsonOutput
- type JsonParseExpr
- type JsonQuotes
- type JsonReturning
- type JsonScalarExpr
- type JsonSerializeExpr
- type JsonTable
- type JsonTableColumn
- type JsonTableColumnType
- type JsonTablePath
- type JsonTablePathScan
- type JsonTablePathSpec
- type JsonTablePlan
- type JsonTableSiblingJoin
- type JsonValueExpr
- type JsonValueType
- type JsonWrapper
- type KeyAction
- type KeyActions
- type KeywordCategory
- type KeywordClass
- type LimitOption
- type ListenStmt
- type LoadStmt
- type LockClauseStrength
- type LockMode
- type LockStmt
- type LockWaitPolicy
- type LockingClause
- type MergeAction
- type MergeMatchKind
- type MergeStmt
- type MergeSupportFunc
- type MergeWhenClause
- type MigrationActionSpec
- type MigrationDirection
- type MigrationDropBehavior
- type MigrationTables
- type MinMaxExpr
- type MinMaxOp
- type MultiAssignRef
- type NamedArgExpr
- type NextValueExpr
- type Node
- func CastNode(v any) Node
- func CloneNode(in Node) Node
- func CloneSliceOfNode(n []Node) []Node
- func FindNodes(root Node, targetTag NodeTag) []Node
- func FuncCallArg(fc *FuncCall, positionalIndex int, paramName string) (arg Node, given bool)
- func GetAggregateFilter(expr Node) Node
- func GetSubLinkTest(expr Node) Node
- func GetSubquery(expr Node) Node
- func NewQualifiedName(schema, name string) Node
- func NewValue(val any) Node
- func Rewrite(node Node, pre, post ApplyFunc) (result Node)
- type NodeList
- func CloneRefOfNodeList(n *NodeList) *NodeList
- func CloneSliceOfRefOfNodeList(n []*NodeList) []*NodeList
- func ExtractArgTypes(funcArgs *NodeList) *NodeList
- func GetAggregateArgs(expr Node) *NodeList
- func GetAggregateDirectArgs(expr Node) *NodeList
- func GetAggregateOrderBy(expr Node) *NodeList
- func GetArrayElements(expr Node) *NodeList
- func GetExpressionArgs(expr Node) *NodeList
- func MergeTableFuncParameters(params *NodeList, tableCols *NodeList) *NodeList
- func NewNodeList(items ...Node) *NodeList
- type NodeTag
- type NodeWalker
- type NormalizeResult
- type NotifyStmt
- type Null
- type NullIfExpr
- type NullTest
- type NullTestType
- type ObjectType
- type ObjectWithArgs
- type Oid
- type OnCommitAction
- type OnConflictAction
- type OnConflictClause
- type OnConflictExpr
- type OpClassItemType
- type OpExpr
- type OverridingKind
- type PLAssignStmt
- type Param
- type ParamKind
- type ParamRef
- type ParenExpr
- type PartitionBoundSpec
- func CloneRefOfPartitionBoundSpec(n *PartitionBoundSpec) *PartitionBoundSpec
- func NewDefaultPartitionBound() *PartitionBoundSpec
- func NewHashPartitionBound(modulus, remainder int) *PartitionBoundSpec
- func NewListPartitionBound(listDatums *NodeList) *PartitionBoundSpec
- func NewPartitionBoundSpec(strategy PartitionStrategy) *PartitionBoundSpec
- func NewRangePartitionBound(lowDatums, highDatums *NodeList) *PartitionBoundSpec
- type PartitionCmd
- type PartitionElem
- type PartitionRangeDatum
- func CloneRefOfPartitionRangeDatum(n *PartitionRangeDatum) *PartitionRangeDatum
- func NewMaxValueDatum() *PartitionRangeDatum
- func NewMinValueDatum() *PartitionRangeDatum
- func NewPartitionRangeDatum(kind PartitionRangeDatumKind, value Node) *PartitionRangeDatum
- func NewValueDatum(value Node) *PartitionRangeDatum
- type PartitionRangeDatumKind
- type PartitionSpec
- func CloneRefOfPartitionSpec(n *PartitionSpec) *PartitionSpec
- func NewHashPartitionSpec(partParams *NodeList) *PartitionSpec
- func NewListPartitionSpec(partParams *NodeList) *PartitionSpec
- func NewPartitionSpec(strategy PartitionStrategy, partParams *NodeList) *PartitionSpec
- func NewRangePartitionSpec(partParams *NodeList) *PartitionSpec
- type PartitionStrategy
- type PrepareStmt
- type PublicationObjSpec
- func CloneRefOfPublicationObjSpec(n *PublicationObjSpec) *PublicationObjSpec
- func NewPublicationObjSpec(objType PublicationObjSpecType) *PublicationObjSpec
- func NewPublicationObjSpecName(objType PublicationObjSpecType, name string) *PublicationObjSpec
- func NewPublicationObjSpecTable(objType PublicationObjSpecType, pubTable *PublicationTable) *PublicationObjSpec
- type PublicationObjSpecType
- type PublicationTable
- type Query
- type QuerySource
- type RTEKind
- type RTEPermissionInfo
- type RangeFunction
- type RangeSubselect
- type RangeTableFunc
- type RangeTableFuncCol
- type RangeTableSample
- type RangeTblEntry
- type RangeTblFunction
- type RangeTblRef
- type RangeVar
- type RawStmt
- type ReadReplicationSlotCmd
- type ReassignOwnedStmt
- type RefreshMatViewStmt
- type ReindexObjectType
- type ReindexStmt
- func CloneRefOfReindexStmt(n *ReindexStmt) *ReindexStmt
- func NewReindexDatabaseStmt(name string) *ReindexStmt
- func NewReindexIndexStmt(relation *RangeVar) *ReindexStmt
- func NewReindexStmt(kind ReindexObjectType, relation *RangeVar, name string, params *NodeList) *ReindexStmt
- func NewReindexTableStmt(relation *RangeVar) *ReindexStmt
- type RelabelType
- func CloneRefOfRelabelType(n *RelabelType) *RelabelType
- func NewExplicitRelabelType(arg Expression, resulttype Oid) *RelabelType
- func NewImplicitRelabelType(arg Expression, resulttype Oid) *RelabelType
- func NewRelabelType(arg Expression, resulttype Oid, resulttypmod int32, relabelformat CoercionForm) *RelabelType
- type RenameStmt
- type ReplicaIdentityStmt
- type ReplicationKind
- type ResTarget
- type ReturnStmt
- type RoleSpec
- type RoleSpecType
- type RoleStatementType
- type RootNode
- type RowCompareExpr
- type RowCompareType
- type RowExpr
- type RowMarkClause
- func CloneRefOfRowMarkClause(n *RowMarkClause) *RowMarkClause
- func CloneSliceOfRefOfRowMarkClause(n []*RowMarkClause) []*RowMarkClause
- func NewRowMarkClause(rti Index, strength LockClauseStrength) *RowMarkClause
- func NewRowMarkClauseWithPolicy(rti Index, strength LockClauseStrength, waitPolicy LockWaitPolicy) *RowMarkClause
- type RowMarkType
- type RuleStmt
- type SQLValueFunction
- type SQLValueFunctionOp
- type ScalarArrayOpExpr
- func CloneRefOfScalarArrayOpExpr(n *ScalarArrayOpExpr) *ScalarArrayOpExpr
- func NewAllExpr(opno Oid, scalar Node, array Node) *ScalarArrayOpExpr
- func NewAnyExpr(opno Oid, scalar Node, array Node) *ScalarArrayOpExpr
- func NewInExpr(scalar Node, array Node) *ScalarArrayOpExpr
- func NewNotInExpr(scalar Node, array Node) *ScalarArrayOpExpr
- func NewScalarArrayOpExpr(opno Oid, useOr bool, scalar Node, array Node) *ScalarArrayOpExpr
- type SecLabelStmt
- type SelectStmt
- type SetOperation
- type SetOperationStmt
- type SetQuantifier
- type SetToDefault
- type ShowConnectionsStmt
- type SinglePartitionSpec
- type SortBy
- type SortByDir
- type SortByNulls
- type SortGroupClause
- func CloneRefOfSortGroupClause(n *SortGroupClause) *SortGroupClause
- func CloneSliceOfRefOfSortGroupClause(n []*SortGroupClause) []*SortGroupClause
- func NewSortGroupClause(tleSortGroupRef Index, eqop, sortop Oid) *SortGroupClause
- func NewSortGroupClauseNullsFirst(tleSortGroupRef Index, eqop, sortop Oid) *SortGroupClause
- type StartReplicationCmd
- type StatsElem
- type Stmt
- type String
- type SubLink
- func CloneRefOfSubLink(n *SubLink) *SubLink
- func NewArraySublink(subquery Node) *SubLink
- func NewExistsSublink(subquery Node) *SubLink
- func NewExprSublink(subquery Node) *SubLink
- func NewInSublink(testexpr Node, subquery Node) *SubLink
- func NewNotInSublink(testexpr Node, subquery Node) *SubLink
- func NewSubLink(subLinkType SubLinkType, subselect Node) *SubLink
- type SubLinkType
- type SubPlan
- type SubscriptingRef
- func CloneRefOfSubscriptingRef(n *SubscriptingRef) *SubscriptingRef
- func NewArrayAssignment(arraytype, elemtype Oid, arrayexpr, indexexpr, assignexpr Expression) *SubscriptingRef
- func NewArraySlice(arraytype, elemtype Oid, arrayexpr, lowerexpr, upperexpr Expression) *SubscriptingRef
- func NewArraySubscript(arraytype, elemtype Oid, arrayexpr, indexexpr Expression) *SubscriptingRef
- func NewSubscriptingRef(containertype, elemtype, restype Oid, refexpr Expression, ...) *SubscriptingRef
- type TableFunc
- type TableFuncType
- type TableLikeClause
- type TableLikeOption
- type TableSampleClause
- type TargetEntry
- type TimeLineID
- type TransactionStmt
- func CloneRefOfTransactionStmt(n *TransactionStmt) *TransactionStmt
- func NewBeginStmt() *TransactionStmt
- func NewCommitStmt() *TransactionStmt
- func NewReleaseStmt(name string) *TransactionStmt
- func NewRollbackStmt() *TransactionStmt
- func NewRollbackToStmt(name string) *TransactionStmt
- func NewSavepointStmt(name string) *TransactionStmt
- func NewTransactionStmt(kind TransactionStmtKind) *TransactionStmt
- type TransactionStmtKind
- type TriggerFires
- type TriggerTransition
- type TruncateStmt
- type TypeCast
- type TypeName
- type UnlistenStmt
- type UpdateStmt
- type VacuumRelation
- type VacuumStmt
- type Value
- type Var
- type VariableSetKind
- type VariableSetStmt
- type VariableShowStmt
- type ViewCheckOption
- type ViewStmt
- type WCOKind
- type WindowClause
- func CloneRefOfWindowClause(n *WindowClause) *WindowClause
- func CloneSliceOfRefOfWindowClause(n []*WindowClause) []*WindowClause
- func NewOrderedWindowClause(name string, orderClause *NodeList) *WindowClause
- func NewPartitionedWindowClause(name string, partitionClause *NodeList) *WindowClause
- func NewWindowClause(name string) *WindowClause
- type WindowDef
- type WindowFunc
- func CloneRefOfWindowFunc(n *WindowFunc) *WindowFunc
- func NewDenseRank() *WindowFunc
- func NewLag(expr Node) *WindowFunc
- func NewLead(expr Node) *WindowFunc
- func NewRank() *WindowFunc
- func NewRowNumber() *WindowFunc
- func NewWindowFunc(winfnoid Oid, wintype Oid, args *NodeList, winref Index) *WindowFunc
- type WindowFuncRunCondition
- type WithCheckOption
- type WithClause
- type XLogRecPtr
- type XmlExpr
- type XmlExprOp
- type XmlOptionType
- type XmlSerialize
- type XmlStandaloneType
Constants ¶
const ( TRIGGER_TYPE_INSERT = 1 << 0 // INSERT trigger TRIGGER_TYPE_UPDATE = 1 << 1 // UPDATE trigger TRIGGER_TYPE_DELETE = 1 << 2 // DELETE trigger TRIGGER_TYPE_TRUNCATE = 1 << 3 // TRUNCATE trigger )
TriggerType represents trigger event types.
const ( TRIGGER_TIMING_BEFORE = 1 // BEFORE trigger TRIGGER_TIMING_AFTER = 2 // AFTER trigger TRIGGER_TIMING_INSTEAD = 3 // INSTEAD OF trigger )
TriggerTiming represents trigger timing.
const ( CURSOR_OPT_BINARY = 0x0001 // BINARY CURSOR_OPT_SCROLL = 0x0002 // SCROLL explicitly given CURSOR_OPT_NO_SCROLL = 0x0004 // NO SCROLL explicitly given CURSOR_OPT_INSENSITIVE = 0x0008 // INSENSITIVE CURSOR_OPT_ASENSITIVE = 0x0010 // ASENSITIVE CURSOR_OPT_HOLD = 0x0020 // WITH HOLD CURSOR_OPT_FAST_PLAN = 0x0100 // prefer fast-start plan CURSOR_OPT_GENERIC_PLAN = 0x0200 // force use of generic plan CURSOR_OPT_CUSTOM_PLAN = 0x0400 // force use of custom plan CURSOR_OPT_PARALLEL_OK = 0x0800 // parallel mode OK )
Cursor option constants Ported from postgres/src/include/nodes/parsenodes.h:3275-3291
const ( ATTRIBUTE_IDENTITY_ALWAYS byte = 'a' // GENERATED ALWAYS AS IDENTITY ATTRIBUTE_IDENTITY_BY_DEFAULT byte = 'd' // GENERATED BY DEFAULT AS IDENTITY )
Identity generation constants - ported from postgres/src/include/catalog/pg_attribute.h:233-234
const ( CAS_NOT_DEFERRABLE int = 0x01 CAS_DEFERRABLE int = 0x02 CAS_INITIALLY_IMMEDIATE int = 0x04 CAS_INITIALLY_DEFERRED int = 0x08 CAS_NOT_VALID int = 0x10 CAS_NO_INHERIT int = 0x20 )
Constraint Attribute Specification (CAS) bitmask constants Ported from postgres/src/include/parser/parse_node.h:46-52
const ( FKCONSTR_MATCH_FULL byte = 'f' // MATCH FULL FKCONSTR_MATCH_PARTIAL byte = 'p' // MATCH PARTIAL FKCONSTR_MATCH_SIMPLE byte = 's' // MATCH SIMPLE (default) )
Foreign Key Constraint Match Types Ported from postgres/src/include/nodes/parsenodes.h:2665-2667
const ( REPLICA_IDENTITY_DEFAULT rune = 'd' // Use primary key REPLICA_IDENTITY_NOTHING rune = 'n' // No replica identity REPLICA_IDENTITY_FULL rune = 'f' // Full row is replica identity REPLICA_IDENTITY_INDEX rune = 'i' // Use specific index )
Replica Identity Types Ported from postgres/src/include/catalog/pg_class.h
const ( FKCONSTR_ACTION_NOACTION byte = 'a' // NO ACTION FKCONSTR_ACTION_RESTRICT byte = 'r' // RESTRICT FKCONSTR_ACTION_CASCADE byte = 'c' // CASCADE FKCONSTR_ACTION_SETNULL byte = 'n' // SET NULL FKCONSTR_ACTION_SETDEFAULT byte = 'd' // SET DEFAULT )
Foreign Key Constraint Action Types Ported from postgres/src/include/nodes/parsenodes.h:2670-2674
const ( RESERV = 0 // Reserved MONTH = 1 // Month field YEAR = 2 // Year field DAY = 3 // Day field JULIAN = 4 // Julian day TZ = 5 // Fixed-offset timezone abbreviation DTZ = 6 // Fixed-offset timezone abbrev, DST DYNTZ = 7 // Dynamic timezone abbreviation IGNORE_DTF = 8 // Ignore DTF AMPM = 9 // AM/PM indicator HOUR = 10 // Hour field MINUTE = 11 // Minute field SECOND = 12 // Second field MILLISECOND = 13 // Millisecond field MICROSECOND = 14 // Microsecond field DOY = 15 // Day of year DOW = 16 // Day of week UNITS = 17 // Units ADBC = 18 // AD/BC indicator // These are only for relative dates AGO = 19 // Ago modifier ABS_BEFORE = 20 // Absolute before ABS_AFTER = 21 // Absolute after // Generic fields to help with parsing ISODATE = 22 // ISO date format ISOTIME = 23 // ISO time format // These are only for parsing intervals WEEK = 24 // Week field DECADE = 25 // Decade field CENTURY = 26 // Century field )
Interval field constants - ported from postgres/src/include/utils/datetime.h:91-102 These represent the different date/time fields that can be used in INTERVAL expressions
const ( INTERVAL_FULL_RANGE = 0x7FFF // Full range mask INTERVAL_RANGE_MASK = 0x7FFF // Range mask for extracting range INTERVAL_FULL_PRECISION = 0xFFFF // Full precision mask INTERVAL_PRECISION_MASK = 0xFFFF // Precision mask for extracting precision )
Interval range and precision constants Ported from postgres/src/include/utils/timestamp.h:76-82
const ( BOOLOID = pgoid.BOOLOID // bool BYTEAOID = pgoid.BYTEAOID // bytea CHAROID = pgoid.CHAROID // char NAMEOID = pgoid.NAMEOID // name INT8OID = pgoid.INT8OID // int8 INT2OID = pgoid.INT2OID // int2 INT2VECTOROID = pgoid.INT2VECTOROID // int2vector INT4OID = pgoid.INT4OID // int4 REGPROCOID = pgoid.REGPROCOID // regproc TEXTOID = pgoid.TEXTOID // text OIDOID = pgoid.OIDOID // oid TIDOID = pgoid.TIDOID // tid XIDOID = pgoid.XIDOID // xid CIDOID = pgoid.CIDOID // cid OIDVECTOROID = pgoid.OIDVECTOROID // oidvector PG_DDL_COMMANDOID = pgoid.PG_DDL_COMMANDOID // pg_ddl_command JSONOID = pgoid.JSONOID // json XMLOID = pgoid.XMLOID // xml XMLARRAYOID = pgoid.XMLARRAYOID // _xml PG_NODE_TREEOID = pgoid.PG_NODE_TREEOID // pg_node_tree JSONARRAYOID = pgoid.JSONARRAYOID // _json PG_TYPEARRAYOID = pgoid.PG_TYPEARRAYOID // _pg_type TABLE_AM_HANDLEROID = pgoid.TABLE_AM_HANDLEROID // table_am_handler PG_ATTRIBUTEARRAYOID = pgoid.PG_ATTRIBUTEARRAYOID // _pg_attribute XID8ARRAYOID = pgoid.XID8ARRAYOID // _xid8 PG_PROCARRAYOID = pgoid.PG_PROCARRAYOID // _pg_proc PG_CLASSARRAYOID = pgoid.PG_CLASSARRAYOID // _pg_class INDEX_AM_HANDLEROID = pgoid.INDEX_AM_HANDLEROID // index_am_handler POINTOID = pgoid.POINTOID // point LSEGOID = pgoid.LSEGOID // lseg PATHOID = pgoid.PATHOID // path BOXOID = pgoid.BOXOID // box POLYGONOID = pgoid.POLYGONOID // polygon LINEOID = pgoid.LINEOID // line LINEARRAYOID = pgoid.LINEARRAYOID // _line CIDROID = pgoid.CIDROID // cidr CIDRARRAYOID = pgoid.CIDRARRAYOID // _cidr FLOAT4OID = pgoid.FLOAT4OID // float4 FLOAT8OID = pgoid.FLOAT8OID // float8 UNKNOWNOID = pgoid.UNKNOWNOID // unknown CIRCLEOID = pgoid.CIRCLEOID // circle CIRCLEARRAYOID = pgoid.CIRCLEARRAYOID // _circle MACADDR8OID = pgoid.MACADDR8OID // macaddr8 MACADDR8ARRAYOID = pgoid.MACADDR8ARRAYOID // _macaddr8 MONEYOID = pgoid.MONEYOID // money MONEYARRAYOID = pgoid.MONEYARRAYOID // _money MACADDROID = pgoid.MACADDROID // macaddr INETOID = pgoid.INETOID // inet BOOLARRAYOID = pgoid.BOOLARRAYOID // _bool BYTEAARRAYOID = pgoid.BYTEAARRAYOID // _bytea CHARARRAYOID = pgoid.CHARARRAYOID // _char NAMEARRAYOID = pgoid.NAMEARRAYOID // _name INT2ARRAYOID = pgoid.INT2ARRAYOID // _int2 INT2VECTORARRAYOID = pgoid.INT2VECTORARRAYOID // _int2vector INT4ARRAYOID = pgoid.INT4ARRAYOID // _int4 REGPROCARRAYOID = pgoid.REGPROCARRAYOID // _regproc TEXTARRAYOID = pgoid.TEXTARRAYOID // _text TIDARRAYOID = pgoid.TIDARRAYOID // _tid XIDARRAYOID = pgoid.XIDARRAYOID // _xid CIDARRAYOID = pgoid.CIDARRAYOID // _cid OIDVECTORARRAYOID = pgoid.OIDVECTORARRAYOID // _oidvector BPCHARARRAYOID = pgoid.BPCHARARRAYOID // _bpchar VARCHARARRAYOID = pgoid.VARCHARARRAYOID // _varchar INT8ARRAYOID = pgoid.INT8ARRAYOID // _int8 POINTARRAYOID = pgoid.POINTARRAYOID // _point LSEGARRAYOID = pgoid.LSEGARRAYOID // _lseg PATHARRAYOID = pgoid.PATHARRAYOID // _path BOXARRAYOID = pgoid.BOXARRAYOID // _box FLOAT4ARRAYOID = pgoid.FLOAT4ARRAYOID // _float4 FLOAT8ARRAYOID = pgoid.FLOAT8ARRAYOID // _float8 POLYGONARRAYOID = pgoid.POLYGONARRAYOID // _polygon OIDARRAYOID = pgoid.OIDARRAYOID // _oid ACLITEMOID = pgoid.ACLITEMOID // aclitem ACLITEMARRAYOID = pgoid.ACLITEMARRAYOID // _aclitem MACADDRARRAYOID = pgoid.MACADDRARRAYOID // _macaddr INETARRAYOID = pgoid.INETARRAYOID // _inet BPCHAROID = pgoid.BPCHAROID // bpchar VARCHAROID = pgoid.VARCHAROID // varchar DATEOID = pgoid.DATEOID // date TIMEOID = pgoid.TIMEOID // time TIMESTAMPOID = pgoid.TIMESTAMPOID // timestamp TIMESTAMPARRAYOID = pgoid.TIMESTAMPARRAYOID // _timestamp DATEARRAYOID = pgoid.DATEARRAYOID // _date TIMEARRAYOID = pgoid.TIMEARRAYOID // _time TIMESTAMPTZOID = pgoid.TIMESTAMPTZOID // timestamptz TIMESTAMPTZARRAYOID = pgoid.TIMESTAMPTZARRAYOID // _timestamptz INTERVALOID = pgoid.INTERVALOID // interval INTERVALARRAYOID = pgoid.INTERVALARRAYOID // _interval NUMERICARRAYOID = pgoid.NUMERICARRAYOID // _numeric CSTRINGARRAYOID = pgoid.CSTRINGARRAYOID // _cstring TIMETZOID = pgoid.TIMETZOID // timetz TIMETZARRAYOID = pgoid.TIMETZARRAYOID // _timetz BITOID = pgoid.BITOID // bit BITARRAYOID = pgoid.BITARRAYOID // _bit VARBITOID = pgoid.VARBITOID // varbit VARBITARRAYOID = pgoid.VARBITARRAYOID // _varbit NUMERICOID = pgoid.NUMERICOID // numeric REFCURSOROID = pgoid.REFCURSOROID // refcursor REFCURSORARRAYOID = pgoid.REFCURSORARRAYOID // _refcursor REGPROCEDUREOID = pgoid.REGPROCEDUREOID // regprocedure REGOPEROID = pgoid.REGOPEROID // regoper REGOPERATOROID = pgoid.REGOPERATOROID // regoperator REGCLASSOID = pgoid.REGCLASSOID // regclass REGTYPEOID = pgoid.REGTYPEOID // regtype REGPROCEDUREARRAYOID = pgoid.REGPROCEDUREARRAYOID // _regprocedure REGOPERARRAYOID = pgoid.REGOPERARRAYOID // _regoper REGOPERATORARRAYOID = pgoid.REGOPERATORARRAYOID // _regoperator REGCLASSARRAYOID = pgoid.REGCLASSARRAYOID // _regclass REGTYPEARRAYOID = pgoid.REGTYPEARRAYOID // _regtype RECORDOID = pgoid.RECORDOID // record CSTRINGOID = pgoid.CSTRINGOID // cstring ANYOID = pgoid.ANYOID // any ANYARRAYOID = pgoid.ANYARRAYOID // anyarray VOIDOID = pgoid.VOIDOID // void TRIGGEROID = pgoid.TRIGGEROID // trigger LANGUAGE_HANDLEROID = pgoid.LANGUAGE_HANDLEROID // language_handler INTERNALOID = pgoid.INTERNALOID // internal ANYELEMENTOID = pgoid.ANYELEMENTOID // anyelement RECORDARRAYOID = pgoid.RECORDARRAYOID // _record ANYNONARRAYOID = pgoid.ANYNONARRAYOID // anynonarray TXID_SNAPSHOTARRAYOID = pgoid.TXID_SNAPSHOTARRAYOID // _txid_snapshot UUIDOID = pgoid.UUIDOID // uuid UUIDARRAYOID = pgoid.UUIDARRAYOID // _uuid TXID_SNAPSHOTOID = pgoid.TXID_SNAPSHOTOID // txid_snapshot FDW_HANDLEROID = pgoid.FDW_HANDLEROID // fdw_handler PG_LSNOID = pgoid.PG_LSNOID // pg_lsn PG_LSNARRAYOID = pgoid.PG_LSNARRAYOID // _pg_lsn TSM_HANDLEROID = pgoid.TSM_HANDLEROID // tsm_handler PG_NDISTINCTOID = pgoid.PG_NDISTINCTOID // pg_ndistinct PG_DEPENDENCIESOID = pgoid.PG_DEPENDENCIESOID // pg_dependencies ANYENUMOID = pgoid.ANYENUMOID // anyenum TSVECTOROID = pgoid.TSVECTOROID // tsvector TSQUERYOID = pgoid.TSQUERYOID // tsquery GTSVECTOROID = pgoid.GTSVECTOROID // gtsvector TSVECTORARRAYOID = pgoid.TSVECTORARRAYOID // _tsvector GTSVECTORARRAYOID = pgoid.GTSVECTORARRAYOID // _gtsvector TSQUERYARRAYOID = pgoid.TSQUERYARRAYOID // _tsquery REGCONFIGOID = pgoid.REGCONFIGOID // regconfig REGCONFIGARRAYOID = pgoid.REGCONFIGARRAYOID // _regconfig REGDICTIONARYOID = pgoid.REGDICTIONARYOID // regdictionary REGDICTIONARYARRAYOID = pgoid.REGDICTIONARYARRAYOID // _regdictionary JSONBOID = pgoid.JSONBOID // jsonb JSONBARRAYOID = pgoid.JSONBARRAYOID // _jsonb ANYRANGEOID = pgoid.ANYRANGEOID // anyrange EVENT_TRIGGEROID = pgoid.EVENT_TRIGGEROID // event_trigger INT4RANGEOID = pgoid.INT4RANGEOID // int4range INT4RANGEARRAYOID = pgoid.INT4RANGEARRAYOID // _int4range NUMRANGEOID = pgoid.NUMRANGEOID // numrange NUMRANGEARRAYOID = pgoid.NUMRANGEARRAYOID // _numrange TSRANGEOID = pgoid.TSRANGEOID // tsrange TSRANGEARRAYOID = pgoid.TSRANGEARRAYOID // _tsrange TSTZRANGEOID = pgoid.TSTZRANGEOID // tstzrange TSTZRANGEARRAYOID = pgoid.TSTZRANGEARRAYOID // _tstzrange DATERANGEOID = pgoid.DATERANGEOID // daterange DATERANGEARRAYOID = pgoid.DATERANGEARRAYOID // _daterange INT8RANGEOID = pgoid.INT8RANGEOID // int8range INT8RANGEARRAYOID = pgoid.INT8RANGEARRAYOID // _int8range JSONPATHOID = pgoid.JSONPATHOID // jsonpath JSONPATHARRAYOID = pgoid.JSONPATHARRAYOID // _jsonpath REGNAMESPACEOID = pgoid.REGNAMESPACEOID // regnamespace REGNAMESPACEARRAYOID = pgoid.REGNAMESPACEARRAYOID // _regnamespace REGROLEOID = pgoid.REGROLEOID // regrole REGROLEARRAYOID = pgoid.REGROLEARRAYOID // _regrole REGCOLLATIONOID = pgoid.REGCOLLATIONOID // regcollation REGCOLLATIONARRAYOID = pgoid.REGCOLLATIONARRAYOID // _regcollation INT4MULTIRANGEOID = pgoid.INT4MULTIRANGEOID // int4multirange NUMMULTIRANGEOID = pgoid.NUMMULTIRANGEOID // nummultirange TSMULTIRANGEOID = pgoid.TSMULTIRANGEOID // tsmultirange TSTZMULTIRANGEOID = pgoid.TSTZMULTIRANGEOID // tstzmultirange DATEMULTIRANGEOID = pgoid.DATEMULTIRANGEOID // datemultirange INT8MULTIRANGEOID = pgoid.INT8MULTIRANGEOID // int8multirange ANYMULTIRANGEOID = pgoid.ANYMULTIRANGEOID // anymultirange ANYCOMPATIBLEMULTIRANGEOID = pgoid.ANYCOMPATIBLEMULTIRANGEOID // anycompatiblemultirange PG_BRIN_BLOOM_SUMMARYOID = pgoid.PG_BRIN_BLOOM_SUMMARYOID // pg_brin_bloom_summary PG_BRIN_MINMAX_MULTI_SUMMARYOID = pgoid.PG_BRIN_MINMAX_MULTI_SUMMARYOID // pg_brin_minmax_multi_summary PG_MCV_LISTOID = pgoid.PG_MCV_LISTOID // pg_mcv_list PG_SNAPSHOTOID = pgoid.PG_SNAPSHOTOID // pg_snapshot PG_SNAPSHOTARRAYOID = pgoid.PG_SNAPSHOTARRAYOID // _pg_snapshot XID8OID = pgoid.XID8OID // xid8 ANYCOMPATIBLEOID = pgoid.ANYCOMPATIBLEOID // anycompatible ANYCOMPATIBLEARRAYOID = pgoid.ANYCOMPATIBLEARRAYOID // anycompatiblearray ANYCOMPATIBLENONARRAYOID = pgoid.ANYCOMPATIBLENONARRAYOID // anycompatiblenonarray ANYCOMPATIBLERANGEOID = pgoid.ANYCOMPATIBLERANGEOID // anycompatiblerange INT4MULTIRANGEARRAYOID = pgoid.INT4MULTIRANGEARRAYOID // _int4multirange NUMMULTIRANGEARRAYOID = pgoid.NUMMULTIRANGEARRAYOID // _nummultirange TSMULTIRANGEARRAYOID = pgoid.TSMULTIRANGEARRAYOID // _tsmultirange TSTZMULTIRANGEARRAYOID = pgoid.TSTZMULTIRANGEARRAYOID // _tstzmultirange DATEMULTIRANGEARRAYOID = pgoid.DATEMULTIRANGEARRAYOID // _datemultirange INT8MULTIRANGEARRAYOID = pgoid.INT8MULTIRANGEARRAYOID // _int8multirange CASHOID = pgoid.CASHOID LSNOID = pgoid.LSNOID )
Builtin type OID constants, re-exported from pgoid (the canonical, generated home) for existing call sites.
const ( TextFormat = 0 BinaryFormat = 1 )
Format codes for parameter encoding
const ( FRAMEOPTION_NONDEFAULT = 0x00001 // any specified? FRAMEOPTION_RANGE = 0x00002 // RANGE behavior FRAMEOPTION_ROWS = 0x00004 // ROWS behavior FRAMEOPTION_GROUPS = 0x00008 // GROUPS behavior FRAMEOPTION_BETWEEN = 0x00010 // BETWEEN given? FRAMEOPTION_START_UNBOUNDED_PRECEDING = 0x00020 // start is UNBOUNDED PRECEDING FRAMEOPTION_END_UNBOUNDED_PRECEDING = 0x00040 // (disallowed) FRAMEOPTION_START_UNBOUNDED_FOLLOWING = 0x00080 // (disallowed) FRAMEOPTION_END_UNBOUNDED_FOLLOWING = 0x00100 // end is UNBOUNDED FOLLOWING FRAMEOPTION_START_CURRENT_ROW = 0x00200 // start is CURRENT ROW FRAMEOPTION_END_CURRENT_ROW = 0x00400 // end is CURRENT ROW FRAMEOPTION_START_OFFSET_PRECEDING = 0x00800 // start is OFFSET PRECEDING FRAMEOPTION_END_OFFSET_PRECEDING = 0x01000 // end is OFFSET PRECEDING FRAMEOPTION_START_OFFSET_FOLLOWING = 0x02000 // start is OFFSET FOLLOWING FRAMEOPTION_END_OFFSET_FOLLOWING = 0x04000 // end is OFFSET FOLLOWING FRAMEOPTION_EXCLUDE_CURRENT_ROW = 0x08000 // omit current row FRAMEOPTION_EXCLUDE_GROUP = 0x10000 // omit current row & peers FRAMEOPTION_EXCLUDE_TIES = 0x20000 // omit current row's peers // Compound options - postgres/src/include/nodes/parsenodes.h:600 FRAMEOPTION_START_OFFSET = FRAMEOPTION_START_OFFSET_PRECEDING | FRAMEOPTION_START_OFFSET_FOLLOWING FRAMEOPTION_END_OFFSET = FRAMEOPTION_END_OFFSET_PRECEDING | FRAMEOPTION_END_OFFSET_FOLLOWING FRAMEOPTION_DEFAULTS = FRAMEOPTION_RANGE | FRAMEOPTION_START_UNBOUNDED_PRECEDING | FRAMEOPTION_END_CURRENT_ROW )
Frame option constants for WindowDef FrameOptions field. Ported from postgres/src/include/nodes/parsenodes.h:581-605
const ( ReplicationSlotTemporaryParamName = "temporary" ReplicationSlotFailoverParamName = "failover" )
ReplicationSlotTemporaryParamName and ReplicationSlotFailoverParamName are the pg_create_*_replication_slot builtins' parameter names, for resolving a call that passes the argument by name (temporary => true) rather than position. Both builtins name their temporary parameter "temporary"; only the logical one has "failover".
const ( RELPERSISTENCE_PERMANENT rune = 'p' // Regular table - primnodes.h:89 RELPERSISTENCE_UNLOGGED rune = 'u' // Unlogged table - primnodes.h:90 RELPERSISTENCE_TEMP rune = 't' // Temporary table - primnodes.h:91 )
RelPersistence represents table persistence types. Ported from postgres/src/include/nodes/primnodes.h:87
const FETCH_ALL = 9223372036854775807 // LONG_MAX
FETCH_ALL constant for fetching all rows Ported from postgres/src/include/nodes/parsenodes.h:3326
const InvalidOid = pgoid.InvalidOid
InvalidOid represents an invalid object identifier.
Variables ¶
var ( INTERVAL_MASK_YEAR = IntervalMask(YEAR) // 1 << 2 = 4 INTERVAL_MASK_MONTH = IntervalMask(MONTH) // 1 << 1 = 2 INTERVAL_MASK_DAY = IntervalMask(DAY) // 1 << 3 = 8 INTERVAL_MASK_HOUR = IntervalMask(HOUR) // 1 << 10 = 1024 INTERVAL_MASK_MINUTE = IntervalMask(MINUTE) // 1 << 11 = 2048 INTERVAL_MASK_SECOND = IntervalMask(SECOND) // 1 << 12 = 4096 )
Common interval mask combinations for convenience
var ReplicationSlotFuncFailoverArgIndex = map[string]int{
"pg_create_logical_replication_slot": 4,
}
ReplicationSlotFuncFailoverArgIndex maps the logical slot builtin to the zero-based index of its `failover` parameter:
pg_create_logical_replication_slot(slot_name, plugin, temporary DEFAULT false, twophase DEFAULT false, failover DEFAULT false)
Only the logical function has one — a physical slot cannot be a logical failover slot — so the physical builtin is deliberately absent.
var ReplicationSlotFuncTemporaryArgIndex = map[string]int{
"pg_create_physical_replication_slot": 2,
"pg_create_logical_replication_slot": 2,
}
ReplicationSlotFuncTemporaryArgIndex maps the pg_create_*_replication_slot builtins to the zero-based argument index of their `temporary` parameter:
pg_create_physical_replication_slot(slot_name, immediately_reserve DEFAULT false, temporary DEFAULT false) pg_create_logical_replication_slot(slot_name, plugin, temporary DEFAULT false, twophase DEFAULT false)
This is the single source of truth for both enforcement points that reject non-temporary replication slot creation: the planner's function-call check (go/services/multigateway/planner/unsafe_funccall.go) and FindNonTemporaryReplicationSlotCall below, used by the multigateway replication preamble to catch these calls when they arrive as arbitrary SQL over a replication=database connection. The two call sites can't share more than this map — the planner imports the handler package (for gateway-managed-variable lookups), so the handler can't import the planner back without an import cycle.
Functions ¶
func CloneSliceOfBool ¶
CloneSliceOfBool creates a deep clone of the input.
func CloneSliceOfInt ¶
CloneSliceOfInt creates a deep clone of the input.
func CloneSliceOfInt32 ¶
CloneSliceOfInt32 creates a deep clone of the input.
func CloneSliceOfString ¶
CloneSliceOfString creates a deep clone of the input.
func DollarQuoteString ¶
DollarQuoteString wraps a string in dollar quotes, choosing a tag that doesn't conflict with the content
func ExtractTablesUsed ¶
ExtractTablesUsed walks the AST and returns deduplicated, schema-qualified table names from all RangeVar nodes. CTE names are excluded since they are virtual tables, not real ones. Returns nil for statements that don't reference tables (SET, SHOW, BEGIN, etc.).
func FindNonTemporaryNonFailoverReplicationSlotCall ¶
FindNonTemporaryNonFailoverReplicationSlotCall is like FindNonTemporaryReplicationSlotCall but additionally admits a non-temporary logical slot created with `failover => true`. Such a slot is safe to keep persistently because multigres syncs it to the standbys and can transition it across a primary failover. It returns the name of a replication-slot- creating call that is neither temporary nor an admissible failover slot, or ("", false) if none. Used by the multigateway replication preamble once the slot-based-replication feature is enabled.
func FindNonTemporaryReplicationSlotCall ¶
FindNonTemporaryReplicationSlotCall walks stmt for a call to one of ReplicationSlotFuncTemporaryArgIndex's functions whose `temporary` argument is missing, non-literal, or false, and returns that function's name. Returns ("", false) if stmt contains no such call. Fails closed, matching the planner's own check: a missing, bound, or non-literal argument is treated the same as an explicit `false`.
func FingerprintSQL ¶
FingerprintSQL returns a stable 16-character hex hash of the given SQL string. Useful for callers that already have a normalized or placeholder-form SQL (e.g. extended-protocol queries whose Parse text already contains $N placeholders) and don't need to run the normalizer.
func FormatAlias ¶
FormatAlias formats an alias clause (AS alias_name)
func FormatColumnList ¶
FormatColumnList formats a list of column names for SQL
func FormatCommaList ¶
FormatCommaList formats a list with commas and proper spacing
func FormatFullyQualifiedName ¶
FormatFullyQualifiedName formats database.schema.name or shorter versions
func FormatList ¶
FormatList formats a list of SQL elements with separators
func FormatOptionalClause ¶
FormatOptionalClause formats an optional SQL clause with keyword
func FormatParentheses ¶
FormatParentheses wraps content in parentheses if not empty
func FormatQualifiedName ¶
FormatQualifiedName formats a qualified name (e.g., schema.table, database.schema.table)
func FormatSchemaQualifiedName ¶
FormatSchemaQualifiedName formats schema.name or just name
func GetCaseWhenCount ¶
GetCaseWhenCount returns the number of WHEN clauses in a CASE expression.
func HasAggregateFilter ¶
HasAggregateFilter checks if an aggregate expression has a FILTER clause.
func HasCaseElse ¶
HasCaseElse checks if a CASE expression has an ELSE clause.
func HasSubLinkTest ¶
HasSubLinkTest checks if a SubLink has a test expression.
func IntervalMask ¶
IntervalMask returns the bit mask for an interval field Ported from postgres/src/include/utils/timestamp.h:73
func IntervalPrecision ¶
IntervalPrecision extracts precision from typmod Ported from postgres/src/include/utils/timestamp.h:81
func IntervalRange ¶
IntervalRange extracts range from typmod Ported from postgres/src/include/utils/timestamp.h:82
func IntervalTypmod ¶
IntervalTypmod creates a typmod value from precision and range Ported from postgres/src/include/utils/timestamp.h:80
func IsAggregate ¶
IsAggregate checks if an expression is any kind of aggregate (Aggref or WindowFunc with winagg=true).
func IsAllowedInAbortedTransaction ¶
IsAllowedInAbortedTransaction returns true if the statement may proceed when the transaction is in the aborted (failed) state. PostgreSQL allows ROLLBACK, ROLLBACK TO SAVEPOINT, and COMMIT (which it converts to ROLLBACK with a WARNING) in this state. PREPARE TRANSACTION is also admitted so the gateway's PREPARE primitive can forward the backend error and clean up the reserved transaction state when PostgreSQL has already aborted the transaction before PREPARE reaches the backend.
func IsArrayExpr ¶
IsArrayExpr checks if an expression is an ARRAY constructor.
func IsArraySublink ¶
IsArraySublink checks if an expression is an ARRAY sublink.
func IsBeginStatement ¶
IsBeginStatement returns true if the statement is a BEGIN or START TRANSACTION.
func IsBuiltInType ¶
IsBuiltInType checks if a type name is a built-in PostgreSQL type. These are the keyword types the deparser renders with bespoke syntax (interval-field masks, char/varchar length, the one-byte "char" type) rather than as plain quoted identifiers.
func IsCaseExpr ¶
IsCaseExpr checks if an expression is a CASE expression.
func IsCoalesceExpr ¶
IsCoalesceExpr checks if an expression is a COALESCE expression.
func IsCommitStatement ¶
IsCommitStatement returns true if the statement is a COMMIT.
func IsConstant ¶
IsConstant checks if an expression is a constant value.
func IsDistinctAggregate ¶
IsDistinctAggregate checks if an aggregate has DISTINCT.
func IsExistsSublink ¶
IsExistsSublink checks if an expression is an EXISTS sublink.
func IsFunction ¶
IsFunction checks if an expression is a function call.
func IsMultiDimArray ¶
IsMultiDimArray checks if an array expression is multi-dimensional.
func IsNotInExpr ¶
IsNotInExpr checks if an expression is a NOT IN operation (scalar <> ALL(array)).
func IsOrderedSetAggregate ¶
IsOrderedSetAggregate checks if an aggregate is an ordered-set aggregate.
func IsReservedKeyword ¶
IsReservedKeyword reports whether name (lower case) is a reserved keyword.
func IsRollbackStatement ¶
IsRollbackStatement returns true if the statement is a ROLLBACK. Note: This does not include ROLLBACK TO SAVEPOINT.
func IsScalarArrayOpExpr ¶
IsScalarArrayOpExpr checks if an expression is a scalar array operation.
func IsScalarSublink ¶
IsScalarSublink checks if an expression is a scalar sublink (EXPR_SUBLINK).
func IsSimpleWindowAgg ¶
IsSimpleWindowAgg checks if a WindowFunc is a simple aggregate.
func IsStarAggregate ¶
IsStarAggregate checks if an aggregate uses * (like COUNT(*)).
func IsTableGroupDDL ¶
IsTableGroupDDL reports whether stmt is a CREATE, ALTER or DROP TABLEGROUP. The gateway uses this to reject such statements until they are implemented, instead of forwarding them to postgres where they would fail with a syntax error.
func IsVariable ¶
IsVariable checks if an expression is a variable reference.
func IsWindowFunc ¶
IsWindowFunc checks if an expression is a window function call.
func KeywordNames ¶
func KeywordNames() []string
KeywordNames returns every keyword name (unsorted). Used to guard the parser token table against drifting from this classification.
func KeywordNeedsFunctionQuoting ¶
KeywordNeedsFunctionQuoting reports whether name (lower case) must be quoted when emitted as a bare function name. Exported for the parser-package guard test, which verifies each such keyword really would be mis-parsed bare.
func LocationOf ¶
LocationOf returns the location of a node, or -1 if not a node or no location.
func MaxParamRef ¶
MaxParamRef returns the highest parameter number ($N) referenced anywhere in node, or 0 if it contains no ParamRef. Callers use it to allocate fresh synthetic parameter slots numbered past every existing bind, so they cannot collide with a real one.
func PrintAExprConst ¶
func PrintAExprConst(expr Expression) string
printAExprConst formats an expression using the appropriate syntax for constants. For TypeCast expressions, it uses the 'type value' syntax instead of 'CAST(value AS type)'. For all other expressions, it uses the standard SqlString() method.
func QuoteArgLabel ¶
QuoteArgLabel quotes name for use as a named-argument label in deparsed SQL. It applies the same special-character and case rules as QuoteIdentifier, but quotes a broader set of keywords (see argLabelKeywordNeedsQuoting): the col_name keywords, which are valid bare as a column name but not as an argument label. Left unquoted, the backend rejects the call with "syntax error at or near =>".
func QuoteConfValue ¶
QuoteConfValue quotes a value as a postgresql.conf / postgresql.auto.conf string literal: wrapped in single quotes with embedded single quotes AND backslashes doubled. The GUC config-file lexer (guc-file.l) processes backslash escapes (\n, \t, octal, ...) inside quoted values, so a lone backslash would be reinterpreted; doubling matches ALTER SYSTEM's own writer (write_auto_conf_file in guc.c).
Values containing line breaks are rejected, mirroring ALTER SYSTEM ("parameter value for ALTER SYSTEM must not contain a newline"): the config-file lexer cannot lex a quoted string across lines, so an embedded line break would corrupt the file rather than round-trip. \r is rejected alongside \n because the lexer treats it as a line ending too.
Not interchangeable with QuoteStringLiteral: that one produces SQL-lexer syntax, whose escape-string form (E'...') a config file would read as a literal E followed by a quoted string.
func QuoteFunctionName ¶
QuoteFunctionName quotes name for use as a function name in deparsed SQL. It applies the same rules as QuoteIdentifier, and additionally quotes the handful of col_name keywords whose bare function-call form the grammar would reject (funcNameKeywordCollisions): left unquoted, the backend re-parses the call as the keyword's special syntax rather than a function call.
func QuoteIdentifier ¶
QuoteIdentifier quotes an SQL identifier if necessary Follows PostgreSQL rules: quote if contains special chars, is a keyword, or is case-sensitive
func QuoteIdentifierOrOperator ¶
QuoteIdentifierOrOperator quotes name as an identifier, unless it is an operator name, which is returned unchanged. Use it for qualified object names (e.g. ObjectWithArgs) whose parts may be either a function/type identifier or an operator symbol.
func QuoteQualifiedIdentifier ¶
QuoteQualifiedIdentifier handles dotted identifiers where parts may already be quoted This function preserves existing quotes and only quotes parts that need it
func QuoteStringLiteral ¶
QuoteStringLiteral quotes a string literal for SQL.
A value containing a backslash is emitted as an escape string E'...' with the backslash doubled, rather than an ordinary '...' literal. This keeps the literal scs-independent: an ordinary '...' is interpreted differently under standard_conforming_strings=off (backslashes become escapes), so re-emitting a reconstructed query as '...' would double-decode the value at the backend (e.g. E'a\\b', value a\b, would come back as a<backspace>b). E'...' decodes identically regardless of the backend's standard_conforming_strings setting. Single quotes are doubled in both forms.
func ReconstructSQL ¶
ReconstructSQL takes a normalized AST and bind values, and produces the final SQL with values substituted back in. This is used by Route at execution time to reconstruct the actual query from a cached plan.
The normalized AST is cloned before modification — it is not mutated.
func RedactIfCredentialBearing ¶
RedactIfCredentialBearing reports whether stmt is a CREATE CONNECTION statement, the only statement type whose raw SQL text carries a source password as a literal, and if so returns a safe-to-log substitute for that raw text. Every site that logs a query's raw text must redact through this function rather than reimplementing the check, so a password is never missed.
func WalkNodes ¶
func WalkNodes(node Node, walker NodeWalker)
WalkNodes recursively walks all nodes in an AST, calling the walker function. This is useful for analysis, transformation, and debugging.
Types ¶
type A_ArrayExpr ¶
A_ArrayExpr represents an array expression in the parse tree (e.g., ARRAY[1,2,3]). Ported from postgres/src/include/nodes/parsenodes.h:489-501
func CloneRefOfA_ArrayExpr ¶
func CloneRefOfA_ArrayExpr(n *A_ArrayExpr) *A_ArrayExpr
CloneRefOfA_ArrayExpr creates a deep clone of the input.
func NewA_ArrayExpr ¶
func NewA_ArrayExpr(elements *NodeList, location int) *A_ArrayExpr
NewA_ArrayExpr creates a new A_ArrayExpr node.
func (*A_ArrayExpr) ExpressionType ¶
func (a *A_ArrayExpr) ExpressionType() string
func (*A_ArrayExpr) IsExpr ¶
func (a *A_ArrayExpr) IsExpr() bool
func (*A_ArrayExpr) String ¶
func (a *A_ArrayExpr) String() string
type A_Const ¶
type A_Const struct {
BaseNode
Val Value // The constant value (Integer, Float, String, BitString, Boolean, or Null)
Isnull bool // SQL NULL constant
}
A_Const represents a constant value in the parse tree. Ported from postgres/src/include/nodes/parsenodes.h:357-365
func CloneRefOfA_Const ¶
CloneRefOfA_Const creates a deep clone of the input.
func NewA_Const ¶
NewA_Const creates a new A_Const node.
func NewA_ConstNull ¶
NewA_ConstNull creates a new A_Const node representing a NULL value.
func (*A_Const) ExpressionType ¶
type A_Expr ¶
type A_Expr struct {
BaseNode
Kind A_Expr_Kind // Expression type (operator, comparison, etc.)
Name *NodeList // Possibly-qualified operator name
Lexpr Node // Left operand
Rexpr Node // Right operand (or NULL for unary operators)
}
A_Expr represents a generic expression node used during parsing before semantic analysis. This is the primary expression node used in the parse tree. Ported from postgres/src/include/nodes/parsenodes.h:329-339
func CloneRefOfA_Expr ¶
CloneRefOfA_Expr creates a deep clone of the input.
func NewA_Expr ¶
func NewA_Expr(kind A_Expr_Kind, name *NodeList, lexpr, rexpr Node, location int) *A_Expr
NewA_Expr creates a new A_Expr node.
func (*A_Expr) ExpressionType ¶
type A_Expr_Kind ¶
type A_Expr_Kind int
A_Expr_Kind represents the type of A_Expr. Ported from postgres/src/include/nodes/parsenodes.h:331-339
const ( AEXPR_OP A_Expr_Kind = iota // Normal operator AEXPR_OP_ANY // Scalar op ANY (array) AEXPR_OP_ALL // Scalar op ALL (array) AEXPR_DISTINCT // IS DISTINCT FROM AEXPR_NOT_DISTINCT // IS NOT DISTINCT FROM AEXPR_NULLIF // NULLIF(a, b) AEXPR_IN // IN (list) AEXPR_LIKE // LIKE AEXPR_ILIKE // ILIKE AEXPR_SIMILAR // SIMILAR TO AEXPR_BETWEEN // BETWEEN AEXPR_NOT_BETWEEN // NOT BETWEEN AEXPR_BETWEEN_SYM // BETWEEN SYMMETRIC AEXPR_NOT_BETWEEN_SYM // NOT BETWEEN SYMMETRIC )
type A_Indices ¶
type A_Indices struct {
BaseNode
IsSlice bool // True for slicing (e.g., array[1:3])
Lidx Node // Lower index (NULL if not specified)
Uidx Node // Upper index (NULL if not specified)
}
A_Indices represents array indices in the parse tree (e.g., array[1:3]). Ported from postgres/src/include/nodes/parsenodes.h:456-462
func CloneRefOfA_Indices ¶
CloneRefOfA_Indices creates a deep clone of the input.
func NewA_Indices ¶
NewA_Indices creates a new A_Indices node for single index access.
func NewA_IndicesSlice ¶
NewA_IndicesSlice creates a new A_Indices node for slice access.
func (*A_Indices) ExpressionType ¶
type A_Indirection ¶
type A_Indirection struct {
BaseNode
Arg Node // The base expression
Indirection *NodeList // List of A_Indices and/or String nodes
}
A_Indirection represents indirection (field access) in the parse tree (e.g., obj.field). Ported from postgres/src/include/nodes/parsenodes.h:479-488
func CloneRefOfA_Indirection ¶
func CloneRefOfA_Indirection(n *A_Indirection) *A_Indirection
CloneRefOfA_Indirection creates a deep clone of the input.
func NewA_Indirection ¶
func NewA_Indirection(arg Node, indirection *NodeList, location int) *A_Indirection
NewA_Indirection creates a new A_Indirection node.
func (*A_Indirection) ExpressionType ¶
func (a *A_Indirection) ExpressionType() string
func (*A_Indirection) IsExpr ¶
func (a *A_Indirection) IsExpr() bool
func (*A_Indirection) SqlString ¶
func (a *A_Indirection) SqlString() string
SqlString returns the SQL representation of A_Indirection
func (*A_Indirection) String ¶
func (a *A_Indirection) String() string
type A_Star ¶
type A_Star struct {
BaseNode
}
A_Star represents an asterisk (*) in the parse tree, typically used in SELECT *. Ported from postgres/src/include/nodes/parsenodes.h:445-455
func CloneRefOfA_Star ¶
CloneRefOfA_Star creates a deep clone of the input.
func (*A_Star) ExpressionType ¶
type AccessPriv ¶
type AccessPriv struct {
BaseNode
PrivName string // String name of privilege - postgres/src/include/nodes/parsenodes.h:2510
Cols *NodeList // List of column names (or NIL) - postgres/src/include/nodes/parsenodes.h:2511
}
AccessPriv represents a privilege in a GRANT/REVOKE statement. Ported from postgres/src/include/nodes/parsenodes.h:2540
func CloneRefOfAccessPriv ¶
func CloneRefOfAccessPriv(n *AccessPriv) *AccessPriv
CloneRefOfAccessPriv creates a deep clone of the input.
func NewAccessPriv ¶
func NewAccessPriv(privName string, cols *NodeList) *AccessPriv
NewAccessPriv creates a new AccessPriv node.
func (*AccessPriv) String ¶
func (ap *AccessPriv) String() string
type AggSplit ¶
type AggSplit int
AggSplit represents aggregate splitting modes - ported from postgres/src/include/nodes/nodes.h:479-487
type Aggref ¶
type Aggref struct {
BaseExpr
Aggfnoid Oid // pg_proc OID of the aggregate - postgres/src/include/nodes/primnodes.h:481
Aggtype Oid // Result type OID - postgres/src/include/nodes/primnodes.h:483
Aggcollid Oid // Result collation - postgres/src/include/nodes/primnodes.h:485
Inputcollid Oid // Input collation - postgres/src/include/nodes/primnodes.h:487
Aggtranstype Oid // Transition value type - postgres/src/include/nodes/primnodes.h:492
Aggargtypes []Oid // Argument type OIDs - postgres/src/include/nodes/primnodes.h:494
Aggdirectargs *NodeList // Direct arguments for ordered-set aggs - postgres/src/include/nodes/primnodes.h:495
Args *NodeList // Aggregated arguments - postgres/src/include/nodes/primnodes.h:496
Aggorder *NodeList // ORDER BY expressions - postgres/src/include/nodes/primnodes.h:497
Aggdistinct *NodeList // DISTINCT expressions - postgres/src/include/nodes/primnodes.h:498
Aggfilter Node // FILTER expression - postgres/src/include/nodes/primnodes.h:499
Aggstar bool // True if argument list was '*' - postgres/src/include/nodes/primnodes.h:501
Aggvariadic bool // True if variadic args combined - postgres/src/include/nodes/primnodes.h:505
Aggkind byte // Aggregate kind - postgres/src/include/nodes/primnodes.h:507
Aggpresorted bool // Input already sorted - postgres/src/include/nodes/primnodes.h:509
Agglevelsup Index // > 0 if agg belongs to outer query - postgres/src/include/nodes/primnodes.h:511
Aggsplit AggSplit // Expected splitting mode - postgres/src/include/nodes/primnodes.h:513
Aggno int // Unique ID within Agg node - postgres/src/include/nodes/primnodes.h:515
Aggtransno int // Unique ID of transition state - postgres/src/include/nodes/primnodes.h:517
}
Aggref represents an aggregate function call expression. Ported from postgres/src/include/nodes/primnodes.h:439
func CloneRefOfAggref ¶
CloneRefOfAggref creates a deep clone of the input.
func (*Aggref) ExpressionType ¶
type Alias ¶
type Alias struct {
BaseNode
AliasName string // Alias name - postgres/src/include/nodes/primnodes.h:50
ColNames *NodeList // Column aliases - postgres/src/include/nodes/primnodes.h:51
}
Alias represents table and column aliases. Ported from postgres/src/include/nodes/primnodes.h:47
func CloneRefOfAlias ¶
CloneRefOfAlias creates a deep clone of the input.
type AlterCollationStmt ¶
AlterCollationStmt represents ALTER COLLATION statements Ported from postgres/src/include/nodes/parsenodes.h:2510-2514
func CloneRefOfAlterCollationStmt ¶
func CloneRefOfAlterCollationStmt(n *AlterCollationStmt) *AlterCollationStmt
CloneRefOfAlterCollationStmt creates a deep clone of the input.
func NewAlterCollationStmt ¶
func NewAlterCollationStmt(collname *NodeList) *AlterCollationStmt
NewAlterCollationStmt creates a new AlterCollationStmt node
func (*AlterCollationStmt) SqlString ¶
func (n *AlterCollationStmt) SqlString() string
func (*AlterCollationStmt) StatementType ¶
func (n *AlterCollationStmt) StatementType() string
func (*AlterCollationStmt) String ¶
func (n *AlterCollationStmt) String() string
type AlterCompositeTypeStmt ¶
type AlterCompositeTypeStmt struct {
BaseNode
TypeName *NodeList `json:"typeName"` // Qualified type name (list of String)
Cmds *NodeList `json:"cmds"` // List of alter type commands
}
AlterCompositeTypeStmt represents ALTER TYPE (composite) statements Note: This is actually handled by AlterTableStmt in PostgreSQL but represented here for grammar rule completeness
func CloneRefOfAlterCompositeTypeStmt ¶
func CloneRefOfAlterCompositeTypeStmt(n *AlterCompositeTypeStmt) *AlterCompositeTypeStmt
CloneRefOfAlterCompositeTypeStmt creates a deep clone of the input.
func NewAlterCompositeTypeStmt ¶
func NewAlterCompositeTypeStmt(typeName *NodeList, cmds *NodeList) *AlterCompositeTypeStmt
NewAlterCompositeTypeStmt creates a new AlterCompositeTypeStmt node
func (*AlterCompositeTypeStmt) SqlString ¶
func (n *AlterCompositeTypeStmt) SqlString() string
func (*AlterCompositeTypeStmt) StatementType ¶
func (n *AlterCompositeTypeStmt) StatementType() string
func (*AlterCompositeTypeStmt) String ¶
func (n *AlterCompositeTypeStmt) String() string
type AlterDatabaseRefreshCollStmt ¶
type AlterDatabaseRefreshCollStmt struct {
BaseNode
Dbname string `json:"dbname"` // Database name
}
AlterDatabaseRefreshCollStmt represents ALTER DATABASE REFRESH COLLATION VERSION statements Ported from postgres/src/include/nodes/parsenodes.h
func CloneRefOfAlterDatabaseRefreshCollStmt ¶
func CloneRefOfAlterDatabaseRefreshCollStmt(n *AlterDatabaseRefreshCollStmt) *AlterDatabaseRefreshCollStmt
CloneRefOfAlterDatabaseRefreshCollStmt creates a deep clone of the input.
func NewAlterDatabaseRefreshCollStmt ¶
func NewAlterDatabaseRefreshCollStmt(dbname string) *AlterDatabaseRefreshCollStmt
NewAlterDatabaseRefreshCollStmt creates a new AlterDatabaseRefreshCollStmt node
func (*AlterDatabaseRefreshCollStmt) SqlString ¶
func (n *AlterDatabaseRefreshCollStmt) SqlString() string
func (*AlterDatabaseRefreshCollStmt) StatementType ¶
func (n *AlterDatabaseRefreshCollStmt) StatementType() string
func (*AlterDatabaseRefreshCollStmt) String ¶
func (n *AlterDatabaseRefreshCollStmt) String() string
type AlterDatabaseSetStmt ¶
type AlterDatabaseSetStmt struct {
BaseNode
Dbname string `json:"dbname"` // Database name
Setstmt *VariableSetStmt `json:"setstmt"` // SET or RESET subcommand
}
AlterDatabaseSetStmt represents ALTER DATABASE SET statements Ported from postgres/src/include/nodes/parsenodes.h:3238-3243
func CloneRefOfAlterDatabaseSetStmt ¶
func CloneRefOfAlterDatabaseSetStmt(n *AlterDatabaseSetStmt) *AlterDatabaseSetStmt
CloneRefOfAlterDatabaseSetStmt creates a deep clone of the input.
func NewAlterDatabaseSetStmt ¶
func NewAlterDatabaseSetStmt(dbname string, setstmt *VariableSetStmt) *AlterDatabaseSetStmt
NewAlterDatabaseSetStmt creates a new AlterDatabaseSetStmt node
func (*AlterDatabaseSetStmt) SqlString ¶
func (n *AlterDatabaseSetStmt) SqlString() string
func (*AlterDatabaseSetStmt) StatementType ¶
func (n *AlterDatabaseSetStmt) StatementType() string
func (*AlterDatabaseSetStmt) String ¶
func (n *AlterDatabaseSetStmt) String() string
type AlterDatabaseStmt ¶
type AlterDatabaseStmt struct {
BaseNode
Dbname string `json:"dbname"` // Name of database to alter
Options *NodeList `json:"options"` // List of DefElem nodes
}
AlterDatabaseStmt represents ALTER DATABASE statements Ported from postgres/src/include/nodes/parsenodes.h:3221-3226
func CloneRefOfAlterDatabaseStmt ¶
func CloneRefOfAlterDatabaseStmt(n *AlterDatabaseStmt) *AlterDatabaseStmt
CloneRefOfAlterDatabaseStmt creates a deep clone of the input.
func NewAlterDatabaseStmt ¶
func NewAlterDatabaseStmt(dbname string, options *NodeList) *AlterDatabaseStmt
NewAlterDatabaseStmt creates a new AlterDatabaseStmt node
func (*AlterDatabaseStmt) SqlString ¶
func (n *AlterDatabaseStmt) SqlString() string
func (*AlterDatabaseStmt) StatementType ¶
func (n *AlterDatabaseStmt) StatementType() string
func (*AlterDatabaseStmt) String ¶
func (n *AlterDatabaseStmt) String() string
type AlterDefaultPrivilegesStmt ¶
type AlterDefaultPrivilegesStmt struct {
BaseNode
Options *NodeList // List of DefElem - postgres/src/include/nodes/parsenodes.h:2574
Action *GrantStmt // GRANT/REVOKE action (with objects=NIL) - postgres/src/include/nodes/parsenodes.h:2575
}
AlterDefaultPrivilegesStmt represents ALTER DEFAULT PRIVILEGES statement. Ported from postgres/src/include/nodes/parsenodes.h:2571
func CloneRefOfAlterDefaultPrivilegesStmt ¶
func CloneRefOfAlterDefaultPrivilegesStmt(n *AlterDefaultPrivilegesStmt) *AlterDefaultPrivilegesStmt
CloneRefOfAlterDefaultPrivilegesStmt creates a deep clone of the input.
func NewAlterDefaultPrivilegesStmt ¶
func NewAlterDefaultPrivilegesStmt(options *NodeList, action *GrantStmt) *AlterDefaultPrivilegesStmt
NewAlterDefaultPrivilegesStmt creates a new ALTER DEFAULT PRIVILEGES statement.
func (*AlterDefaultPrivilegesStmt) SqlString ¶
func (adps *AlterDefaultPrivilegesStmt) SqlString() string
SqlString returns the SQL representation of the ALTER DEFAULT PRIVILEGES statement
func (*AlterDefaultPrivilegesStmt) StatementType ¶
func (adps *AlterDefaultPrivilegesStmt) StatementType() string
func (*AlterDefaultPrivilegesStmt) String ¶
func (adps *AlterDefaultPrivilegesStmt) String() string
type AlterDomainStmt ¶
type AlterDomainStmt struct {
BaseNode
Subtype byte // T/N/O/C/X for alter type - postgres/src/include/nodes/parsenodes.h:2463
TypeName *NodeList // domain to work on - postgres/src/include/nodes/parsenodes.h:2464
Name string // column or constraint name to act on - postgres/src/include/nodes/parsenodes.h:2465
Def Node // definition of default or constraint - postgres/src/include/nodes/parsenodes.h:2466
Behavior DropBehavior // RESTRICT or CASCADE for DROP cases - postgres/src/include/nodes/parsenodes.h:2467
MissingOk bool // skip error if missing? - postgres/src/include/nodes/parsenodes.h:2468
}
AlterDomainStmt represents an ALTER DOMAIN statement. Ported from postgres/src/include/nodes/parsenodes.h:2461
func CloneRefOfAlterDomainStmt ¶
func CloneRefOfAlterDomainStmt(n *AlterDomainStmt) *AlterDomainStmt
CloneRefOfAlterDomainStmt creates a deep clone of the input.
func NewAlterDomainStmt ¶
func NewAlterDomainStmt(subtype byte, typeName *NodeList) *AlterDomainStmt
NewAlterDomainStmt creates a new AlterDomainStmt node.
func (*AlterDomainStmt) SqlString ¶
func (a *AlterDomainStmt) SqlString() string
SqlString returns the SQL representation of ALTER DOMAIN statement.
func (*AlterDomainStmt) StatementType ¶
func (a *AlterDomainStmt) StatementType() string
func (*AlterDomainStmt) String ¶
func (a *AlterDomainStmt) String() string
type AlterEnumStmt ¶
type AlterEnumStmt struct {
BaseNode
TypeName *NodeList // qualified name (list of String)
OldVal string // old enum value's name, if renaming
NewVal string // new enum value's name
NewValNeighbor string // neighboring enum value, if specified
NewValIsAfter bool // place new val after neighbor?
SkipIfNewValExists bool // ignore statement if new already exists
}
AlterEnumStmt represents an ALTER TYPE ... ADD VALUE statement Ported from postgres/src/include/nodes/parsenodes.h:3693
func CloneRefOfAlterEnumStmt ¶
func CloneRefOfAlterEnumStmt(n *AlterEnumStmt) *AlterEnumStmt
CloneRefOfAlterEnumStmt creates a deep clone of the input.
func NewAlterEnumStmt ¶
func NewAlterEnumStmt(typeName *NodeList) *AlterEnumStmt
NewAlterEnumStmt creates a new AlterEnumStmt node
func (*AlterEnumStmt) SqlString ¶
func (aes *AlterEnumStmt) SqlString() string
SqlString returns the SQL representation of AlterEnumStmt
func (*AlterEnumStmt) StatementType ¶
func (aes *AlterEnumStmt) StatementType() string
StatementType returns the statement type
func (*AlterEnumStmt) String ¶
func (aes *AlterEnumStmt) String() string
String returns string representation of AlterEnumStmt
type AlterEventTrigStmt ¶
type AlterEventTrigStmt struct {
BaseNode
TrigName string `json:"trigname"` // event trigger name
TgEnabled TriggerFires `json:"tgenabled"` // enable/disable state
}
AlterEventTrigStmt represents ALTER EVENT TRIGGER statement Ported from postgres/src/include/nodes/parsenodes.h AlterEventTrigStmt
func CloneRefOfAlterEventTrigStmt ¶
func CloneRefOfAlterEventTrigStmt(n *AlterEventTrigStmt) *AlterEventTrigStmt
CloneRefOfAlterEventTrigStmt creates a deep clone of the input.
func NewAlterEventTrigStmt ¶
func NewAlterEventTrigStmt(trigname string, tgenabled TriggerFires) *AlterEventTrigStmt
NewAlterEventTrigStmt creates a new AlterEventTrigStmt node
func (*AlterEventTrigStmt) SqlString ¶
func (a *AlterEventTrigStmt) SqlString() string
SqlString returns the SQL representation of AlterEventTrigStmt
func (*AlterEventTrigStmt) StatementType ¶
func (a *AlterEventTrigStmt) StatementType() string
func (*AlterEventTrigStmt) String ¶
func (a *AlterEventTrigStmt) String() string
type AlterExtensionContentsStmt ¶
type AlterExtensionContentsStmt struct {
BaseNode
Extname string // extension name
Action bool // true = ADD, false = DROP
Objtype int // object type from ObjectType enum
Object Node // qualified name of the object (can be String, NodeList, TypeName, etc.)
}
AlterExtensionContentsStmt represents an ALTER EXTENSION ADD/DROP statement. Ported from postgres/src/include/nodes/parsenodes.h:2842
func CloneRefOfAlterExtensionContentsStmt ¶
func CloneRefOfAlterExtensionContentsStmt(n *AlterExtensionContentsStmt) *AlterExtensionContentsStmt
CloneRefOfAlterExtensionContentsStmt creates a deep clone of the input.
func NewAlterExtensionContentsStmt ¶
func NewAlterExtensionContentsStmt(extname string, action bool, objtype int, object Node) *AlterExtensionContentsStmt
NewAlterExtensionContentsStmt creates a new AlterExtensionContentsStmt node.
func (*AlterExtensionContentsStmt) SqlString ¶
func (a *AlterExtensionContentsStmt) SqlString() string
SqlString returns the SQL representation of AlterExtensionContentsStmt. Mirrors PostgreSQL's deparseAlterExtensionContentsStmt: the object type keyword is emitted, then the member object is rendered according to its grammar shape (a bare name, a qualified any_name, a function/operator with argtypes, a type name, a cast, an operator class/family with USING, or a transform).
func (*AlterExtensionContentsStmt) StatementType ¶
func (a *AlterExtensionContentsStmt) StatementType() string
func (*AlterExtensionContentsStmt) String ¶
func (a *AlterExtensionContentsStmt) String() string
type AlterExtensionStmt ¶
type AlterExtensionStmt struct {
BaseNode
Extname string // extension name
Options *NodeList // list of DefElem nodes
}
AlterExtensionStmt represents an ALTER EXTENSION statement. Ported from postgres/src/include/nodes/parsenodes.h:2834
func CloneRefOfAlterExtensionStmt ¶
func CloneRefOfAlterExtensionStmt(n *AlterExtensionStmt) *AlterExtensionStmt
CloneRefOfAlterExtensionStmt creates a deep clone of the input.
func NewAlterExtensionStmt ¶
func NewAlterExtensionStmt(extname string, options *NodeList) *AlterExtensionStmt
NewAlterExtensionStmt creates a new AlterExtensionStmt node.
func (*AlterExtensionStmt) SqlString ¶
func (a *AlterExtensionStmt) SqlString() string
SqlString returns the SQL representation of AlterExtensionStmt
func (*AlterExtensionStmt) StatementType ¶
func (a *AlterExtensionStmt) StatementType() string
func (*AlterExtensionStmt) String ¶
func (a *AlterExtensionStmt) String() string
type AlterFdwStmt ¶
type AlterFdwStmt struct {
BaseNode
FdwName string `json:"fdwname"` // foreign data wrapper name
FuncOptions *NodeList `json:"func_options"` // HANDLER/VALIDATOR options
Options *NodeList `json:"options"` // OPTIONS clause
}
AlterFdwStmt represents ALTER FOREIGN DATA WRAPPER statement Ported from postgres/src/include/nodes/parsenodes.h AlterFdwStmt
func CloneRefOfAlterFdwStmt ¶
func CloneRefOfAlterFdwStmt(n *AlterFdwStmt) *AlterFdwStmt
CloneRefOfAlterFdwStmt creates a deep clone of the input.
func NewAlterFdwStmt ¶
func NewAlterFdwStmt(fdwname string, funcOptions, options *NodeList) *AlterFdwStmt
NewAlterFdwStmt creates a new AlterFdwStmt node
func (*AlterFdwStmt) SqlString ¶
func (a *AlterFdwStmt) SqlString() string
SqlString returns the SQL representation of AlterFdwStmt
func (*AlterFdwStmt) StatementType ¶
func (a *AlterFdwStmt) StatementType() string
func (*AlterFdwStmt) String ¶
func (a *AlterFdwStmt) String() string
type AlterForeignServerStmt ¶
type AlterForeignServerStmt struct {
BaseNode
Servername string `json:"servername"` // server name
Version string `json:"version"` // optional server version
Options *NodeList `json:"options"` // OPTIONS clause
HasVersion bool `json:"has_version"` // whether version was specified
}
AlterForeignServerStmt represents ALTER SERVER statement Ported from postgres/src/include/nodes/parsenodes.h AlterForeignServerStmt
func CloneRefOfAlterForeignServerStmt ¶
func CloneRefOfAlterForeignServerStmt(n *AlterForeignServerStmt) *AlterForeignServerStmt
CloneRefOfAlterForeignServerStmt creates a deep clone of the input.
func NewAlterForeignServerStmt ¶
func NewAlterForeignServerStmt(servername, version string, options *NodeList, hasVersion bool) *AlterForeignServerStmt
NewAlterForeignServerStmt creates a new AlterForeignServerStmt node
func (*AlterForeignServerStmt) SqlString ¶
func (a *AlterForeignServerStmt) SqlString() string
SqlString returns the SQL representation of AlterForeignServerStmt
func (*AlterForeignServerStmt) StatementType ¶
func (a *AlterForeignServerStmt) StatementType() string
func (*AlterForeignServerStmt) String ¶
func (a *AlterForeignServerStmt) String() string
type AlterFunctionStmt ¶
type AlterFunctionStmt struct {
BaseNode
ObjType ObjectType `json:"objtype"` // OBJECT_FUNCTION or OBJECT_PROCEDURE
Func *ObjectWithArgs `json:"func"` // name and args of function
Actions *NodeList `json:"actions"` // list of DefElem
}
AlterFunctionStmt represents ALTER FUNCTION statement Ported from postgres/src/include/nodes/parsenodes.h AlterFunctionStmt
func CloneRefOfAlterFunctionStmt ¶
func CloneRefOfAlterFunctionStmt(n *AlterFunctionStmt) *AlterFunctionStmt
CloneRefOfAlterFunctionStmt creates a deep clone of the input.
func NewAlterFunctionStmt ¶
func NewAlterFunctionStmt(objType ObjectType, funcWithArgs *ObjectWithArgs, actions *NodeList) *AlterFunctionStmt
func (*AlterFunctionStmt) SqlString ¶
func (a *AlterFunctionStmt) SqlString() string
SqlString returns the SQL representation of ALTER FUNCTION statement
func (*AlterFunctionStmt) StatementType ¶
func (a *AlterFunctionStmt) StatementType() string
func (*AlterFunctionStmt) String ¶
func (a *AlterFunctionStmt) String() string
type AlterMigrationStmt ¶
type AlterMigrationStmt struct {
BaseNode
Name string
IfExists bool
Direction MigrationDirection
When *A_Expr // WHEN (field OP constant); nil if omitted
Options *NodeList // *DefElem list; may be nil
}
AlterMigrationStmt represents `ALTER MIGRATION [IF EXISTS] name PHASE {IMPORT|EXPORT} [WHEN (cond)] [WITH (...)]`.
func CloneRefOfAlterMigrationStmt ¶
func CloneRefOfAlterMigrationStmt(n *AlterMigrationStmt) *AlterMigrationStmt
CloneRefOfAlterMigrationStmt creates a deep clone of the input.
func NewAlterMigrationStmt ¶
func NewAlterMigrationStmt(name string, ifExists bool, action *MigrationActionSpec) *AlterMigrationStmt
func (*AlterMigrationStmt) SqlString ¶
func (n *AlterMigrationStmt) SqlString() string
func (*AlterMigrationStmt) StatementType ¶
func (n *AlterMigrationStmt) StatementType() string
func (*AlterMigrationStmt) String ¶
func (n *AlterMigrationStmt) String() string
type AlterObjectDependsStmt ¶
type AlterObjectDependsStmt struct {
BaseNode
ObjectType ObjectType `json:"objectType"` // OBJECT_FUNCTION, OBJECT_TRIGGER, etc
Relation *RangeVar `json:"relation"` // In case a table is involved
Object Node `json:"object"` // Name of the object
Extname *String `json:"extname"` // Extension name
Remove bool `json:"remove"` // Set true to remove dep rather than add
}
AlterObjectDependsStmt represents ALTER ... DEPENDS statements Ported from postgres/src/include/nodes/parsenodes.h:3556-3564
func CloneRefOfAlterObjectDependsStmt ¶
func CloneRefOfAlterObjectDependsStmt(n *AlterObjectDependsStmt) *AlterObjectDependsStmt
CloneRefOfAlterObjectDependsStmt creates a deep clone of the input.
func NewAlterObjectDependsStmt ¶
func NewAlterObjectDependsStmt(objectType ObjectType, extname *String, remove bool) *AlterObjectDependsStmt
NewAlterObjectDependsStmt creates a new AlterObjectDependsStmt node
func (*AlterObjectDependsStmt) SqlString ¶
func (n *AlterObjectDependsStmt) SqlString() string
func (*AlterObjectDependsStmt) StatementType ¶
func (n *AlterObjectDependsStmt) StatementType() string
func (*AlterObjectDependsStmt) String ¶
func (n *AlterObjectDependsStmt) String() string
type AlterObjectSchemaStmt ¶
type AlterObjectSchemaStmt struct {
BaseNode
ObjectType ObjectType `json:"objectType"` // OBJECT_TABLE, OBJECT_TYPE, etc
Relation *RangeVar `json:"relation"` // In case it's a table
Object Node `json:"object"` // In case it's some other object
NewSchema string `json:"newSchema"` // The new schema
MissingOk bool `json:"missingOk"` // Skip error if missing?
}
AlterObjectSchemaStmt represents ALTER ... SET SCHEMA statements Ported from postgres/src/include/nodes/parsenodes.h:3547-3554
func CloneRefOfAlterObjectSchemaStmt ¶
func CloneRefOfAlterObjectSchemaStmt(n *AlterObjectSchemaStmt) *AlterObjectSchemaStmt
CloneRefOfAlterObjectSchemaStmt creates a deep clone of the input.
func NewAlterObjectSchemaStmt ¶
func NewAlterObjectSchemaStmt(objectType ObjectType, newSchema string) *AlterObjectSchemaStmt
NewAlterObjectSchemaStmt creates a new AlterObjectSchemaStmt node
func (*AlterObjectSchemaStmt) SqlString ¶
func (n *AlterObjectSchemaStmt) SqlString() string
func (*AlterObjectSchemaStmt) StatementType ¶
func (n *AlterObjectSchemaStmt) StatementType() string
func (*AlterObjectSchemaStmt) String ¶
func (n *AlterObjectSchemaStmt) String() string
type AlterOpFamilyStmt ¶
type AlterOpFamilyStmt struct {
BaseNode
OpFamilyName *NodeList `json:"opfamilyname"`
AmName string `json:"amname"`
IsDrop bool `json:"isDrop"`
Items *NodeList `json:"items"`
}
AlterOpFamilyStmt represents ALTER OPERATOR FAMILY statement
func CloneRefOfAlterOpFamilyStmt ¶
func CloneRefOfAlterOpFamilyStmt(n *AlterOpFamilyStmt) *AlterOpFamilyStmt
CloneRefOfAlterOpFamilyStmt creates a deep clone of the input.
func NewAlterOpFamilyStmt ¶
func NewAlterOpFamilyStmt(name *NodeList, amName string, isDrop bool, items *NodeList) *AlterOpFamilyStmt
func (*AlterOpFamilyStmt) SqlString ¶
func (a *AlterOpFamilyStmt) SqlString() string
SqlString returns the SQL representation of ALTER OPERATOR FAMILY statement
func (*AlterOpFamilyStmt) StatementType ¶
func (a *AlterOpFamilyStmt) StatementType() string
func (*AlterOpFamilyStmt) String ¶
func (a *AlterOpFamilyStmt) String() string
type AlterOperatorStmt ¶
type AlterOperatorStmt struct {
BaseNode
Opername *ObjectWithArgs `json:"opername"` // Operator name and argument types
Options *NodeList `json:"options"` // List of DefElem nodes
}
AlterOperatorStmt represents ALTER OPERATOR statements Ported from postgres/src/include/nodes/parsenodes.h:3585-3589
func CloneRefOfAlterOperatorStmt ¶
func CloneRefOfAlterOperatorStmt(n *AlterOperatorStmt) *AlterOperatorStmt
CloneRefOfAlterOperatorStmt creates a deep clone of the input.
func NewAlterOperatorStmt ¶
func NewAlterOperatorStmt(opername *ObjectWithArgs, options *NodeList) *AlterOperatorStmt
NewAlterOperatorStmt creates a new AlterOperatorStmt node
func (*AlterOperatorStmt) SqlString ¶
func (n *AlterOperatorStmt) SqlString() string
func (*AlterOperatorStmt) StatementType ¶
func (n *AlterOperatorStmt) StatementType() string
func (*AlterOperatorStmt) String ¶
func (n *AlterOperatorStmt) String() string
type AlterOwnerStmt ¶
type AlterOwnerStmt struct {
BaseNode
ObjectType ObjectType `json:"objectType"` // OBJECT_TABLE, OBJECT_TYPE, etc
Relation *RangeVar `json:"relation"` // In case it's a table
Object Node `json:"object"` // In case it's some other object
Newowner *RoleSpec `json:"newowner"` // The new owner
}
AlterOwnerStmt represents ALTER ... OWNER TO statements Ported from postgres/src/include/nodes/parsenodes.h:3571-3578
func CloneRefOfAlterOwnerStmt ¶
func CloneRefOfAlterOwnerStmt(n *AlterOwnerStmt) *AlterOwnerStmt
CloneRefOfAlterOwnerStmt creates a deep clone of the input.
func NewAlterOwnerStmt ¶
func NewAlterOwnerStmt(objectType ObjectType, newowner *RoleSpec) *AlterOwnerStmt
NewAlterOwnerStmt creates a new AlterOwnerStmt node
func (*AlterOwnerStmt) SqlString ¶
func (n *AlterOwnerStmt) SqlString() string
SqlString returns the SQL representation of the AlterOwnerStmt
func (*AlterOwnerStmt) StatementType ¶
func (n *AlterOwnerStmt) StatementType() string
StatementType returns the statement type
func (*AlterOwnerStmt) String ¶
func (n *AlterOwnerStmt) String() string
type AlterPolicyStmt ¶
type AlterPolicyStmt struct {
BaseNode
PolicyName string // Policy name - parsenodes.h:2977
Table *RangeVar // Table the policy applies to - parsenodes.h:2978
Roles *NodeList // Roles policy applies to - parsenodes.h:2979
Qual Node // USING clause - parsenodes.h:2980
WithCheck Node // WITH CHECK clause - parsenodes.h:2981
}
AlterPolicyStmt represents ALTER POLICY statements. Ported from postgres/src/include/nodes/parsenodes.h:2975
func CloneRefOfAlterPolicyStmt ¶
func CloneRefOfAlterPolicyStmt(n *AlterPolicyStmt) *AlterPolicyStmt
CloneRefOfAlterPolicyStmt creates a deep clone of the input.
func NewAlterPolicyStmt ¶
func NewAlterPolicyStmt(policyName string, table *RangeVar, roles *NodeList, qual Node, withCheck Node) *AlterPolicyStmt
NewAlterPolicyStmt creates a new AlterPolicyStmt node.
func (*AlterPolicyStmt) SqlString ¶
func (aps *AlterPolicyStmt) SqlString() string
SqlString returns the SQL representation of ALTER POLICY statement
func (*AlterPolicyStmt) StatementType ¶
func (aps *AlterPolicyStmt) StatementType() string
func (*AlterPolicyStmt) String ¶
func (aps *AlterPolicyStmt) String() string
type AlterPublicationStmt ¶
type AlterPublicationStmt struct {
BaseNode
PubName string `json:"pubname"`
Options *NodeList `json:"options"`
PubObjects *NodeList `json:"pubobjects"`
Action AlterPublicationType `json:"action"`
}
AlterPublicationStmt represents ALTER PUBLICATION statement
func CloneRefOfAlterPublicationStmt ¶
func CloneRefOfAlterPublicationStmt(n *AlterPublicationStmt) *AlterPublicationStmt
CloneRefOfAlterPublicationStmt creates a deep clone of the input.
func NewAlterPublicationStmt ¶
func NewAlterPublicationStmt(name string, options, objects *NodeList, action AlterPublicationType) *AlterPublicationStmt
func (*AlterPublicationStmt) SqlString ¶
func (a *AlterPublicationStmt) SqlString() string
SqlString returns the SQL representation of ALTER PUBLICATION statement
func (*AlterPublicationStmt) StatementType ¶
func (a *AlterPublicationStmt) StatementType() string
func (*AlterPublicationStmt) String ¶
func (a *AlterPublicationStmt) String() string
type AlterPublicationType ¶
type AlterPublicationType int
AlterPublicationType represents types of ALTER PUBLICATION operations
const ( AP_SetOptions AlterPublicationType = iota AP_AddObjects AP_SetObjects AP_DropObjects )
type AlterReplicationSlotCmd ¶
type AlterReplicationSlotCmd struct {
BaseNode
SlotName string // replnodes.h:82
Options []*DefElem // replnodes.h:83
}
AlterReplicationSlotCmd - ALTER_REPLICATION_SLOT command. Ported from postgres/src/include/nodes/replnodes.h:79-84
func CloneRefOfAlterReplicationSlotCmd ¶
func CloneRefOfAlterReplicationSlotCmd(n *AlterReplicationSlotCmd) *AlterReplicationSlotCmd
CloneRefOfAlterReplicationSlotCmd creates a deep clone of the input.
func NewAlterReplicationSlotCmd ¶
func NewAlterReplicationSlotCmd(slot string, options []*DefElem) *AlterReplicationSlotCmd
func (*AlterReplicationSlotCmd) SqlString ¶
func (n *AlterReplicationSlotCmd) SqlString() string
func (*AlterReplicationSlotCmd) StatementType ¶
func (n *AlterReplicationSlotCmd) StatementType() string
type AlterRoleSetStmt ¶
type AlterRoleSetStmt struct {
BaseNode
Role *RoleSpec // Role to modify - postgres/src/include/nodes/parsenodes.h:3100
Database string // Database name, or empty string - postgres/src/include/nodes/parsenodes.h:3101
Setstmt *VariableSetStmt // SET or RESET subcommand - postgres/src/include/nodes/parsenodes.h:3102
}
AlterRoleSetStmt represents an ALTER ROLE/USER SET/RESET statement. Ported from postgres/src/include/nodes/parsenodes.h:3097
func CloneRefOfAlterRoleSetStmt ¶
func CloneRefOfAlterRoleSetStmt(n *AlterRoleSetStmt) *AlterRoleSetStmt
CloneRefOfAlterRoleSetStmt creates a deep clone of the input.
func NewAlterRoleSetStmt ¶
func NewAlterRoleSetStmt(role *RoleSpec, database string, setstmt *VariableSetStmt) *AlterRoleSetStmt
NewAlterRoleSetStmt creates a new ALTER ROLE SET statement.
func (*AlterRoleSetStmt) SqlString ¶
func (arss *AlterRoleSetStmt) SqlString() string
func (*AlterRoleSetStmt) StatementType ¶
func (arss *AlterRoleSetStmt) StatementType() string
func (*AlterRoleSetStmt) String ¶
func (arss *AlterRoleSetStmt) String() string
type AlterRoleStmt ¶
type AlterRoleStmt struct {
BaseNode
Role *RoleSpec // Role to alter - postgres/src/include/nodes/parsenodes.h:3092
Options *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:3093
Action int // +1 = add members, -1 = drop members - postgres/src/include/nodes/parsenodes.h:3094
}
AlterRoleStmt represents an ALTER ROLE/USER/GROUP statement. Ported from postgres/src/include/nodes/parsenodes.h:3089
func CloneRefOfAlterRoleStmt ¶
func CloneRefOfAlterRoleStmt(n *AlterRoleStmt) *AlterRoleStmt
CloneRefOfAlterRoleStmt creates a deep clone of the input.
func NewAlterRoleStmt ¶
func NewAlterRoleStmt(role *RoleSpec, options *NodeList) *AlterRoleStmt
NewAlterRoleStmt creates a new ALTER ROLE statement.
func (*AlterRoleStmt) SqlString ¶
func (ars *AlterRoleStmt) SqlString() string
func (*AlterRoleStmt) StatementType ¶
func (ars *AlterRoleStmt) StatementType() string
func (*AlterRoleStmt) String ¶
func (ars *AlterRoleStmt) String() string
type AlterSeqStmt ¶
type AlterSeqStmt struct {
BaseNode
Sequence *RangeVar // the sequence to alter
Options *NodeList // list of DefElem options
ForIdentity bool // for IDENTITY column
MissingOk bool // skip error if sequence doesn't exist
}
AlterSeqStmt represents an ALTER SEQUENCE statement Ported from postgres/src/include/nodes/parsenodes.h:3470-3477
func CloneRefOfAlterSeqStmt ¶
func CloneRefOfAlterSeqStmt(n *AlterSeqStmt) *AlterSeqStmt
CloneRefOfAlterSeqStmt creates a deep clone of the input.
func NewAlterSeqStmt ¶
func NewAlterSeqStmt(sequence *RangeVar, options *NodeList, forIdentity, missingOk bool) *AlterSeqStmt
NewAlterSeqStmt creates a new AlterSeqStmt node
func (*AlterSeqStmt) SqlString ¶
func (ass *AlterSeqStmt) SqlString() string
SqlString returns the SQL representation of AlterSeqStmt
func (*AlterSeqStmt) StatementType ¶
func (ass *AlterSeqStmt) StatementType() string
StatementType returns the statement type
func (*AlterSeqStmt) String ¶
func (ass *AlterSeqStmt) String() string
String returns string representation of AlterSeqStmt
type AlterStatsStmt ¶
type AlterStatsStmt struct {
BaseNode
DefNames *NodeList `json:"defnames"`
StxStatTarget Node `json:"stxstattarget"`
MissingOk bool `json:"missing_ok"`
}
AlterStatsStmt represents ALTER STATISTICS statement
func CloneRefOfAlterStatsStmt ¶
func CloneRefOfAlterStatsStmt(n *AlterStatsStmt) *AlterStatsStmt
CloneRefOfAlterStatsStmt creates a deep clone of the input.
func NewAlterStatsStmt ¶
func NewAlterStatsStmt(defnames *NodeList, target Node, missingOk bool) *AlterStatsStmt
func (*AlterStatsStmt) SqlString ¶
func (a *AlterStatsStmt) SqlString() string
SqlString returns the SQL representation of ALTER STATISTICS statement
func (*AlterStatsStmt) StatementType ¶
func (a *AlterStatsStmt) StatementType() string
func (*AlterStatsStmt) String ¶
func (a *AlterStatsStmt) String() string
type AlterSubscriptionStmt ¶
type AlterSubscriptionStmt struct {
BaseNode
SubName string `json:"subname"`
Kind AlterSubscriptionType `json:"kind"`
ConnInfo string `json:"conninfo"`
Publication *NodeList `json:"publication"`
Options *NodeList `json:"options"`
}
AlterSubscriptionStmt represents ALTER SUBSCRIPTION statement
func CloneRefOfAlterSubscriptionStmt ¶
func CloneRefOfAlterSubscriptionStmt(n *AlterSubscriptionStmt) *AlterSubscriptionStmt
CloneRefOfAlterSubscriptionStmt creates a deep clone of the input.
func NewAlterSubscriptionStmt ¶
func NewAlterSubscriptionStmt(name string, kind AlterSubscriptionType, connInfo string, publication, options *NodeList) *AlterSubscriptionStmt
func (*AlterSubscriptionStmt) SqlString ¶
func (a *AlterSubscriptionStmt) SqlString() string
SqlString returns the SQL representation of ALTER SUBSCRIPTION statement
func (*AlterSubscriptionStmt) StatementType ¶
func (a *AlterSubscriptionStmt) StatementType() string
func (*AlterSubscriptionStmt) String ¶
func (a *AlterSubscriptionStmt) String() string
type AlterSubscriptionType ¶
type AlterSubscriptionType int
AlterSubscriptionType represents types of ALTER SUBSCRIPTION operations
const ( ALTER_SUBSCRIPTION_OPTIONS AlterSubscriptionType = iota ALTER_SUBSCRIPTION_CONNECTION ALTER_SUBSCRIPTION_REFRESH ALTER_SUBSCRIPTION_ADD_PUBLICATION ALTER_SUBSCRIPTION_DROP_PUBLICATION ALTER_SUBSCRIPTION_SET_PUBLICATION ALTER_SUBSCRIPTION_ENABLED ALTER_SUBSCRIPTION_SKIP )
type AlterSystemStmt ¶
type AlterSystemStmt struct {
BaseNode
Setstmt *VariableSetStmt // SET subcommand - postgres/src/include/nodes/parsenodes.h:3815
}
AlterSystemStmt represents an ALTER SYSTEM statement. Ported from postgres/src/include/nodes/parsenodes.h:3812
func CloneRefOfAlterSystemStmt ¶
func CloneRefOfAlterSystemStmt(n *AlterSystemStmt) *AlterSystemStmt
CloneRefOfAlterSystemStmt creates a deep clone of the input.
func NewAlterSystemStmt ¶
func NewAlterSystemStmt(setstmt *VariableSetStmt) *AlterSystemStmt
NewAlterSystemStmt creates a new ALTER SYSTEM statement.
func (*AlterSystemStmt) SqlString ¶
func (ass *AlterSystemStmt) SqlString() string
SqlString returns the SQL representation of the ALTER SYSTEM statement
func (*AlterSystemStmt) StatementType ¶
func (ass *AlterSystemStmt) StatementType() string
func (*AlterSystemStmt) String ¶
func (ass *AlterSystemStmt) String() string
type AlterTSConfigType ¶
type AlterTSConfigType int
AlterTSConfigType represents the type of ALTER TEXT SEARCH CONFIGURATION operation Ported from postgres/src/include/nodes/parsenodes.h:3700-3706
const ( ALTER_TSCONFIG_ADD_MAPPING AlterTSConfigType = iota ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN ALTER_TSCONFIG_ALTER_MAPPING_REPLACE ALTER_TSCONFIG_REPLACE_DICT ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN ALTER_TSCONFIG_DROP_MAPPING )
func (AlterTSConfigType) String ¶
func (a AlterTSConfigType) String() string
type AlterTSConfigurationStmt ¶
type AlterTSConfigurationStmt struct {
BaseNode
Kind AlterTSConfigType `json:"kind"` // ALTER_TSCONFIG_ADD_MAPPING, etc
Cfgname *NodeList `json:"cfgname"` // Qualified name (list of String)
Tokentype *NodeList `json:"tokentype"` // List of String
Dicts *NodeList `json:"dicts"` // List of String
Override bool `json:"override"` // If true, replace rather than add
Replace bool `json:"replace"` // If true, replace rather than modify
MissingOk bool `json:"missingOk"` // For ALTER ... IF EXISTS
}
AlterTSConfigurationStmt represents ALTER TEXT SEARCH CONFIGURATION statements Ported from postgres/src/include/nodes/parsenodes.h:3708-3721
func CloneRefOfAlterTSConfigurationStmt ¶
func CloneRefOfAlterTSConfigurationStmt(n *AlterTSConfigurationStmt) *AlterTSConfigurationStmt
CloneRefOfAlterTSConfigurationStmt creates a deep clone of the input.
func NewAlterTSConfigurationStmt ¶
func NewAlterTSConfigurationStmt(kind AlterTSConfigType, cfgname *NodeList) *AlterTSConfigurationStmt
NewAlterTSConfigurationStmt creates a new AlterTSConfigurationStmt node
func (*AlterTSConfigurationStmt) SqlString ¶
func (n *AlterTSConfigurationStmt) SqlString() string
func (*AlterTSConfigurationStmt) StatementType ¶
func (n *AlterTSConfigurationStmt) StatementType() string
func (*AlterTSConfigurationStmt) String ¶
func (n *AlterTSConfigurationStmt) String() string
type AlterTSDictionaryStmt ¶
type AlterTSDictionaryStmt struct {
BaseNode
Dictname *NodeList `json:"dictname"` // Qualified name (list of String)
Options *NodeList `json:"options"` // List of DefElem nodes
}
AlterTSDictionaryStmt represents ALTER TEXT SEARCH DICTIONARY statements Ported from postgres/src/include/nodes/parsenodes.h:3693-3698
func CloneRefOfAlterTSDictionaryStmt ¶
func CloneRefOfAlterTSDictionaryStmt(n *AlterTSDictionaryStmt) *AlterTSDictionaryStmt
CloneRefOfAlterTSDictionaryStmt creates a deep clone of the input.
func NewAlterTSDictionaryStmt ¶
func NewAlterTSDictionaryStmt(dictname *NodeList, options *NodeList) *AlterTSDictionaryStmt
NewAlterTSDictionaryStmt creates a new AlterTSDictionaryStmt node
func (*AlterTSDictionaryStmt) SqlString ¶
func (n *AlterTSDictionaryStmt) SqlString() string
func (*AlterTSDictionaryStmt) StatementType ¶
func (n *AlterTSDictionaryStmt) StatementType() string
func (*AlterTSDictionaryStmt) String ¶
func (n *AlterTSDictionaryStmt) String() string
type AlterTableCmd ¶
type AlterTableCmd struct {
BaseNode
Subtype AlterTableType // Type of table alteration to apply - postgres/src/include/nodes/parsenodes.h:2429
Name string // column, constraint, or trigger to act on - postgres/src/include/nodes/parsenodes.h:2430
Num int16 // attribute number for columns referenced by number - postgres/src/include/nodes/parsenodes.h:2432
Newowner *RoleSpec // postgres/src/include/nodes/parsenodes.h:2434
Def Node // definition of new column, index, constraint, or parent table - postgres/src/include/nodes/parsenodes.h:2435
Behavior DropBehavior // RESTRICT or CASCADE for DROP cases - postgres/src/include/nodes/parsenodes.h:2437
MissingOk bool // skip error if missing? - postgres/src/include/nodes/parsenodes.h:2438
Recurse bool // exec-time recursion - postgres/src/include/nodes/parsenodes.h:2439
}
AlterTableCmd represents one subcommand of an ALTER TABLE. Ported from postgres/src/include/nodes/parsenodes.h:2426
func CloneRefOfAlterTableCmd ¶
func CloneRefOfAlterTableCmd(n *AlterTableCmd) *AlterTableCmd
CloneRefOfAlterTableCmd creates a deep clone of the input.
func NewAddColumnCmd ¶
func NewAddColumnCmd(columnName string, columnDef Node) *AlterTableCmd
NewAddColumnCmd creates an ALTER TABLE ADD COLUMN command.
func NewAddConstraintCmd ¶
func NewAddConstraintCmd(constraint *Constraint) *AlterTableCmd
NewAddConstraintCmd creates an ALTER TABLE ADD CONSTRAINT command.
func NewAlterTableCmd ¶
func NewAlterTableCmd(subtype AlterTableType, name string, def Node) *AlterTableCmd
NewAlterTableCmd creates a new AlterTableCmd node.
func NewDropColumnCmd ¶
func NewDropColumnCmd(columnName string, behavior DropBehavior) *AlterTableCmd
NewDropColumnCmd creates an ALTER TABLE DROP COLUMN command.
func NewDropConstraintCmd ¶
func NewDropConstraintCmd(constraintName string, behavior DropBehavior) *AlterTableCmd
NewDropConstraintCmd creates an ALTER TABLE DROP CONSTRAINT command.
func (*AlterTableCmd) SqlString ¶
func (a *AlterTableCmd) SqlString() string
func (*AlterTableCmd) SqlStringForCompositeType ¶
func (a *AlterTableCmd) SqlStringForCompositeType() string
SqlStringForCompositeType returns the SQL string for composite type operations using ATTRIBUTE instead of COLUMN
func (*AlterTableCmd) String ¶
func (a *AlterTableCmd) String() string
type AlterTableGroupAction ¶
type AlterTableGroupAction int
AlterTableGroupAction selects the ALTER TABLEGROUP form.
const ( AlterTableGroupRename AlterTableGroupAction = iota AlterTableGroupReshard )
type AlterTableGroupStmt ¶
type AlterTableGroupStmt struct {
BaseNode
Name string
Action AlterTableGroupAction
NewName string // RENAME TO
Sources *NodeList // RESHARD: *String ranges being replaced
Targets *NodeList // RESHARD: *String ranges replacing them
}
AlterTableGroupStmt is ALTER TABLEGROUP name {RENAME TO new_name | RESHARD (sources) INTO (targets)}.
func CloneRefOfAlterTableGroupStmt ¶
func CloneRefOfAlterTableGroupStmt(n *AlterTableGroupStmt) *AlterTableGroupStmt
CloneRefOfAlterTableGroupStmt creates a deep clone of the input.
func NewAlterTableGroupRename ¶
func NewAlterTableGroupRename(name, newName string) *AlterTableGroupStmt
func NewAlterTableGroupReshard ¶
func NewAlterTableGroupReshard(name string, sources, targets *NodeList) *AlterTableGroupStmt
func (*AlterTableGroupStmt) SqlString ¶
func (a *AlterTableGroupStmt) SqlString() string
func (*AlterTableGroupStmt) StatementType ¶
func (a *AlterTableGroupStmt) StatementType() string
type AlterTableMoveAllStmt ¶
type AlterTableMoveAllStmt struct {
BaseNode
OrigTablespacename string // original tablespace name
Objtype ObjectType // Object type to move
Roles *NodeList // List of roles to move objects of
NewTablespacename string // new tablespace name
Nowait bool // do not wait for locks
}
AlterTableMoveAllStmt represents moving all tables/indexes/views from one tablespace to another. Ported from postgres/src/include/nodes/parsenodes.h:2348-2356
func CloneRefOfAlterTableMoveAllStmt ¶
func CloneRefOfAlterTableMoveAllStmt(n *AlterTableMoveAllStmt) *AlterTableMoveAllStmt
CloneRefOfAlterTableMoveAllStmt creates a deep clone of the input.
func NewAlterTableMoveAllStmt ¶
func NewAlterTableMoveAllStmt(origTablespace string, objtype ObjectType, newTablespace string) *AlterTableMoveAllStmt
NewAlterTableMoveAllStmt creates a new AlterTableMoveAllStmt node.
func (*AlterTableMoveAllStmt) SqlString ¶
func (a *AlterTableMoveAllStmt) SqlString() string
func (*AlterTableMoveAllStmt) StatementType ¶
func (a *AlterTableMoveAllStmt) StatementType() string
func (*AlterTableMoveAllStmt) String ¶
func (a *AlterTableMoveAllStmt) String() string
type AlterTableSpaceStmt ¶
type AlterTableSpaceStmt struct {
BaseNode
TablespaceName string `json:"tablespacename"`
Options *NodeList `json:"options"`
IsReset bool `json:"isReset"`
}
AlterTableSpaceStmt represents ALTER TABLESPACE statement
func CloneRefOfAlterTableSpaceStmt ¶
func CloneRefOfAlterTableSpaceStmt(n *AlterTableSpaceStmt) *AlterTableSpaceStmt
CloneRefOfAlterTableSpaceStmt creates a deep clone of the input.
func NewAlterTableSpaceStmt ¶
func NewAlterTableSpaceStmt(name string, options *NodeList, isReset bool) *AlterTableSpaceStmt
func (*AlterTableSpaceStmt) SqlString ¶
func (a *AlterTableSpaceStmt) SqlString() string
SqlString returns the SQL representation of ALTER TABLESPACE statement
func (*AlterTableSpaceStmt) StatementType ¶
func (a *AlterTableSpaceStmt) StatementType() string
func (*AlterTableSpaceStmt) String ¶
func (a *AlterTableSpaceStmt) String() string
type AlterTableStmt ¶
type AlterTableStmt struct {
BaseNode
Relation *RangeVar // table to work on - postgres/src/include/nodes/parsenodes.h:2341
Cmds *NodeList // list of subcommands - postgres/src/include/nodes/parsenodes.h:2342
Objtype ObjectType // type of object - postgres/src/include/nodes/parsenodes.h:2344
MissingOk bool // skip error if table missing - postgres/src/include/nodes/parsenodes.h:2345
}
AlterTableStmt represents an ALTER TABLE statement. Ported from postgres/src/include/nodes/parsenodes.h:2339
func CloneRefOfAlterTableStmt ¶
func CloneRefOfAlterTableStmt(n *AlterTableStmt) *AlterTableStmt
CloneRefOfAlterTableStmt creates a deep clone of the input.
func NewAlterTableStmt ¶
func NewAlterTableStmt(relation *RangeVar, cmds *NodeList) *AlterTableStmt
NewAlterTableStmt creates a new AlterTableStmt node.
func (*AlterTableStmt) SqlString ¶
func (a *AlterTableStmt) SqlString() string
func (*AlterTableStmt) StatementType ¶
func (a *AlterTableStmt) StatementType() string
func (*AlterTableStmt) String ¶
func (a *AlterTableStmt) String() string
type AlterTableType ¶
type AlterTableType int
AlterTableType represents types of ALTER TABLE operations - ported from postgres/src/include/nodes/parsenodes.h:2348-2417
const ( AT_AddColumn AlterTableType = iota // add column AT_AddColumnToView // implicitly via CREATE OR REPLACE VIEW AT_ColumnDefault // alter column default AT_CookedColumnDefault // add a pre-cooked column default AT_DropNotNull // alter column drop not null AT_SetNotNull // alter column set not null AT_SetExpression // alter column set expression AT_DropExpression // alter column drop expression AT_CheckNotNull // check column is already not null AT_SetStatistics // alter column set statistics AT_SetOptions // alter column set (options) AT_ResetOptions // alter column reset (options) AT_SetStorage // alter column set storage AT_SetCompression // alter column set compression AT_DropColumn // drop column AT_AddIndex // add index AT_ReAddIndex // internal to commands/tablecmds.c AT_AddConstraint // add constraint AT_AddConstraintRecurse // internal to commands/tablecmds.c AT_ReAddConstraint // internal to commands/tablecmds.c AT_ReAddDomainConstraint // internal to commands/tablecmds.c AT_AlterConstraint // alter constraint AT_ValidateConstraint // validate constraint AT_AddIndexConstraint // add constraint using existing index AT_DropConstraint // drop constraint AT_ReAddComment // internal to commands/tablecmds.c AT_AlterColumnType // alter column type AT_AlterColumnGenericOptions // alter column OPTIONS (...) AT_ChangeOwner // change owner AT_ClusterOn // CLUSTER ON AT_DropCluster // SET WITHOUT CLUSTER AT_SetLogged // SET LOGGED AT_SetUnLogged // SET UNLOGGED AT_DropOids // SET WITHOUT OIDS AT_SetAccessMethod // SET ACCESS METHOD AT_SetTableSpace // SET TABLESPACE AT_SetRelOptions // SET (...) AT_ResetRelOptions // RESET (...) AT_ReplaceRelOptions // replace reloption list in its entirety AT_EnableTrig // ENABLE TRIGGER name AT_EnableAlwaysTrig // ENABLE ALWAYS TRIGGER name AT_EnableReplicaTrig // ENABLE REPLICA TRIGGER name AT_DisableTrig // DISABLE TRIGGER name AT_EnableTrigAll // ENABLE TRIGGER ALL AT_DisableTrigAll // DISABLE TRIGGER ALL AT_EnableTrigUser // ENABLE TRIGGER USER AT_DisableTrigUser // DISABLE TRIGGER USER AT_EnableRule // ENABLE RULE name AT_EnableAlwaysRule // ENABLE ALWAYS RULE name AT_EnableReplicaRule // ENABLE REPLICA RULE name AT_DisableRule // DISABLE RULE name AT_AddInherit // INHERIT parent AT_DropInherit // NO INHERIT parent AT_AddOf // OF <type_name> AT_DropOf // NOT OF AT_ReplicaIdentity // REPLICA IDENTITY AT_EnableRowSecurity // ENABLE ROW SECURITY AT_DisableRowSecurity // DISABLE ROW SECURITY AT_ForceRowSecurity // FORCE ROW SECURITY AT_NoForceRowSecurity // NO FORCE ROW SECURITY AT_GenericOptions // OPTIONS (...) AT_AttachPartition // ATTACH PARTITION AT_DetachPartition // DETACH PARTITION AT_DetachPartitionFinalize // DETACH PARTITION ... FINALIZE AT_AddIdentity // ADD IDENTITY AT_SetIdentity // SET identity column options AT_DropIdentity // DROP IDENTITY AT_ReAddStatistics // internal to commands/tablecmds.c )
func (AlterTableType) String ¶
func (a AlterTableType) String() string
type AlterTypeStmt ¶
type AlterTypeStmt struct {
BaseNode
TypeName *NodeList `json:"typename"` // type name (possibly qualified)
Options *NodeList `json:"options"` // List of DefElem nodes
}
AlterTypeStmt represents ALTER TYPE statement (for base types) Ported from postgres/src/include/nodes/parsenodes.h AlterTypeStmt
func CloneRefOfAlterTypeStmt ¶
func CloneRefOfAlterTypeStmt(n *AlterTypeStmt) *AlterTypeStmt
CloneRefOfAlterTypeStmt creates a deep clone of the input.
func NewAlterTypeStmt ¶
func NewAlterTypeStmt(typeName *NodeList, options *NodeList) *AlterTypeStmt
func (*AlterTypeStmt) SqlString ¶
func (a *AlterTypeStmt) SqlString() string
SqlString returns the SQL representation of ALTER TYPE statement
func (*AlterTypeStmt) StatementType ¶
func (a *AlterTypeStmt) StatementType() string
func (*AlterTypeStmt) String ¶
func (a *AlterTypeStmt) String() string
type AlterUserMappingStmt ¶
type AlterUserMappingStmt struct {
BaseNode
User *RoleSpec `json:"user"` // user name or role
Servername string `json:"servername"` // server name
Options *NodeList `json:"options"` // OPTIONS clause
}
AlterUserMappingStmt represents ALTER USER MAPPING statement Ported from postgres/src/include/nodes/parsenodes.h AlterUserMappingStmt
func CloneRefOfAlterUserMappingStmt ¶
func CloneRefOfAlterUserMappingStmt(n *AlterUserMappingStmt) *AlterUserMappingStmt
CloneRefOfAlterUserMappingStmt creates a deep clone of the input.
func NewAlterUserMappingStmt ¶
func NewAlterUserMappingStmt(user *RoleSpec, servername string, options *NodeList) *AlterUserMappingStmt
NewAlterUserMappingStmt creates a new AlterUserMappingStmt node
func (*AlterUserMappingStmt) SqlString ¶
func (a *AlterUserMappingStmt) SqlString() string
SqlString returns the SQL representation of AlterUserMappingStmt
func (*AlterUserMappingStmt) StatementType ¶
func (a *AlterUserMappingStmt) StatementType() string
func (*AlterUserMappingStmt) String ¶
func (a *AlterUserMappingStmt) String() string
type AlternativeSubPlan ¶
type AlternativeSubPlan struct {
BaseExpr
Subplans []Expression // SubPlan(s) with equivalent results - primnodes.h:1113
}
AlternativeSubPlan represents alternative execution strategies for a subplan. This allows the executor to choose the most efficient strategy at runtime. Ported from postgres/src/include/nodes/primnodes.h:1108
func CloneRefOfAlternativeSubPlan ¶
func CloneRefOfAlternativeSubPlan(n *AlternativeSubPlan) *AlternativeSubPlan
CloneRefOfAlternativeSubPlan creates a deep clone of the input.
func NewAlternativeSubPlan ¶
func NewAlternativeSubPlan(subplans []Expression) *AlternativeSubPlan
NewAlternativeSubPlan creates a new AlternativeSubPlan node.
func (*AlternativeSubPlan) ExpressionType ¶
func (asp *AlternativeSubPlan) ExpressionType() string
func (*AlternativeSubPlan) String ¶
func (asp *AlternativeSubPlan) String() string
type ApplyFunc ¶
An ApplyFunc is invoked by Rewrite for each node n, even if n is nil, before and/or after the node's children, using a Cursor describing the current node and providing operations on it.
The return value of ApplyFunc controls the syntax tree traversal. See Rewrite for details.
type ArrayCoerceExpr ¶
type ArrayCoerceExpr struct {
BaseExpr
Arg Expression // Input array expression - primnodes.h:1233
Elemexpr Expression // Expression representing per-element work - primnodes.h:1234
Resulttype Oid // Output type OID (array type) - primnodes.h:1235
Resulttypmod int32 // Output typmod (usually -1) - primnodes.h:1236
Resultcollid Oid // OID of collation, or InvalidOid if none - primnodes.h:1237
Coerceformat CoercionForm // How to display this coercion - primnodes.h:1238
}
ArrayCoerceExpr represents array type coercion. This handles coercion of array types, including element-wise coercion. Ported from postgres/src/include/nodes/primnodes.h:1230
func CloneRefOfArrayCoerceExpr ¶
func CloneRefOfArrayCoerceExpr(n *ArrayCoerceExpr) *ArrayCoerceExpr
CloneRefOfArrayCoerceExpr creates a deep clone of the input.
func NewArrayCoerceExpr ¶
func NewArrayCoerceExpr(arg, elemexpr Expression, resulttype Oid, coerceformat CoercionForm) *ArrayCoerceExpr
NewArrayCoerceExpr creates a new ArrayCoerceExpr node.
func NewExplicitArrayCoerceExpr ¶
func NewExplicitArrayCoerceExpr(arg, elemexpr Expression, resulttype Oid) *ArrayCoerceExpr
NewExplicitArrayCoerceExpr creates a new explicit ArrayCoerceExpr.
func (*ArrayCoerceExpr) ExpressionType ¶
func (ace *ArrayCoerceExpr) ExpressionType() string
func (*ArrayCoerceExpr) String ¶
func (ace *ArrayCoerceExpr) String() string
type ArrayExpr ¶
type ArrayExpr struct {
BaseExpr
ArrayTypeid Oid // Array type OID - postgres/src/include/nodes/primnodes.h:1373
ArrayCollid Oid // Array collation - postgres/src/include/nodes/primnodes.h:1374
ElementTypeid Oid // Element type OID - postgres/src/include/nodes/primnodes.h:1375
Elements *NodeList // Array elements - postgres/src/include/nodes/primnodes.h:1376
Multidims bool // Multi-dimensional? - postgres/src/include/nodes/primnodes.h:1377
}
ArrayExpr represents an ARRAY[] constructor expression. Ported from postgres/src/include/nodes/primnodes.h:1370
func CloneRefOfArrayExpr ¶
CloneRefOfArrayExpr creates a deep clone of the input.
func NewArrayConstructor ¶
NewArrayConstructor creates an ARRAY[...] constructor.
func NewArrayExpr ¶
NewArrayExpr creates a new ArrayExpr node.
func (*ArrayExpr) ExpressionType ¶
type AttrNumber ¶
type AttrNumber int16
AttrNumber represents an attribute number - ported from postgres/src/include/access/attnum.h:21
func CloneSliceOfAttrNumber ¶
func CloneSliceOfAttrNumber(n []AttrNumber) []AttrNumber
CloneSliceOfAttrNumber creates a deep clone of the input.
type BaseExpr ¶
type BaseExpr struct {
BaseNode
}
BaseExpr provides common expression functionality.
func CloneBaseExpr ¶
CloneBaseExpr creates a deep clone of the input.
func CloneRefOfBaseExpr ¶
CloneRefOfBaseExpr creates a deep clone of the input.
type BaseNode ¶
type BaseNode struct {
Tag NodeTag // Node type tag - ported from postgres/src/include/nodes/nodes.h:130
Loc int // Source location in bytes - ported from postgres/src/include/nodes/parsenodes.h:6-12
}
BaseNode provides a basic implementation of the Node interface. Other node types should embed this to get default implementations. Ported from postgres base node structure concept
func CloneBaseNode ¶
CloneBaseNode creates a deep clone of the input.
func CloneRefOfBaseNode ¶
CloneRefOfBaseNode creates a deep clone of the input.
func (*BaseNode) SetLocation ¶
SetLocation sets the source location for this node. Used during parsing to track where nodes came from in the source.
type BitString ¶
type BitString struct {
BaseNode
BSVal string // Bit string value with prefix ('b' or 'x') - postgres/src/include/nodes/value.h:76
}
BitString represents a bit string literal value node. Ported from postgres/src/include/nodes/value.h:71-77
func CloneRefOfBitString ¶
CloneRefOfBitString creates a deep clone of the input.
func NewBitString ¶
NewBitString creates a new bit string literal node. Ported from postgres/src/include/nodes/value.h:88 (makeBitString) The value should already include the prefix ('b' or 'x') from the lexer, matching PostgreSQL's scan.l implementation
func (*BitString) ExpressionType ¶
type BoolExpr ¶
type BoolExpr struct {
BaseExpr
Boolop BoolExprType // AND/OR/NOT - postgres/src/include/nodes/primnodes.h:947
Args *NodeList // Operand expressions - postgres/src/include/nodes/primnodes.h:948
}
BoolExpr represents a boolean expression (AND/OR/NOT). Ported from postgres/src/include/nodes/primnodes.h:934
func CloneRefOfBoolExpr ¶
CloneRefOfBoolExpr creates a deep clone of the input.
func NewAndExpr ¶
NewAndExpr creates a new AND boolean expression.
func NewBoolExpr ¶
func NewBoolExpr(boolop BoolExprType, args *NodeList) *BoolExpr
NewBoolExpr creates a new BoolExpr node.
func NewNotExpr ¶
NewNotExpr creates a new NOT boolean expression.
func (*BoolExpr) ExpressionType ¶
type BoolExprType ¶
type BoolExprType int
BoolExprType represents boolean expression types - ported from postgres/src/include/nodes/primnodes.h:929-932
const ( AND_EXPR BoolExprType = iota // AND expression OR_EXPR // OR expression NOT_EXPR // NOT expression )
func (BoolExprType) String ¶
func (b BoolExprType) String() string
type BoolTestType ¶
type BoolTestType int
BoolTestType represents the type of boolean test. Ported from postgres/src/include/nodes/primnodes.h:1974
const ( IS_TRUE BoolTestType = iota // IS TRUE - primnodes.h:1800 IS_NOT_TRUE // IS NOT TRUE - primnodes.h:1801 IS_FALSE // IS FALSE - primnodes.h:1802 IS_NOT_FALSE // IS NOT FALSE - primnodes.h:1803 IS_UNKNOWN // IS UNKNOWN - primnodes.h:1804 IS_NOT_UNKNOWN // IS NOT UNKNOWN - primnodes.h:1805 )
type Boolean ¶
type Boolean struct {
BaseNode
BoolVal bool // Boolean value - postgres/src/include/nodes/value.h:60
}
Boolean represents a boolean literal value node. Ported from postgres/src/include/nodes/value.h:55-61
func CloneRefOfBoolean ¶
CloneRefOfBoolean creates a deep clone of the input.
func NewBoolean ¶
NewBoolean creates a new boolean literal node. Ported from postgres/src/include/nodes/value.h:86 (makeBoolean)
func (*Boolean) ExpressionType ¶
type BooleanTest ¶
type BooleanTest struct {
BaseExpr
Arg Expression // Input expression - primnodes.h:1806
Booltesttype BoolTestType // Kind of test - primnodes.h:1807
}
BooleanTest represents boolean test expressions (IS TRUE, IS FALSE, etc.). These tests handle three-valued boolean logic (TRUE/FALSE/UNKNOWN). Ported from postgres/src/include/nodes/primnodes.h:1979
func CloneRefOfBooleanTest ¶
func CloneRefOfBooleanTest(n *BooleanTest) *BooleanTest
CloneRefOfBooleanTest creates a deep clone of the input.
func NewBooleanTest ¶
func NewBooleanTest(arg Expression, booltesttype BoolTestType) *BooleanTest
NewBooleanTest creates a new BooleanTest node.
func NewIsFalseTest ¶
func NewIsFalseTest(arg Expression) *BooleanTest
NewIsFalseTest creates a new IS FALSE test.
func NewIsTrueTest ¶
func NewIsTrueTest(arg Expression) *BooleanTest
NewIsTrueTest creates a new IS TRUE test.
func NewIsUnknownTest ¶
func NewIsUnknownTest(arg Expression) *BooleanTest
NewIsUnknownTest creates a new IS UNKNOWN test.
func (*BooleanTest) ExpressionType ¶
func (bt *BooleanTest) ExpressionType() string
func (*BooleanTest) SqlString ¶
func (bt *BooleanTest) SqlString() string
SqlString returns the SQL representation of BooleanTest
func (*BooleanTest) String ¶
func (bt *BooleanTest) String() string
type CTECycleClause ¶
type CTECycleClause struct {
BaseNode
CycleColList *NodeList // List of columns to check for cycles - parsenodes.h:1655
CycleMarkColumn string // Name of column to mark cycles - parsenodes.h:1656
CycleMarkValue Expression // Value to set when cycle detected - parsenodes.h:1657
CycleMarkDefault Expression // Value to set when no cycle - parsenodes.h:1658
CyclePathColumn string // Name of column to track path - parsenodes.h:1659
CycleMarkType Oid // Common type of mark_value and mark_default - parsenodes.h:1662
CycleMarkTypmod int32 // Type modifier - parsenodes.h:1663
CycleMarkCollation Oid // Collation - parsenodes.h:1664
CycleMarkNeop Oid // <> operator for type - parsenodes.h:1665
}
CTECycleClause represents a CYCLE clause in recursive CTEs. Ported from postgres/src/include/nodes/parsenodes.h:1652
func CloneRefOfCTECycleClause ¶
func CloneRefOfCTECycleClause(n *CTECycleClause) *CTECycleClause
CloneRefOfCTECycleClause creates a deep clone of the input.
func NewCTECycleClause ¶
func NewCTECycleClause(cycleColList *NodeList, markColumn string, markValue, markDefault Expression, pathColumn string) *CTECycleClause
NewCTECycleClause creates a new CTECycleClause node.
func (*CTECycleClause) SqlString ¶
func (cc *CTECycleClause) SqlString() string
SqlString returns the SQL representation of the CTECycleClause.
type CTEMaterialized ¶
type CTEMaterialized int
CTEMaterialized represents CTE materialization settings. Ported from postgres/src/include/nodes/parsenodes.h:1636
const ( CTEMaterializeDefault CTEMaterialized = iota // No materialization clause - parsenodes.h:1638 CTEMaterializeAlways // MATERIALIZED - parsenodes.h:1639 CTEMaterializeNever // NOT MATERIALIZED - parsenodes.h:1640 )
type CTESearchClause ¶
type CTESearchClause struct {
BaseNode
SearchColList *NodeList // List of columns to search - parsenodes.h:1646
SearchBreadthFirst bool // True for BREADTH FIRST, false for DEPTH FIRST - parsenodes.h:1647
SearchSeqColumn string // Name of column to set search sequence - parsenodes.h:1648
}
CTESearchClause represents a SEARCH clause in recursive CTEs. Ported from postgres/src/include/nodes/parsenodes.h:1643
func CloneRefOfCTESearchClause ¶
func CloneRefOfCTESearchClause(n *CTESearchClause) *CTESearchClause
CloneRefOfCTESearchClause creates a deep clone of the input.
func NewCTESearchClause ¶
func NewCTESearchClause(searchColList *NodeList, breadthFirst bool, seqColumn string) *CTESearchClause
NewCTESearchClause creates a new CTESearchClause node.
func (*CTESearchClause) SqlString ¶
func (sc *CTESearchClause) SqlString() string
SqlString returns the SQL representation of the CTESearchClause.
type CallStmt ¶
CallStmt represents CALL statements Ported from postgres/src/include/nodes/parsenodes.h:3451-3458
func CloneRefOfCallStmt ¶
CloneRefOfCallStmt creates a deep clone of the input.
func NewCallStmt ¶
NewCallStmt creates a new CallStmt node
func (*CallStmt) StatementType ¶
type Cardinality ¶
type Cardinality float64 // Row count estimates
Type aliases for PostgreSQL types
type CaseExpr ¶
type CaseExpr struct {
BaseExpr
Casetype Oid // Result type - postgres/src/include/nodes/primnodes.h:1309
Casecollid Oid // Result collation - postgres/src/include/nodes/primnodes.h:1310
Arg Node // Implicit comparison argument - postgres/src/include/nodes/primnodes.h:1311
Args *NodeList // List of WHEN clauses - postgres/src/include/nodes/primnodes.h:1312
Defresult Node // Default result (ELSE) - postgres/src/include/nodes/primnodes.h:1313
}
CaseExpr represents a CASE expression. Ported from postgres/src/include/nodes/primnodes.h:1306
func CloneRefOfCaseExpr ¶
CloneRefOfCaseExpr creates a deep clone of the input.
func NewCaseExpr ¶
NewCaseExpr creates a new CaseExpr node.
func NewSearchedCase ¶
NewSearchedCase creates a searched CASE expression: CASE WHEN condition1 THEN result1 ... ELSE def END
func NewSimpleCase ¶
NewSimpleCase creates a simple CASE expression: CASE expr WHEN val1 THEN result1 ... ELSE def END
func (*CaseExpr) ExpressionType ¶
type CaseTestExpr ¶
type CaseTestExpr struct {
BaseExpr
TypeId Oid // Type for substituted value
TypeMod int // Typemod for substituted value
Collation Oid // Collation for the substituted value
}
CaseTestExpr represents a CASE test expression Ported from postgres/src/include/nodes/primnodes.h:1352-1359
func CloneRefOfCaseTestExpr ¶
func CloneRefOfCaseTestExpr(n *CaseTestExpr) *CaseTestExpr
CloneRefOfCaseTestExpr creates a deep clone of the input.
func NewCaseTestExpr ¶
func NewCaseTestExpr(typeId Oid, typeMod int, collation Oid, location int) *CaseTestExpr
NewCaseTestExpr creates a new CaseTestExpr node.
func (*CaseTestExpr) ExpressionType ¶
func (c *CaseTestExpr) ExpressionType() string
func (*CaseTestExpr) String ¶
func (c *CaseTestExpr) String() string
type CaseWhen ¶
type CaseWhen struct {
BaseExpr
Expr Node // Condition expression - postgres/src/include/nodes/primnodes.h:1325
Result Node // Result expression - postgres/src/include/nodes/primnodes.h:1326
}
CaseWhen represents a WHEN clause in a CASE expression. Ported from postgres/src/include/nodes/primnodes.h:1322
func CloneRefOfCaseWhen ¶
CloneRefOfCaseWhen creates a deep clone of the input.
func NewCaseWhen ¶
NewCaseWhen creates a new CaseWhen node.
func (*CaseWhen) ExpressionType ¶
type CheckPointStmt ¶
type CheckPointStmt struct {
BaseNode
}
CheckPointStmt represents a CHECKPOINT statement. Ported from postgres/src/include/nodes/parsenodes.h:3914-3917
func CloneRefOfCheckPointStmt ¶
func CloneRefOfCheckPointStmt(n *CheckPointStmt) *CheckPointStmt
CloneRefOfCheckPointStmt creates a deep clone of the input.
func NewCheckPointStmt ¶
func NewCheckPointStmt() *CheckPointStmt
NewCheckPointStmt creates a new CHECKPOINT statement.
func (*CheckPointStmt) SqlString ¶
func (cps *CheckPointStmt) SqlString() string
func (*CheckPointStmt) StatementType ¶
func (cps *CheckPointStmt) StatementType() string
func (*CheckPointStmt) String ¶
func (cps *CheckPointStmt) String() string
type ClosePortalStmt ¶
type ClosePortalStmt struct {
BaseNode
PortalName string // name of the portal (cursor); nil means CLOSE ALL
}
ClosePortalStmt represents a CLOSE statement Ported from postgres/src/include/nodes/parsenodes.h:3305-3310
func CloneRefOfClosePortalStmt ¶
func CloneRefOfClosePortalStmt(n *ClosePortalStmt) *ClosePortalStmt
CloneRefOfClosePortalStmt creates a deep clone of the input.
func NewClosePortalStmt ¶
func NewClosePortalStmt(portalName string) *ClosePortalStmt
NewClosePortalStmt creates a new ClosePortalStmt node
func (*ClosePortalStmt) SqlString ¶
func (cps *ClosePortalStmt) SqlString() string
SqlString returns the SQL representation of the CLOSE statement
func (*ClosePortalStmt) StatementType ¶
func (cps *ClosePortalStmt) StatementType() string
func (*ClosePortalStmt) String ¶
func (cps *ClosePortalStmt) String() string
String returns string representation of ClosePortalStmt
type ClusterStmt ¶
type ClusterStmt struct {
BaseNode
Relation *RangeVar // Relation to cluster - postgres/src/include/nodes/parsenodes.h:3825
Indexname string // Index name or NULL - postgres/src/include/nodes/parsenodes.h:3826
Params *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:3827
}
ClusterStmt represents a CLUSTER statement. Ported from postgres/src/include/nodes/parsenodes.h:3822-3828
func CloneRefOfClusterStmt ¶
func CloneRefOfClusterStmt(n *ClusterStmt) *ClusterStmt
CloneRefOfClusterStmt creates a deep clone of the input.
func NewClusterStmt ¶
func NewClusterStmt(relation *RangeVar, indexname string, params *NodeList) *ClusterStmt
NewClusterStmt creates a new CLUSTER statement.
func (*ClusterStmt) SqlString ¶
func (cs *ClusterStmt) SqlString() string
func (*ClusterStmt) StatementType ¶
func (cs *ClusterStmt) StatementType() string
func (*ClusterStmt) String ¶
func (cs *ClusterStmt) String() string
type CmdType ¶
type CmdType int
CmdType represents the type of SQL command - ported from postgres/src/include/nodes/nodes.h:262
const ( CMD_UNKNOWN CmdType = iota // Unknown command type CMD_SELECT // SELECT statement CMD_UPDATE // UPDATE statement CMD_INSERT // INSERT statement CMD_DELETE // DELETE statement CMD_MERGE // MERGE statement CMD_UTILITY // Utility commands (CREATE, DROP, etc.) CMD_NOTHING // Dummy command for INSTEAD NOTHING rules )
type CoalesceExpr ¶
type CoalesceExpr struct {
BaseExpr
Coalescetype Oid // Result type - postgres/src/include/nodes/primnodes.h:1487
Coalescecollid Oid // Result collation - postgres/src/include/nodes/primnodes.h:1488
Args *NodeList // Argument expressions - postgres/src/include/nodes/primnodes.h:1489
}
CoalesceExpr represents a COALESCE expression. Ported from postgres/src/include/nodes/primnodes.h:1484
func CloneRefOfCoalesceExpr ¶
func CloneRefOfCoalesceExpr(n *CoalesceExpr) *CoalesceExpr
CloneRefOfCoalesceExpr creates a deep clone of the input.
func NewCoalesceExpr ¶
func NewCoalesceExpr(coalescetype Oid, args *NodeList) *CoalesceExpr
NewCoalesceExpr creates a new CoalesceExpr node.
func (*CoalesceExpr) ExpressionType ¶
func (c *CoalesceExpr) ExpressionType() string
func (*CoalesceExpr) SqlString ¶
func (c *CoalesceExpr) SqlString() string
SqlString returns the SQL representation of CoalesceExpr
func (*CoalesceExpr) String ¶
func (c *CoalesceExpr) String() string
type CoerceToDomain ¶
type CoerceToDomain struct {
BaseExpr
Arg Expression // Input expression - primnodes.h:1716
Resulttype Oid // Domain type OID - primnodes.h:1717
Resulttypmod int32 // Output typmod (usually -1) - primnodes.h:1718
Resultcollid Oid // OID of collation, or InvalidOid if none - primnodes.h:1719
Coercionformat CoercionForm // How to display this coercion - primnodes.h:1720
}
CoerceToDomain represents coercion to a domain type. Domain types are user-defined types with constraints. Ported from postgres/src/include/nodes/primnodes.h:2025
func CloneRefOfCoerceToDomain ¶
func CloneRefOfCoerceToDomain(n *CoerceToDomain) *CoerceToDomain
CloneRefOfCoerceToDomain creates a deep clone of the input.
func NewCoerceToDomain ¶
func NewCoerceToDomain(arg Expression, resulttype Oid, resulttypmod int32, coercionformat CoercionForm) *CoerceToDomain
NewCoerceToDomain creates a new CoerceToDomain node.
func (*CoerceToDomain) ExpressionType ¶
func (ctd *CoerceToDomain) ExpressionType() string
func (*CoerceToDomain) String ¶
func (ctd *CoerceToDomain) String() string
type CoerceToDomainValue ¶
type CoerceToDomainValue struct {
BaseExpr
TypeId Oid // Type for substituted value - primnodes.h:2051
TypeMod int32 // Typemod for substituted value - primnodes.h:2052
Collation Oid // Collation for the substituted value - primnodes.h:2053
}
CoerceToDomainValue represents a value being coerced to a domain type. This is used in domain constraint checking. Ported from postgres/src/include/nodes/primnodes.h:2048
func CloneRefOfCoerceToDomainValue ¶
func CloneRefOfCoerceToDomainValue(n *CoerceToDomainValue) *CoerceToDomainValue
CloneRefOfCoerceToDomainValue creates a deep clone of the input.
func NewCoerceToDomainValue ¶
func NewCoerceToDomainValue(typeId Oid, typeMod int32, collation Oid) *CoerceToDomainValue
NewCoerceToDomainValue creates a new CoerceToDomainValue node.
func (*CoerceToDomainValue) ExpressionType ¶
func (ctdv *CoerceToDomainValue) ExpressionType() string
func (*CoerceToDomainValue) String ¶
func (ctdv *CoerceToDomainValue) String() string
type CoerceViaIO ¶
type CoerceViaIO struct {
BaseExpr
Arg Expression // Input expression - primnodes.h:1207
Resulttype Oid // Output type OID - primnodes.h:1208
Resultcollid Oid // OID of collation, or InvalidOid if none - primnodes.h:1210
Coerceformat CoercionForm // How to display this coercion - primnodes.h:1211
}
CoerceViaIO represents type coercion through I/O functions. This is used when types need to be converted by invoking their I/O functions (output function of source type, input function of target type). Ported from postgres/src/include/nodes/primnodes.h:1204
func CloneRefOfCoerceViaIO ¶
func CloneRefOfCoerceViaIO(n *CoerceViaIO) *CoerceViaIO
CloneRefOfCoerceViaIO creates a deep clone of the input.
func NewCoerceViaIO ¶
func NewCoerceViaIO(arg Expression, resulttype Oid, coerceformat CoercionForm) *CoerceViaIO
NewCoerceViaIO creates a new CoerceViaIO node.
func NewExplicitCoerceViaIO ¶
func NewExplicitCoerceViaIO(arg Expression, resulttype Oid) *CoerceViaIO
NewExplicitCoerceViaIO creates a new CoerceViaIO for explicit coercion.
func (*CoerceViaIO) ExpressionType ¶
func (cvio *CoerceViaIO) ExpressionType() string
func (*CoerceViaIO) String ¶
func (cvio *CoerceViaIO) String() string
type CoercionContext ¶
type CoercionContext int
CoercionContext represents the context for type coercion operations Ported from postgres/src/include/nodes/primnodes.h:712-718
const ( COERCION_IMPLICIT CoercionContext = iota // coercion in context of expression COERCION_ASSIGNMENT // coercion in context of assignment COERCION_PLPGSQL // if no assignment cast, use CoerceViaIO COERCION_EXPLICIT // explicit cast operation )
func (CoercionContext) String ¶
func (cc CoercionContext) String() string
String returns string representation of CoercionContext
type CoercionForm ¶
type CoercionForm int
CoercionForm represents type coercion forms - ported from postgres/src/include/nodes/primnodes.h:732-737
const ( COERCE_EXPLICIT_CALL CoercionForm = iota // Explicit function call syntax COERCE_EXPLICIT_CAST // Explicit cast syntax COERCE_IMPLICIT_CAST // Implicit cast COERCE_SQL_SYNTAX // SQL standard syntax )
type CollateClause ¶
type CollateClause struct {
BaseNode
Arg Node // input expression
Collname *NodeList // possibly-qualified collation name
}
CollateClause represents a COLLATE clause. This is a placeholder implementation - full CollateClause from parsenodes.h will be implemented later
func CloneRefOfCollateClause ¶
func CloneRefOfCollateClause(n *CollateClause) *CollateClause
CloneRefOfCollateClause creates a deep clone of the input.
func NewCollateClause ¶
func NewCollateClause(collname *NodeList) *CollateClause
NewCollateClause creates a new CollateClause node.
func (*CollateClause) SqlString ¶
func (c *CollateClause) SqlString() string
SqlString generates SQL representation of a COLLATE clause
func (*CollateClause) String ¶
func (c *CollateClause) String() string
type CollateExpr ¶
type CollateExpr struct {
BaseExpr
Arg Expression // Input expression - primnodes.h:1649
CollOid Oid // Collation OID - primnodes.h:1650
}
CollateExpr represents a COLLATE expression. This specifies a collation to be used for a particular expression. Ported from postgres/src/include/nodes/primnodes.h:1276
func CloneRefOfCollateExpr ¶
func CloneRefOfCollateExpr(n *CollateExpr) *CollateExpr
CloneRefOfCollateExpr creates a deep clone of the input.
func NewCollateExpr ¶
func NewCollateExpr(arg Expression, collOid Oid) *CollateExpr
NewCollateExpr creates a new CollateExpr node.
func (*CollateExpr) ExpressionType ¶
func (ce *CollateExpr) ExpressionType() string
func (*CollateExpr) String ¶
func (ce *CollateExpr) String() string
type ColumnDef ¶
type ColumnDef struct {
BaseNode
Colname string // Name of the column
TypeName *TypeName // Type of the column
Compression string // Compression method, or NULL
Inhcount int // Number of times column is inherited
IsLocal bool // Column is defined locally
IsNotNull bool // NOT NULL constraint specified
IsFromType bool // Column definition came from table type
StorageType char // Storage type (TOAST)
StorageName string // Storage setting name or NULL for default
RawDefault Node // Default value (untransformed parse tree)
CookedDefault Node // Default value (transformed)
Identity char // IDENTITY property
IdentitySeq *RangeVar // To store identity sequence name for ALTER TABLE
Generated char // GENERATED property
Collclause *CollateClause // Collation, if any
CollOid Oid // Collation OID (InvalidOid if not set)
Constraints *NodeList // Column constraints
Fdwoptions *NodeList // Foreign-data-wrapper specific options
}
ColumnDef represents a complete column definition in CREATE TABLE. Ported from postgres/src/include/nodes/parsenodes.h:723-750
func CloneRefOfColumnDef ¶
CloneRefOfColumnDef creates a deep clone of the input.
func NewColumnDef ¶
NewColumnDef creates a new ColumnDef node.
func (*ColumnDef) StatementType ¶
type ColumnRef ¶
type ColumnRef struct {
BaseNode
Fields *NodeList // List of field names - postgres/src/include/nodes/parsenodes.h:292
}
ColumnRef represents a column reference in expressions. Ported from postgres/src/include/nodes/parsenodes.h:291
func CloneRefOfColumnRef ¶
CloneRefOfColumnRef creates a deep clone of the input.
func NewColumnRef ¶
NewColumnRef creates a new ColumnRef node.
func (*ColumnRef) ExpressionType ¶
type CommentStmt ¶
type CommentStmt struct {
BaseNode
Objtype ObjectType `json:"objtype"` // Object's type
Object Node `json:"object"` // Qualified name of the object
Comment string `json:"comment"` // Comment to insert, or NULL to remove
}
CommentStmt represents COMMENT ON statements Ported from postgres/src/include/nodes/parsenodes.h:3252-3258
func CloneRefOfCommentStmt ¶
func CloneRefOfCommentStmt(n *CommentStmt) *CommentStmt
CloneRefOfCommentStmt creates a deep clone of the input.
func NewCommentStmt ¶
func NewCommentStmt(objtype ObjectType, object Node, comment string) *CommentStmt
NewCommentStmt creates a new CommentStmt node
func (*CommentStmt) SqlString ¶
func (n *CommentStmt) SqlString() string
func (*CommentStmt) StatementType ¶
func (n *CommentStmt) StatementType() string
func (*CommentStmt) String ¶
func (n *CommentStmt) String() string
type CommonTableExpr ¶
type CommonTableExpr struct {
BaseNode
Ctename string // Query name (never qualified) - parsenodes.h:1676
Aliascolnames *NodeList // Optional list of column names - parsenodes.h:1678
Ctematerialized CTEMaterialized // Is this an optimization fence? - parsenodes.h:1679
Ctequery Node // The CTE's subquery - parsenodes.h:1681
SearchClause *CTESearchClause // SEARCH clause, if any - parsenodes.h:1682
CycleClause *CTECycleClause // CYCLE clause, if any - parsenodes.h:1683
Cterecursive bool // Is this a recursive CTE? - parsenodes.h:1687
Cterefcount int // Number of RTEs referencing this CTE - parsenodes.h:1693
Ctecolnames *NodeList // List of output column names - parsenodes.h:1696
Ctecoltypes []Oid // OID list of output column type OIDs - parsenodes.h:1697
Ctecoltypmods []int32 // Integer list of output column typmods - parsenodes.h:1698
Ctecolcollations []Oid // OID list of column collation OIDs - parsenodes.h:1699
}
CommonTableExpr represents a WITH clause (Common Table Expression / CTE). CTEs are increasingly common in modern SQL and enable recursive queries and improved query organization. Ported from postgres/src/include/nodes/parsenodes.h:1668
func CloneRefOfCommonTableExpr ¶
func CloneRefOfCommonTableExpr(n *CommonTableExpr) *CommonTableExpr
CloneRefOfCommonTableExpr creates a deep clone of the input.
func CloneSliceOfRefOfCommonTableExpr ¶
func CloneSliceOfRefOfCommonTableExpr(n []*CommonTableExpr) []*CommonTableExpr
CloneSliceOfRefOfCommonTableExpr creates a deep clone of the input.
func NewCommonTableExpr ¶
func NewCommonTableExpr(ctename string, ctequery Node) *CommonTableExpr
NewCommonTableExpr creates a new CommonTableExpr node.
func NewRecursiveCommonTableExpr ¶
func NewRecursiveCommonTableExpr(ctename string, ctequery Node) *CommonTableExpr
NewRecursiveCommonTableExpr creates a new recursive CommonTableExpr node.
func (*CommonTableExpr) SqlString ¶
func (c *CommonTableExpr) SqlString() string
SqlString returns the SQL representation of the CommonTableExpr
func (*CommonTableExpr) String ¶
func (cte *CommonTableExpr) String() string
type CompositeTypeStmt ¶
type CompositeTypeStmt struct {
BaseNode
Typevar *RangeVar // the composite type name
Coldeflist *NodeList // list of ColumnDef nodes
}
CompositeTypeStmt represents a CREATE TYPE ... AS (...) statement Ported from postgres/src/include/nodes/parsenodes.h:3684
func CloneRefOfCompositeTypeStmt ¶
func CloneRefOfCompositeTypeStmt(n *CompositeTypeStmt) *CompositeTypeStmt
CloneRefOfCompositeTypeStmt creates a deep clone of the input.
func NewCompositeTypeStmt ¶
func NewCompositeTypeStmt(typevar *RangeVar, coldeflist *NodeList) *CompositeTypeStmt
NewCompositeTypeStmt creates a new CompositeTypeStmt node
func (*CompositeTypeStmt) SqlString ¶
func (cts *CompositeTypeStmt) SqlString() string
SqlString returns the SQL representation of CompositeTypeStmt
func (*CompositeTypeStmt) StatementType ¶
func (cts *CompositeTypeStmt) StatementType() string
StatementType returns the statement type
func (*CompositeTypeStmt) String ¶
func (cts *CompositeTypeStmt) String() string
String returns string representation of CompositeTypeStmt
type Const ¶
type Const struct {
BaseExpr
Consttype Oid // Datatype OID - postgres/src/include/nodes/primnodes.h:308
Consttypmod int32 // Type modifier - postgres/src/include/nodes/primnodes.h:309
Constcollid Oid // Collation OID - postgres/src/include/nodes/primnodes.h:310
Constlen int // Type length - postgres/src/include/nodes/primnodes.h:311
Constvalue Datum // The actual value - postgres/src/include/nodes/primnodes.h:312
Constisnull bool // Whether null - postgres/src/include/nodes/primnodes.h:313
Constbyval bool // Pass by value? - postgres/src/include/nodes/primnodes.h:315
}
Const represents a constant value in an expression. Ported from postgres/src/include/nodes/primnodes.h:306
func CloneRefOfConst ¶
CloneRefOfConst creates a deep clone of the input.
func (*Const) ExpressionType ¶
type ConstrType ¶
type ConstrType int
ConstrType represents types of constraints - ported from postgres/src/include/nodes/parsenodes.h:2697-2714
const ( CONSTR_NULL ConstrType = iota // not standard SQL, but expected CONSTR_NOTNULL CONSTR_DEFAULT CONSTR_IDENTITY CONSTR_GENERATED CONSTR_CHECK CONSTR_PRIMARY CONSTR_UNIQUE CONSTR_EXCLUSION CONSTR_FOREIGN CONSTR_ATTR_DEFERRABLE // attributes for previous constraint node CONSTR_ATTR_NOT_DEFERRABLE CONSTR_ATTR_DEFERRED CONSTR_ATTR_IMMEDIATE )
func (ConstrType) String ¶
func (c ConstrType) String() string
type Constraint ¶
type Constraint struct {
BaseNode
Contype ConstrType // see above - postgres/src/include/nodes/parsenodes.h:2731
Conname string // Constraint name, or NULL if unnamed - postgres/src/include/nodes/parsenodes.h:2732
Deferrable bool // DEFERRABLE? - postgres/src/include/nodes/parsenodes.h:2733
Initdeferred bool // INITIALLY DEFERRED? - postgres/src/include/nodes/parsenodes.h:2734
SkipValidation bool // skip validation of existing rows? - postgres/src/include/nodes/parsenodes.h:2735
InitiallyValid bool // mark the new constraint as valid? - postgres/src/include/nodes/parsenodes.h:2736
IsNoInherit bool // is constraint non-inheritable? - postgres/src/include/nodes/parsenodes.h:2737
RawExpr Node // CHECK or DEFAULT expression, as untransformed parse tree - postgres/src/include/nodes/parsenodes.h:2738
CookedExpr string // CHECK or DEFAULT expression, as nodeToString representation - postgres/src/include/nodes/parsenodes.h:2740
GeneratedWhen byte // ALWAYS or BY DEFAULT - postgres/src/include/nodes/parsenodes.h:2742
Inhcount int // initial inheritance count to apply - postgres/src/include/nodes/parsenodes.h:2743
NullsNotDistinct bool // null treatment for UNIQUE constraints - postgres/src/include/nodes/parsenodes.h:2744
Keys *NodeList // String nodes naming referenced key column(s) - postgres/src/include/nodes/parsenodes.h:2746
Including *NodeList // String nodes naming referenced nonkey column(s) - postgres/src/include/nodes/parsenodes.h:2747
Exclusions *NodeList // list of (IndexElem, operator name) pairs - postgres/src/include/nodes/parsenodes.h:2748
Options *NodeList // options from WITH clause - postgres/src/include/nodes/parsenodes.h:2749
Indexname string // existing index to use; otherwise NULL - postgres/src/include/nodes/parsenodes.h:2750
Indexspace string // index tablespace; NULL for default - postgres/src/include/nodes/parsenodes.h:2751
ResetDefaultTblspc bool // reset default_tablespace prior to creating the index - postgres/src/include/nodes/parsenodes.h:2752
AccessMethod string // access method to use for the index - postgres/src/include/nodes/parsenodes.h:2753
WhereClause Node // partial index predicate - postgres/src/include/nodes/parsenodes.h:2754
Pktable *RangeVar // Primary key table for FOREIGN KEY - postgres/src/include/nodes/parsenodes.h:2755
FkAttrs *NodeList // Attributes of foreign key - postgres/src/include/nodes/parsenodes.h:2756
PkAttrs *NodeList // Corresponding attrs in PK table - postgres/src/include/nodes/parsenodes.h:2757
FkMatchtype byte // FULL, PARTIAL, SIMPLE - postgres/src/include/nodes/parsenodes.h:2758
FkUpdAction byte // ON UPDATE action - postgres/src/include/nodes/parsenodes.h:2759
FkDelAction byte // ON DELETE action - postgres/src/include/nodes/parsenodes.h:2760
FkDelSetCols *NodeList // ON DELETE SET NULL/DEFAULT (column_list) - postgres/src/include/nodes/parsenodes.h:2761
OldConpfeqop []Oid // pg_constraint.conpfeqop of my former self - postgres/src/include/nodes/parsenodes.h:2762
OldPktableOid Oid // pg_class.oid of my former self - postgres/src/include/nodes/parsenodes.h:2763
}
Constraint represents a constraint definition. Ported from postgres/src/include/nodes/parsenodes.h:2728
func CloneRefOfConstraint ¶
func CloneRefOfConstraint(n *Constraint) *Constraint
CloneRefOfConstraint creates a deep clone of the input.
func CloneSliceOfRefOfConstraint ¶
func CloneSliceOfRefOfConstraint(n []*Constraint) []*Constraint
CloneSliceOfRefOfConstraint creates a deep clone of the input.
func NewCheckConstraint ¶
func NewCheckConstraint(conname string, rawExpr Node) *Constraint
NewCheckConstraint creates a CHECK constraint.
func NewConstraint ¶
func NewConstraint(contype ConstrType) *Constraint
NewConstraint creates a new Constraint node.
func NewForeignKeyConstraint ¶
func NewForeignKeyConstraint(conname string, fkAttrs []string, pktable *RangeVar, pkAttrs []string) *Constraint
NewForeignKeyConstraint creates a FOREIGN KEY constraint.
func NewNotNullConstraint ¶
func NewNotNullConstraint(conname string) *Constraint
NewNotNullConstraint creates a NOT NULL constraint.
func NewPrimaryKeyConstraint ¶
func NewPrimaryKeyConstraint(conname string, keys []string) *Constraint
NewPrimaryKeyConstraint creates a PRIMARY KEY constraint.
func NewUniqueConstraint ¶
func NewUniqueConstraint(conname string, keys []string) *Constraint
NewUniqueConstraint creates a UNIQUE constraint.
func NewUniqueConstraintNullsNotDistinct ¶
func NewUniqueConstraintNullsNotDistinct(conname string, keys []string) *Constraint
NewUniqueConstraintNullsNotDistinct creates a UNIQUE constraint with NULLS NOT DISTINCT.
func (*Constraint) GetFkAttrs ¶
func (c *Constraint) GetFkAttrs() []string
GetFkAttrs returns the FkAttrs as a slice of strings for testing purposes
func (*Constraint) GetFkDelSetCols ¶
func (c *Constraint) GetFkDelSetCols() []string
GetFkDelSetCols returns the FkDelSetCols as a slice of strings for testing purposes
func (*Constraint) GetIncluding ¶
func (c *Constraint) GetIncluding() []string
GetIncluding returns the Including as a slice of strings for testing purposes
func (*Constraint) GetKeys ¶
func (c *Constraint) GetKeys() []string
GetKeys returns the Keys as a slice of strings for testing purposes
func (*Constraint) GetPkAttrs ¶
func (c *Constraint) GetPkAttrs() []string
GetPkAttrs returns the PkAttrs as a slice of strings for testing purposes
func (*Constraint) SqlString ¶
func (c *Constraint) SqlString() string
SqlString generates SQL representation of a constraint
func (*Constraint) String ¶
func (c *Constraint) String() string
type ConstraintsSetStmt ¶
type ConstraintsSetStmt struct {
BaseNode
Constraints *NodeList `json:"constraints"` // List of names as RangeVars
Deferred bool `json:"deferred"` // true=DEFERRED, false=IMMEDIATE
}
ConstraintsSetStmt represents SET CONSTRAINTS statement Ported from postgres/src/include/nodes/parsenodes.h
func CloneRefOfConstraintsSetStmt ¶
func CloneRefOfConstraintsSetStmt(n *ConstraintsSetStmt) *ConstraintsSetStmt
CloneRefOfConstraintsSetStmt creates a deep clone of the input.
func NewConstraintsSetStmt ¶
func NewConstraintsSetStmt(constraints *NodeList, deferred bool) *ConstraintsSetStmt
NewConstraintsSetStmt creates a new ConstraintsSetStmt node
func (*ConstraintsSetStmt) SqlString ¶
func (n *ConstraintsSetStmt) SqlString() string
SqlString returns the SQL representation of the SET CONSTRAINTS statement
func (*ConstraintsSetStmt) StatementType ¶
func (n *ConstraintsSetStmt) StatementType() string
StatementType returns the statement type
func (*ConstraintsSetStmt) String ¶
func (n *ConstraintsSetStmt) String() string
String returns a string representation of the ConstraintsSetStmt
type ConvertRowtypeExpr ¶
type ConvertRowtypeExpr struct {
BaseExpr
Arg Expression // Input expression - primnodes.h:1706
Resulttype Oid // Output type (always a composite type) - primnodes.h:1707
Convertformat CoercionForm // How to display this node - primnodes.h:1708
}
ConvertRowtypeExpr represents row type conversion. This converts a whole-row value from one composite type to another. Ported from postgres/src/include/nodes/primnodes.h:1258
func CloneRefOfConvertRowtypeExpr ¶
func CloneRefOfConvertRowtypeExpr(n *ConvertRowtypeExpr) *ConvertRowtypeExpr
CloneRefOfConvertRowtypeExpr creates a deep clone of the input.
func NewConvertRowtypeExpr ¶
func NewConvertRowtypeExpr(arg Expression, resulttype Oid, convertformat CoercionForm) *ConvertRowtypeExpr
NewConvertRowtypeExpr creates a new ConvertRowtypeExpr node.
func (*ConvertRowtypeExpr) ExpressionType ¶
func (crte *ConvertRowtypeExpr) ExpressionType() string
func (*ConvertRowtypeExpr) String ¶
func (crte *ConvertRowtypeExpr) String() string
type CopyStmt ¶
type CopyStmt struct {
BaseNode
Relation *RangeVar // Relation to copy - postgres/src/include/nodes/parsenodes.h:2589
Query Node // Query to copy (SELECT/INSERT/UPDATE/DELETE) - postgres/src/include/nodes/parsenodes.h:2590
Attlist *NodeList // List of column names (or NIL for all columns) - postgres/src/include/nodes/parsenodes.h:2591
IsFrom bool // TO or FROM - postgres/src/include/nodes/parsenodes.h:2592
IsProgram bool // Is 'filename' a program to popen? - postgres/src/include/nodes/parsenodes.h:2593
Filename string // Filename, or NULL for STDIN/STDOUT - postgres/src/include/nodes/parsenodes.h:2594
Options *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:2595
WhereClause Node // WHERE condition (for COPY FROM WHERE) - postgres/src/include/nodes/parsenodes.h:2596
}
CopyStmt represents a COPY statement. Ported from postgres/src/include/nodes/parsenodes.h:2586
func CloneRefOfCopyStmt ¶
CloneRefOfCopyStmt creates a deep clone of the input.
func NewCopyFromStmt ¶
NewCopyFromStmt creates a new COPY FROM statement.
func NewCopyStmt ¶
NewCopyStmt creates a new COPY statement.
func NewCopyToStmt ¶
NewCopyToStmt creates a new COPY TO statement.
func (*CopyStmt) StatementType ¶
type CreateAmStmt ¶
type CreateAmStmt struct {
BaseNode
AmName string `json:"amname"`
HandlerName *NodeList `json:"handler_name"`
AmType AmType `json:"amtype"`
}
CreateAmStmt represents CREATE ACCESS METHOD statement
func CloneRefOfCreateAmStmt ¶
func CloneRefOfCreateAmStmt(n *CreateAmStmt) *CreateAmStmt
CloneRefOfCreateAmStmt creates a deep clone of the input.
func NewCreateAmStmt ¶
func NewCreateAmStmt(name string, amType AmType, handler *NodeList) *CreateAmStmt
func (*CreateAmStmt) SqlString ¶
func (c *CreateAmStmt) SqlString() string
SqlString returns the SQL representation of CREATE ACCESS METHOD statement
func (*CreateAmStmt) StatementType ¶
func (c *CreateAmStmt) StatementType() string
func (*CreateAmStmt) String ¶
func (c *CreateAmStmt) String() string
type CreateAssertionStmt ¶
type CreateAssertionStmt struct {
BaseNode
Name *NodeList // Assertion name (qualified name)
CheckClause Node // Check constraint expression
ConstraintAttrSpec *NodeList // Constraint attributes (e.g., DEFERRABLE)
}
CreateAssertionStmt represents CREATE ASSERTION statement Note: This is not yet implemented in PostgreSQL but the grammar rule exists Ported from postgres/src/backend/parser/gram.y:9847-9855
func CloneRefOfCreateAssertionStmt ¶
func CloneRefOfCreateAssertionStmt(n *CreateAssertionStmt) *CreateAssertionStmt
CloneRefOfCreateAssertionStmt creates a deep clone of the input.
func NewCreateAssertionStmt ¶
func NewCreateAssertionStmt(name *NodeList, check Node, attrs *NodeList) *CreateAssertionStmt
NewCreateAssertionStmt creates a new CreateAssertionStmt node
func (*CreateAssertionStmt) Location ¶
func (n *CreateAssertionStmt) Location() int
Location returns the statement's source location
func (*CreateAssertionStmt) NodeTag ¶
func (n *CreateAssertionStmt) NodeTag() NodeTag
NodeTag returns the node's type tag
func (*CreateAssertionStmt) SetLocation ¶
func (n *CreateAssertionStmt) SetLocation(loc int)
SetLocation sets the statement's source location.
func (*CreateAssertionStmt) SqlString ¶
func (n *CreateAssertionStmt) SqlString() string
SqlString returns SQL representation of CreateAssertionStmt
func (*CreateAssertionStmt) StatementType ¶
func (n *CreateAssertionStmt) StatementType() string
StatementType returns the statement type
func (*CreateAssertionStmt) String ¶
func (n *CreateAssertionStmt) String() string
String returns string representation of CreateAssertionStmt
type CreateCastStmt ¶
type CreateCastStmt struct {
SourceType *TypeName // source data type
TargetType *TypeName // target data type
Func *ObjectWithArgs // conversion function, or nil
Context CoercionContext // coercion context
Inout bool // true for INOUT cast
}
CreateCastStmt represents a CREATE CAST statement Ported from postgres/src/include/nodes/parsenodes.h:4002-4010
func CloneRefOfCreateCastStmt ¶
func CloneRefOfCreateCastStmt(n *CreateCastStmt) *CreateCastStmt
CloneRefOfCreateCastStmt creates a deep clone of the input.
func NewCreateCastStmt ¶
func NewCreateCastStmt(sourceType, targetType *TypeName, function *ObjectWithArgs, context CoercionContext, inout bool) *CreateCastStmt
NewCreateCastStmt creates a new CreateCastStmt node
func (*CreateCastStmt) Location ¶
func (ccs *CreateCastStmt) Location() int
func (*CreateCastStmt) NodeTag ¶
func (ccs *CreateCastStmt) NodeTag() NodeTag
func (*CreateCastStmt) SetLocation ¶
func (ccs *CreateCastStmt) SetLocation(int)
SetLocation is a no-op; this node does not track source location yet.
func (*CreateCastStmt) SqlString ¶
func (ccs *CreateCastStmt) SqlString() string
func (*CreateCastStmt) StatementType ¶
func (ccs *CreateCastStmt) StatementType() string
func (*CreateCastStmt) String ¶
func (ccs *CreateCastStmt) String() string
String returns string representation of CreateCastStmt
type CreateConnectionStmt ¶
type CreateConnectionStmt struct {
BaseNode
Name string
Options *NodeList // DefElem list of libpq connection options; may be nil
IfNotExists bool
}
CreateConnectionStmt represents `CREATE CONNECTION name OPTIONS (...)`.
func CloneRefOfCreateConnectionStmt ¶
func CloneRefOfCreateConnectionStmt(n *CreateConnectionStmt) *CreateConnectionStmt
CloneRefOfCreateConnectionStmt creates a deep clone of the input.
func NewCreateConnectionStmt ¶
func NewCreateConnectionStmt(name string, options *NodeList, ifNotExists bool) *CreateConnectionStmt
func (*CreateConnectionStmt) SqlString ¶
func (n *CreateConnectionStmt) SqlString() string
func (*CreateConnectionStmt) StatementType ¶
func (n *CreateConnectionStmt) StatementType() string
func (*CreateConnectionStmt) String ¶
func (n *CreateConnectionStmt) String() string
type CreateConversionStmt ¶
type CreateConversionStmt struct {
BaseNode
ConversionName *NodeList // name of the conversion
ForEncodingName string // source encoding name
ToEncodingName string // destination encoding name
FuncName *NodeList // qualified conversion function name
Def bool // true if this is a default conversion
}
CreateConversionStmt represents a CREATE CONVERSION statement Ported from postgres/src/include/nodes/parsenodes.h:3988-3996
func CloneRefOfCreateConversionStmt ¶
func CloneRefOfCreateConversionStmt(n *CreateConversionStmt) *CreateConversionStmt
CloneRefOfCreateConversionStmt creates a deep clone of the input.
func NewCreateConversionStmt ¶
func NewCreateConversionStmt(conversionName *NodeList, forEncodingName, toEncodingName string, funcName *NodeList, def bool) *CreateConversionStmt
NewCreateConversionStmt creates a new CreateConversionStmt node
func (*CreateConversionStmt) SqlString ¶
func (ccs *CreateConversionStmt) SqlString() string
func (*CreateConversionStmt) StatementType ¶
func (ccs *CreateConversionStmt) StatementType() string
func (*CreateConversionStmt) String ¶
func (ccs *CreateConversionStmt) String() string
String returns string representation of CreateConversionStmt
type CreateDomainStmt ¶
type CreateDomainStmt struct {
BaseNode
Domainname *NodeList // qualified name (list of String) - postgres/src/include/nodes/parsenodes.h:3158
TypeName *TypeName // the base type - postgres/src/include/nodes/parsenodes.h:3159
CollClause *CollateClause // untransformed COLLATE spec, if any - postgres/src/include/nodes/parsenodes.h:3160
Constraints *NodeList // constraints (list of Constraint nodes) - postgres/src/include/nodes/parsenodes.h:3161
}
CreateDomainStmt represents a CREATE DOMAIN statement. Ported from postgres/src/include/nodes/parsenodes.h:3156
func CloneRefOfCreateDomainStmt ¶
func CloneRefOfCreateDomainStmt(n *CreateDomainStmt) *CreateDomainStmt
CloneRefOfCreateDomainStmt creates a deep clone of the input.
func NewCreateDomainStmt ¶
func NewCreateDomainStmt(domainname *NodeList, typeName *TypeName) *CreateDomainStmt
NewCreateDomainStmt creates a new CreateDomainStmt node.
func (*CreateDomainStmt) SqlString ¶
func (c *CreateDomainStmt) SqlString() string
SqlString returns the SQL representation of CREATE DOMAIN statement.
func (*CreateDomainStmt) StatementType ¶
func (c *CreateDomainStmt) StatementType() string
func (*CreateDomainStmt) String ¶
func (c *CreateDomainStmt) String() string
type CreateEnumStmt ¶
type CreateEnumStmt struct {
BaseNode
TypeName *NodeList // qualified name (list of String)
Vals *NodeList // enum values (list of String)
}
CreateEnumStmt represents a CREATE TYPE ... AS ENUM statement Ported from postgres/src/include/nodes/parsenodes.h:3696-3701
func CloneRefOfCreateEnumStmt ¶
func CloneRefOfCreateEnumStmt(n *CreateEnumStmt) *CreateEnumStmt
CloneRefOfCreateEnumStmt creates a deep clone of the input.
func NewCreateEnumStmt ¶
func NewCreateEnumStmt(typeName *NodeList, vals *NodeList) *CreateEnumStmt
NewCreateEnumStmt creates a new CreateEnumStmt node
func (*CreateEnumStmt) SqlString ¶
func (ces *CreateEnumStmt) SqlString() string
SqlString returns the SQL representation of CreateEnumStmt
func (*CreateEnumStmt) StatementType ¶
func (ces *CreateEnumStmt) StatementType() string
StatementType returns the statement type
func (*CreateEnumStmt) String ¶
func (ces *CreateEnumStmt) String() string
String returns string representation of CreateEnumStmt
type CreateEventTrigStmt ¶
type CreateEventTrigStmt struct {
BaseNode
TrigName string `json:"trigname"` // event trigger name
EventName string `json:"eventname"` // event name (e.g., ddl_command_start)
FuncName *NodeList `json:"funcname"` // function name
WhenClause *NodeList `json:"whenclause"` // WHEN clause conditions
}
CreateEventTrigStmt represents CREATE EVENT TRIGGER statement Ported from postgres/src/include/nodes/parsenodes.h CreateEventTrigStmt
func CloneRefOfCreateEventTrigStmt ¶
func CloneRefOfCreateEventTrigStmt(n *CreateEventTrigStmt) *CreateEventTrigStmt
CloneRefOfCreateEventTrigStmt creates a deep clone of the input.
func NewCreateEventTrigStmt ¶
func NewCreateEventTrigStmt(trigname string, eventname string, funcname *NodeList, whenclause *NodeList) *CreateEventTrigStmt
NewCreateEventTrigStmt creates a new CreateEventTrigStmt node
func (*CreateEventTrigStmt) SqlString ¶
func (c *CreateEventTrigStmt) SqlString() string
SqlString returns the SQL representation of CreateEventTrigStmt
func (*CreateEventTrigStmt) StatementType ¶
func (c *CreateEventTrigStmt) StatementType() string
func (*CreateEventTrigStmt) String ¶
func (c *CreateEventTrigStmt) String() string
type CreateExtensionStmt ¶
type CreateExtensionStmt struct {
BaseNode
Extname string // extension name - postgres/src/include/nodes/parsenodes.h:2821
IfNotExists bool // just do nothing if it already exists? - postgres/src/include/nodes/parsenodes.h:2822
Options *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:2823
}
CreateExtensionStmt represents a CREATE EXTENSION statement. Ported from postgres/src/include/nodes/parsenodes.h:2819
func CloneRefOfCreateExtensionStmt ¶
func CloneRefOfCreateExtensionStmt(n *CreateExtensionStmt) *CreateExtensionStmt
CloneRefOfCreateExtensionStmt creates a deep clone of the input.
func NewCreateExtensionStmt ¶
func NewCreateExtensionStmt(extname string, ifNotExists bool, options *NodeList) *CreateExtensionStmt
NewCreateExtensionStmt creates a new CreateExtensionStmt node.
func (*CreateExtensionStmt) SqlString ¶
func (c *CreateExtensionStmt) SqlString() string
SqlString returns the SQL representation of CreateExtensionStmt
func (*CreateExtensionStmt) StatementType ¶
func (c *CreateExtensionStmt) StatementType() string
func (*CreateExtensionStmt) String ¶
func (c *CreateExtensionStmt) String() string
type CreateFdwStmt ¶
type CreateFdwStmt struct {
BaseNode
FdwName string `json:"fdwname"` // foreign data wrapper name
FuncOptions *NodeList `json:"func_options"` // HANDLER/VALIDATOR options
Options *NodeList `json:"options"` // OPTIONS clause
}
CreateFdwStmt represents CREATE FOREIGN DATA WRAPPER statement Ported from postgres/src/include/nodes/parsenodes.h CreateFdwStmt
func CloneRefOfCreateFdwStmt ¶
func CloneRefOfCreateFdwStmt(n *CreateFdwStmt) *CreateFdwStmt
CloneRefOfCreateFdwStmt creates a deep clone of the input.
func NewCreateFdwStmt ¶
func NewCreateFdwStmt(fdwname string, funcOptions, options *NodeList) *CreateFdwStmt
NewCreateFdwStmt creates a new CreateFdwStmt node
func (*CreateFdwStmt) SqlString ¶
func (c *CreateFdwStmt) SqlString() string
SqlString returns the SQL representation of CreateFdwStmt
func (*CreateFdwStmt) StatementType ¶
func (c *CreateFdwStmt) StatementType() string
func (*CreateFdwStmt) String ¶
func (c *CreateFdwStmt) String() string
type CreateForeignServerStmt ¶
type CreateForeignServerStmt struct {
BaseNode
Servername string // Server name - parsenodes.h:2872
Servertype string // Optional server type - parsenodes.h:2873
Version string // Optional server version - parsenodes.h:2874
Fdwname string // FDW name - parsenodes.h:2875
IfNotExists bool // IF NOT EXISTS clause - parsenodes.h:2876
Options *NodeList // Generic options to FDW - parsenodes.h:2877
}
CreateForeignServerStmt represents CREATE FOREIGN SERVER statements. This supports PostgreSQL's foreign data wrapper functionality. Ported from postgres/src/include/nodes/parsenodes.h:2870
func CloneRefOfCreateForeignServerStmt ¶
func CloneRefOfCreateForeignServerStmt(n *CreateForeignServerStmt) *CreateForeignServerStmt
CloneRefOfCreateForeignServerStmt creates a deep clone of the input.
func NewCreateForeignServerStmt ¶
func NewCreateForeignServerStmt(servername, servertype, version, fdwname string, options *NodeList, ifNotExists bool) *CreateForeignServerStmt
NewCreateForeignServerStmt creates a new CreateForeignServerStmt node. NewCreateForeignServerStmt creates a new CreateForeignServerStmt node.
func (*CreateForeignServerStmt) SqlString ¶
func (cfss *CreateForeignServerStmt) SqlString() string
SqlString returns the SQL representation of the CREATE FOREIGN SERVER statement
func (*CreateForeignServerStmt) StatementType ¶
func (cfss *CreateForeignServerStmt) StatementType() string
func (*CreateForeignServerStmt) String ¶
func (cfss *CreateForeignServerStmt) String() string
type CreateForeignTableStmt ¶
type CreateForeignTableStmt struct {
BaseNode
Base *CreateStmt // Base CREATE TABLE statement - parsenodes.h:2897
Servername string // Foreign server name - parsenodes.h:2898
Options *NodeList // OPTIONS clause - parsenodes.h:2899
}
CreateForeignTableStmt represents CREATE FOREIGN TABLE statements. This creates tables that reference external data sources. Ported from postgres/src/include/nodes/parsenodes.h:2895
func CloneRefOfCreateForeignTableStmt ¶
func CloneRefOfCreateForeignTableStmt(n *CreateForeignTableStmt) *CreateForeignTableStmt
CloneRefOfCreateForeignTableStmt creates a deep clone of the input.
func NewCreateForeignTableStmt ¶
func NewCreateForeignTableStmt(relation *RangeVar, tableElts, inhRelations *NodeList, servername string, options *NodeList, partBound *PartitionBoundSpec, ifNotExists bool) *CreateForeignTableStmt
NewCreateForeignTableStmt creates a new CreateForeignTableStmt node. NewCreateForeignTableStmt creates a CreateForeignTableStmt from grammar components.
func (*CreateForeignTableStmt) SqlString ¶
func (cfts *CreateForeignTableStmt) SqlString() string
SqlString returns the SQL representation of the CREATE FOREIGN TABLE statement
func (*CreateForeignTableStmt) StatementType ¶
func (cfts *CreateForeignTableStmt) StatementType() string
func (*CreateForeignTableStmt) String ¶
func (cfts *CreateForeignTableStmt) String() string
type CreateFunctionStmt ¶
type CreateFunctionStmt struct {
IsProcedure bool // true for CREATE PROCEDURE
Replace bool // true for CREATE OR REPLACE
FuncName *NodeList // qualified name of function to create
Parameters *NodeList // list of function parameters (includes RETURNS TABLE columns with FUNC_PARAM_TABLE mode)
ReturnType *TypeName // the return type
Options *NodeList // list of definition elements
SQLBody Node // SQL body for SQL functions
}
CreateFunctionStmt represents a CREATE FUNCTION statement Ported from postgres/src/include/nodes/parsenodes.h:3427-3437
func CloneRefOfCreateFunctionStmt ¶
func CloneRefOfCreateFunctionStmt(n *CreateFunctionStmt) *CreateFunctionStmt
CloneRefOfCreateFunctionStmt creates a deep clone of the input.
func NewCreateFunctionStmt ¶
func NewCreateFunctionStmt(isProcedure, replace bool, funcName *NodeList, parameters *NodeList, returnType *TypeName, options *NodeList, sqlBody Node) *CreateFunctionStmt
NewCreateFunctionStmt creates a new CreateFunctionStmt node
func (*CreateFunctionStmt) Location ¶
func (cfs *CreateFunctionStmt) Location() int
Location returns the statement's source location (dummy implementation)
func (*CreateFunctionStmt) NodeTag ¶
func (cfs *CreateFunctionStmt) NodeTag() NodeTag
NodeTag returns the node's type tag
func (*CreateFunctionStmt) SetLocation ¶
func (cfs *CreateFunctionStmt) SetLocation(int)
SetLocation is a no-op; this node does not track source location yet.
func (*CreateFunctionStmt) SqlString ¶
func (cfs *CreateFunctionStmt) SqlString() string
SqlString returns SQL representation of the CREATE FUNCTION statement
func (*CreateFunctionStmt) StatementType ¶
func (cfs *CreateFunctionStmt) StatementType() string
StatementType returns the statement type for this node
func (*CreateFunctionStmt) String ¶
func (cfs *CreateFunctionStmt) String() string
String returns string representation of CreateFunctionStmt
type CreateMigrationStmt ¶
type CreateMigrationStmt struct {
BaseNode
Name string
Connection string
ForAllTables bool
Objects *NodeList // *PublicationObjSpec list; nil when ForAllTables
Options *NodeList // WITH options, a DefElem list; may be nil
IfNotExists bool
}
CreateMigrationStmt represents `CREATE MIGRATION name CONNECTION conn { FOR ALL TABLES | FOR obj [, ...] } [WITH (...)]`.
func CloneRefOfCreateMigrationStmt ¶
func CloneRefOfCreateMigrationStmt(n *CreateMigrationStmt) *CreateMigrationStmt
CloneRefOfCreateMigrationStmt creates a deep clone of the input.
func NewCreateMigrationStmt ¶
func NewCreateMigrationStmt(name, connection string, tables *MigrationTables, options *NodeList, ifNotExists bool) *CreateMigrationStmt
func (*CreateMigrationStmt) SqlString ¶
func (n *CreateMigrationStmt) SqlString() string
func (*CreateMigrationStmt) StatementType ¶
func (n *CreateMigrationStmt) StatementType() string
func (*CreateMigrationStmt) String ¶
func (n *CreateMigrationStmt) String() string
type CreateOpClassItem ¶
type CreateOpClassItem struct {
BaseNode
ItemType OpClassItemType // OPCLASS_ITEM_OPERATOR, OPCLASS_ITEM_FUNCTION, or OPCLASS_ITEM_STORAGETYPE
Name *ObjectWithArgs // operator or function name and args
Number int // strategy num or support proc num
OrderFamily *NodeList // only used for ordering operators
ClassArgs *NodeList // amproclefttype/amprocrighttype or amoplefttype/amoprighttype
StoredType *TypeName // datatype stored in index (for storage type items)
}
CreateOpClassItem represents an item in a CREATE OPERATOR CLASS statement Ported from postgres/src/include/nodes/parsenodes.h:3184-3195
func CloneRefOfCreateOpClassItem ¶
func CloneRefOfCreateOpClassItem(n *CreateOpClassItem) *CreateOpClassItem
CloneRefOfCreateOpClassItem creates a deep clone of the input.
func NewCreateOpClassItem ¶
func NewCreateOpClassItem(itemType OpClassItemType, name *ObjectWithArgs, number int, orderFamily *NodeList, classArgs *NodeList, storedType *TypeName) *CreateOpClassItem
NewCreateOpClassItem creates a new CreateOpClassItem node
func NewOpClassItemFunction ¶
func NewOpClassItemFunction(number int, name *ObjectWithArgs, classArgs *NodeList) *CreateOpClassItem
NewOpClassItemFunction creates a new CreateOpClassItem for functions Two different signatures to match grammar usage: 1. FUNCTION Iconst function_with_argtypes 2. FUNCTION Iconst '(' type_list ')' function_with_argtypes
func NewOpClassItemOperator ¶
func NewOpClassItemOperator(number int, name *ObjectWithArgs, orderFamily *NodeList) *CreateOpClassItem
NewOpClassItemOperator creates a new CreateOpClassItem for operators Two different signatures to match grammar usage: 1. OPERATOR Iconst any_operator opclass_purpose opt_recheck 2. OPERATOR Iconst operator_with_argtypes opclass_purpose opt_recheck
func NewOpClassItemStorage ¶
func NewOpClassItemStorage(storedType *TypeName) *CreateOpClassItem
NewOpClassItemStorage creates a new CreateOpClassItem for storage type
func (*CreateOpClassItem) SqlString ¶
func (oci *CreateOpClassItem) SqlString() string
SqlString returns the SQL representation of CreateOpClassItem
func (*CreateOpClassItem) StatementType ¶
func (oci *CreateOpClassItem) StatementType() string
func (*CreateOpClassItem) String ¶
func (oci *CreateOpClassItem) String() string
String returns string representation of CreateOpClassItem
type CreateOpClassStmt ¶
type CreateOpClassStmt struct {
BaseNode
OpClassName *NodeList // qualified name (list of String)
OpFamilyName *NodeList // qualified name (list of String); nil if omitted
AmName string // name of index AM opclass is for
DataType *TypeName // datatype of indexed column
Items *NodeList // list of CreateOpClassItem nodes
IsDefault bool // should be marked as default for type?
}
CreateOpClassStmt represents a CREATE OPERATOR CLASS statement Ported from postgres/src/include/nodes/parsenodes.h:3169-3178
func CloneRefOfCreateOpClassStmt ¶
func CloneRefOfCreateOpClassStmt(n *CreateOpClassStmt) *CreateOpClassStmt
CloneRefOfCreateOpClassStmt creates a deep clone of the input.
func NewCreateOpClassStmt ¶
func NewCreateOpClassStmt(opClassName, opFamilyName *NodeList, amName string, dataType *TypeName, items *NodeList, isDefault bool) *CreateOpClassStmt
NewCreateOpClassStmt creates a new CreateOpClassStmt node
func (*CreateOpClassStmt) NodeTag ¶
func (cocs *CreateOpClassStmt) NodeTag() NodeTag
NodeTag implements the Node interface
func (*CreateOpClassStmt) SqlString ¶
func (cocs *CreateOpClassStmt) SqlString() string
SqlString implements the Stmt interface
func (*CreateOpClassStmt) StatementType ¶
func (cocs *CreateOpClassStmt) StatementType() string
StatementType implements the Stmt interface
func (*CreateOpClassStmt) String ¶
func (cocs *CreateOpClassStmt) String() string
String returns string representation of CreateOpClassStmt
type CreateOpFamilyStmt ¶
type CreateOpFamilyStmt struct {
BaseNode
OpFamilyName *NodeList // qualified name (list of String)
AmName string // name of index AM opfamily is for
}
CreateOpFamilyStmt represents a CREATE OPERATOR FAMILY statement Ported from postgres/src/include/nodes/parsenodes.h:3201-3206
func CloneRefOfCreateOpFamilyStmt ¶
func CloneRefOfCreateOpFamilyStmt(n *CreateOpFamilyStmt) *CreateOpFamilyStmt
CloneRefOfCreateOpFamilyStmt creates a deep clone of the input.
func NewCreateOpFamilyStmt ¶
func NewCreateOpFamilyStmt(opFamilyName *NodeList, amName string) *CreateOpFamilyStmt
NewCreateOpFamilyStmt creates a new CreateOpFamilyStmt node
func (*CreateOpFamilyStmt) NodeTag ¶
func (cofs *CreateOpFamilyStmt) NodeTag() NodeTag
NodeTag implements the Node interface
func (*CreateOpFamilyStmt) SqlString ¶
func (cofs *CreateOpFamilyStmt) SqlString() string
SqlString implements the Stmt interface
func (*CreateOpFamilyStmt) StatementType ¶
func (cofs *CreateOpFamilyStmt) StatementType() string
StatementType implements the Stmt interface
func (*CreateOpFamilyStmt) String ¶
func (cofs *CreateOpFamilyStmt) String() string
String returns string representation of CreateOpFamilyStmt
type CreatePLangStmt ¶
type CreatePLangStmt struct {
BaseNode
Replace bool // true => replace if already exists
PLName string // PL name
PLHandler *NodeList // PL call handler function (qualified name)
PLInline *NodeList // optional inline function (qualified name)
PLValidator *NodeList // optional validator function (qualified name)
PLTrusted bool // PL is trusted
}
CreatePLangStmt represents a CREATE LANGUAGE statement Ported from postgres/src/include/nodes/parsenodes.h:3054-3063
func CloneRefOfCreatePLangStmt ¶
func CloneRefOfCreatePLangStmt(n *CreatePLangStmt) *CreatePLangStmt
CloneRefOfCreatePLangStmt creates a deep clone of the input.
func NewCreatePLangStmt ¶
func NewCreatePLangStmt(replace bool, plName string, plHandler, plInline, plValidator *NodeList, plTrusted bool) *CreatePLangStmt
NewCreatePLangStmt creates a new CreatePLangStmt node
func (*CreatePLangStmt) SqlString ¶
func (cpls *CreatePLangStmt) SqlString() string
func (*CreatePLangStmt) StatementType ¶
func (cpls *CreatePLangStmt) StatementType() string
func (*CreatePLangStmt) String ¶
func (cpls *CreatePLangStmt) String() string
String returns string representation of CreatePLangStmt
type CreatePolicyStmt ¶
type CreatePolicyStmt struct {
BaseNode
PolicyName string // Policy name - parsenodes.h:2961
Table *RangeVar // Table the policy applies to - parsenodes.h:2962
CmdName string // Command name (SELECT, INSERT, etc.) - parsenodes.h:2963
Permissive bool // Is this a permissive policy? - parsenodes.h:2964
Roles *NodeList // Roles policy applies to - parsenodes.h:2965
Qual Node // USING clause - parsenodes.h:2966
WithCheck Node // WITH CHECK clause - parsenodes.h:2967
}
CreatePolicyStmt represents CREATE POLICY statements. This implements PostgreSQL's row-level security policies. Ported from postgres/src/include/nodes/parsenodes.h:2959
func CloneRefOfCreatePolicyStmt ¶
func CloneRefOfCreatePolicyStmt(n *CreatePolicyStmt) *CreatePolicyStmt
CloneRefOfCreatePolicyStmt creates a deep clone of the input.
func NewCreatePolicyStmt ¶
func NewCreatePolicyStmt(policyName string, table *RangeVar, permissive bool, cmdName string, roles *NodeList, qual Node, withCheck Node) *CreatePolicyStmt
NewCreatePolicyStmt creates a new CreatePolicyStmt node.
func (*CreatePolicyStmt) SqlString ¶
func (cps *CreatePolicyStmt) SqlString() string
SqlString returns the SQL representation of CREATE POLICY statement
func (*CreatePolicyStmt) StatementType ¶
func (cps *CreatePolicyStmt) StatementType() string
func (*CreatePolicyStmt) String ¶
func (cps *CreatePolicyStmt) String() string
type CreatePublicationStmt ¶
type CreatePublicationStmt struct {
BaseNode
PubName string `json:"pubname"`
PubObjects *NodeList `json:"pubobjects"`
ForAllTables bool `json:"for_all_tables"`
Options *NodeList `json:"options"`
}
CreatePublicationStmt represents CREATE PUBLICATION statement
func CloneRefOfCreatePublicationStmt ¶
func CloneRefOfCreatePublicationStmt(n *CreatePublicationStmt) *CreatePublicationStmt
CloneRefOfCreatePublicationStmt creates a deep clone of the input.
func NewCreatePublicationStmt ¶
func NewCreatePublicationStmt(name string, objects *NodeList, forAllTables bool, options *NodeList) *CreatePublicationStmt
func (*CreatePublicationStmt) SqlString ¶
func (c *CreatePublicationStmt) SqlString() string
SqlString returns the SQL representation of CREATE PUBLICATION statement
func (*CreatePublicationStmt) StatementType ¶
func (c *CreatePublicationStmt) StatementType() string
func (*CreatePublicationStmt) String ¶
func (c *CreatePublicationStmt) String() string
type CreateRangeStmt ¶
type CreateRangeStmt struct {
BaseNode
TypeName *NodeList // qualified name (list of String)
Params *NodeList // range parameters (list of DefElem)
}
CreateRangeStmt represents a CREATE TYPE ... AS RANGE statement Ported from postgres/src/include/nodes/parsenodes.h:3707-3712
func CloneRefOfCreateRangeStmt ¶
func CloneRefOfCreateRangeStmt(n *CreateRangeStmt) *CreateRangeStmt
CloneRefOfCreateRangeStmt creates a deep clone of the input.
func NewCreateRangeStmt ¶
func NewCreateRangeStmt(typeName *NodeList, params *NodeList) *CreateRangeStmt
NewCreateRangeStmt creates a new CreateRangeStmt node
func (*CreateRangeStmt) SqlString ¶
func (crs *CreateRangeStmt) SqlString() string
SqlString returns the SQL representation of CreateRangeStmt
func (*CreateRangeStmt) StatementType ¶
func (crs *CreateRangeStmt) StatementType() string
StatementType returns the statement type
func (*CreateRangeStmt) String ¶
func (crs *CreateRangeStmt) String() string
String returns string representation of CreateRangeStmt
type CreateReplicationSlotCmd ¶
type CreateReplicationSlotCmd struct {
BaseNode
SlotName string // replnodes.h:55
Kind ReplicationKind // replnodes.h:56
Plugin string // replnodes.h:57 (LOGICAL only)
Temporary bool // replnodes.h:58
Options []*DefElem // replnodes.h:59
}
CreateReplicationSlotCmd - CREATE_REPLICATION_SLOT command. Ported from postgres/src/include/nodes/replnodes.h:52-60
func CloneRefOfCreateReplicationSlotCmd ¶
func CloneRefOfCreateReplicationSlotCmd(n *CreateReplicationSlotCmd) *CreateReplicationSlotCmd
CloneRefOfCreateReplicationSlotCmd creates a deep clone of the input.
func NewCreateReplicationSlotCmd ¶
func NewCreateReplicationSlotCmd(slot string, kind ReplicationKind, plugin string, temp bool) *CreateReplicationSlotCmd
func (*CreateReplicationSlotCmd) SqlString ¶
func (n *CreateReplicationSlotCmd) SqlString() string
func (*CreateReplicationSlotCmd) StatementType ¶
func (n *CreateReplicationSlotCmd) StatementType() string
type CreateRoleStmt ¶
type CreateRoleStmt struct {
BaseNode
StmtType RoleStatementType // Role type: ROLE, USER, or GROUP - postgres/src/include/nodes/parsenodes.h:3084
Role string // Role name - postgres/src/include/nodes/parsenodes.h:3085
Options *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:3086
}
CreateRoleStmt represents a CREATE ROLE/USER/GROUP statement. Ported from postgres/src/include/nodes/parsenodes.h:3081
func CloneRefOfCreateRoleStmt ¶
func CloneRefOfCreateRoleStmt(n *CreateRoleStmt) *CreateRoleStmt
CloneRefOfCreateRoleStmt creates a deep clone of the input.
func NewCreateRoleStmt ¶
func NewCreateRoleStmt(stmtType RoleStatementType, role string, options *NodeList) *CreateRoleStmt
NewCreateRoleStmt creates a new CREATE ROLE statement.
func (*CreateRoleStmt) SqlString ¶
func (crs *CreateRoleStmt) SqlString() string
func (*CreateRoleStmt) StatementType ¶
func (crs *CreateRoleStmt) StatementType() string
func (*CreateRoleStmt) String ¶
func (crs *CreateRoleStmt) String() string
type CreateSchemaStmt ¶
type CreateSchemaStmt struct {
BaseNode
Schemaname string // the name of the schema to create - postgres/src/include/nodes/parsenodes.h:2322
Authrole *RoleSpec // the owner of the created schema - postgres/src/include/nodes/parsenodes.h:2323
SchemaElts *NodeList // schema components (list of parsenodes) - postgres/src/include/nodes/parsenodes.h:2324
IfNotExists bool // just do nothing if schema already exists? - postgres/src/include/nodes/parsenodes.h:2325
}
CreateSchemaStmt represents a CREATE SCHEMA statement. Ported from postgres/src/include/nodes/parsenodes.h:2320
func CloneRefOfCreateSchemaStmt ¶
func CloneRefOfCreateSchemaStmt(n *CreateSchemaStmt) *CreateSchemaStmt
CloneRefOfCreateSchemaStmt creates a deep clone of the input.
func NewCreateSchemaStmt ¶
func NewCreateSchemaStmt(schemaname string, ifNotExists bool) *CreateSchemaStmt
NewCreateSchemaStmt creates a new CreateSchemaStmt node.
func (*CreateSchemaStmt) SqlString ¶
func (c *CreateSchemaStmt) SqlString() string
SqlString returns SQL representation of the CREATE SCHEMA statement
func (*CreateSchemaStmt) StatementType ¶
func (c *CreateSchemaStmt) StatementType() string
func (*CreateSchemaStmt) String ¶
func (c *CreateSchemaStmt) String() string
type CreateSeqStmt ¶
type CreateSeqStmt struct {
BaseNode
Sequence *RangeVar // the sequence to create
Options *NodeList // list of options (DefElem nodes)
OwnerID Oid // ID of owner, or 0 for default (InvalidOid)
ForIdentity bool // true if for IDENTITY column
IfNotExists bool // true for IF NOT EXISTS
}
CreateSeqStmt represents a CREATE SEQUENCE statement Ported from postgres/src/include/nodes/parsenodes.h:3117-3125
func CloneRefOfCreateSeqStmt ¶
func CloneRefOfCreateSeqStmt(n *CreateSeqStmt) *CreateSeqStmt
CloneRefOfCreateSeqStmt creates a deep clone of the input.
func NewCreateSeqStmt ¶
func NewCreateSeqStmt(sequence *RangeVar, options *NodeList, ownerID Oid, forIdentity, ifNotExists bool) *CreateSeqStmt
NewCreateSeqStmt creates a new CreateSeqStmt node
func (*CreateSeqStmt) SqlString ¶
func (css *CreateSeqStmt) SqlString() string
SqlString returns the SQL representation of CreateSeqStmt
func (*CreateSeqStmt) StatementType ¶
func (css *CreateSeqStmt) StatementType() string
StatementType returns the type of statement
func (*CreateSeqStmt) String ¶
func (css *CreateSeqStmt) String() string
String returns string representation of CreateSeqStmt
type CreateStatsStmt ¶
type CreateStatsStmt struct {
DefNames *NodeList // qualified name (list of String)
StatTypes *NodeList // stat types (list of String)
Exprs *NodeList // expressions to build statistics on
Relations *NodeList // rels to build stats on (list of RangeVar)
StxComment string // comment to apply to stats, or empty string
Transformed bool // true when transformStatsStmt is finished
IfNotExists bool // do nothing if stats name already exists
}
CreateStatsStmt represents a CREATE STATISTICS statement Ported from postgres/src/include/nodes/parsenodes.h:3384-3394
func CloneRefOfCreateStatsStmt ¶
func CloneRefOfCreateStatsStmt(n *CreateStatsStmt) *CreateStatsStmt
CloneRefOfCreateStatsStmt creates a deep clone of the input.
func NewCreateStatsStmt ¶
func NewCreateStatsStmt(defNames *NodeList, statTypes *NodeList, exprs *NodeList, relations *NodeList, stxComment string, transformed, ifNotExists bool) *CreateStatsStmt
NewCreateStatsStmt creates a new CreateStatsStmt node
func (*CreateStatsStmt) Location ¶
func (css *CreateStatsStmt) Location() int
func (*CreateStatsStmt) NodeTag ¶
func (css *CreateStatsStmt) NodeTag() NodeTag
func (*CreateStatsStmt) SetLocation ¶
func (css *CreateStatsStmt) SetLocation(int)
SetLocation is a no-op; this node does not track source location yet.
func (*CreateStatsStmt) SqlString ¶
func (css *CreateStatsStmt) SqlString() string
func (*CreateStatsStmt) StatementType ¶
func (css *CreateStatsStmt) StatementType() string
func (*CreateStatsStmt) String ¶
func (css *CreateStatsStmt) String() string
String returns string representation of CreateStatsStmt
type CreateStmt ¶
type CreateStmt struct {
BaseNode
Relation *RangeVar // Relation to create - postgres/src/include/nodes/parsenodes.h:2651
TableElts *NodeList // Column definitions - postgres/src/include/nodes/parsenodes.h:2652
InhRelations *NodeList // Relations to inherit from - postgres/src/include/nodes/parsenodes.h:2653
PartBound *PartitionBoundSpec // FOR VALUES clause - parsenodes.h
PartSpec *PartitionSpec // PARTITION BY clause - parsenodes.h
OfTypename *TypeName // OF typename clause - parsenodes.h
Constraints []*Constraint // Constraints - postgres/src/include/nodes/parsenodes.h:2659
Options *NodeList // Options from WITH clause - postgres/src/include/nodes/parsenodes.h:2660
OnCommit OnCommitAction // OnCommitAction for temp tables - parsenodes.h
TableSpaceName string // Table space to use, or empty - postgres/src/include/nodes/parsenodes.h:2662
AccessMethod string // Table access method - postgres/src/include/nodes/parsenodes.h:2663
IfNotExists bool // Just do nothing if it already exists? - postgres/src/include/nodes/parsenodes.h:2664
}
CreateStmt represents a CREATE TABLE statement. Ported from postgres/src/include/nodes/parsenodes.h:2648
func CloneRefOfCreateStmt ¶
func CloneRefOfCreateStmt(n *CreateStmt) *CreateStmt
CloneRefOfCreateStmt creates a deep clone of the input.
func NewCreateStmt ¶
func NewCreateStmt(relation *RangeVar) *CreateStmt
NewCreateStmt creates a new CreateStmt node.
func (*CreateStmt) SqlString ¶
func (c *CreateStmt) SqlString() string
SqlString returns the SQL representation of CREATE TABLE statement
func (*CreateStmt) StatementType ¶
func (c *CreateStmt) StatementType() string
func (*CreateStmt) String ¶
func (c *CreateStmt) String() string
type CreateSubscriptionStmt ¶
type CreateSubscriptionStmt struct {
BaseNode
SubName string `json:"subname"`
ConnInfo string `json:"conninfo"`
Publication *NodeList `json:"publication"`
Options *NodeList `json:"options"`
}
CreateSubscriptionStmt represents CREATE SUBSCRIPTION statement
func CloneRefOfCreateSubscriptionStmt ¶
func CloneRefOfCreateSubscriptionStmt(n *CreateSubscriptionStmt) *CreateSubscriptionStmt
CloneRefOfCreateSubscriptionStmt creates a deep clone of the input.
func NewCreateSubscriptionStmt ¶
func NewCreateSubscriptionStmt(name, connInfo string, publication, options *NodeList) *CreateSubscriptionStmt
func (*CreateSubscriptionStmt) SqlString ¶
func (c *CreateSubscriptionStmt) SqlString() string
SqlString returns the SQL representation of CREATE SUBSCRIPTION statement
func (*CreateSubscriptionStmt) StatementType ¶
func (c *CreateSubscriptionStmt) StatementType() string
func (*CreateSubscriptionStmt) String ¶
func (c *CreateSubscriptionStmt) String() string
type CreateTableAsStmt ¶
type CreateTableAsStmt struct {
BaseNode
Query Node // the query (generally a SelectStmt)
Into *IntoClause // target relation
ObjType ObjectType // table or materialized view
IsSelectInto bool // it's a SELECT INTO, not CREATE TABLE AS
IfNotExists bool // IF NOT EXISTS was specified
}
CreateTableAsStmt represents CREATE TABLE AS and CREATE MATERIALIZED VIEW statements Ported from postgres/src/include/nodes/parsenodes.h:3607-3615
func CloneRefOfCreateTableAsStmt ¶
func CloneRefOfCreateTableAsStmt(n *CreateTableAsStmt) *CreateTableAsStmt
CloneRefOfCreateTableAsStmt creates a deep clone of the input.
func NewCreateTableAsStmt ¶
func NewCreateTableAsStmt(query Node, into *IntoClause, objType ObjectType, isSelectInto, ifNotExists bool) *CreateTableAsStmt
NewCreateTableAsStmt creates a new CreateTableAsStmt node
func (*CreateTableAsStmt) Location ¶
func (ctas *CreateTableAsStmt) Location() int
Location returns the statement's source location (dummy implementation)
func (*CreateTableAsStmt) NodeTag ¶
func (ctas *CreateTableAsStmt) NodeTag() NodeTag
NodeTag returns the node's type tag
func (*CreateTableAsStmt) SetLocation ¶
func (ctas *CreateTableAsStmt) SetLocation(int)
SetLocation is a no-op; this node does not track source location yet.
func (*CreateTableAsStmt) SqlString ¶
func (ctas *CreateTableAsStmt) SqlString() string
SqlString returns SQL representation of the CREATE MATERIALIZED VIEW statement
func (*CreateTableAsStmt) StatementType ¶
func (ctas *CreateTableAsStmt) StatementType() string
StatementType returns the statement type for this node
func (*CreateTableAsStmt) String ¶
func (ctas *CreateTableAsStmt) String() string
String returns string representation of CreateTableAsStmt
type CreateTableGroupStmt ¶
type CreateTableGroupStmt struct {
BaseNode
Name string
Shards *NodeList // *String items, 'lower-upper' ranges
IfNotExists bool
}
CreateTableGroupStmt is CREATE TABLEGROUP [IF NOT EXISTS] name [SHARDS ('range', ...)]. Shards is nil when the clause is omitted: a single 0-inf shard.
func CloneRefOfCreateTableGroupStmt ¶
func CloneRefOfCreateTableGroupStmt(n *CreateTableGroupStmt) *CreateTableGroupStmt
CloneRefOfCreateTableGroupStmt creates a deep clone of the input.
func NewCreateTableGroupStmt ¶
func NewCreateTableGroupStmt(name string, shards *NodeList, ifNotExists bool) *CreateTableGroupStmt
func (*CreateTableGroupStmt) SqlString ¶
func (c *CreateTableGroupStmt) SqlString() string
func (*CreateTableGroupStmt) StatementType ¶
func (c *CreateTableGroupStmt) StatementType() string
type CreateTableSpaceStmt ¶
type CreateTableSpaceStmt struct {
BaseNode
TablespaceName string `json:"tablespacename"`
Owner *RoleSpec `json:"owner"`
LocationPath string `json:"location"`
Options *NodeList `json:"options"`
}
CreateTableSpaceStmt represents CREATE TABLESPACE statement
func CloneRefOfCreateTableSpaceStmt ¶
func CloneRefOfCreateTableSpaceStmt(n *CreateTableSpaceStmt) *CreateTableSpaceStmt
CloneRefOfCreateTableSpaceStmt creates a deep clone of the input.
func NewCreateTableSpaceStmt ¶
func NewCreateTableSpaceStmt(name string, owner *RoleSpec, location string, options *NodeList) *CreateTableSpaceStmt
func (*CreateTableSpaceStmt) SqlString ¶
func (c *CreateTableSpaceStmt) SqlString() string
SqlString returns the SQL representation of CREATE TABLESPACE statement
func (*CreateTableSpaceStmt) StatementType ¶
func (c *CreateTableSpaceStmt) StatementType() string
func (*CreateTableSpaceStmt) String ¶
func (c *CreateTableSpaceStmt) String() string
type CreateTransformStmt ¶
type CreateTransformStmt struct {
BaseNode
Replace bool // true for CREATE OR REPLACE
TypeName *TypeName // type name
Lang string // language name
FromSql *ObjectWithArgs // FROM SQL function
ToSql *ObjectWithArgs // TO SQL function
}
CreateTransformStmt represents a CREATE TRANSFORM statement Ported from postgres/src/include/nodes/parsenodes.h:4016-4024
func CloneRefOfCreateTransformStmt ¶
func CloneRefOfCreateTransformStmt(n *CreateTransformStmt) *CreateTransformStmt
CloneRefOfCreateTransformStmt creates a deep clone of the input.
func NewCreateTransformStmt ¶
func NewCreateTransformStmt(replace bool, typeName *TypeName, lang string, fromSql, toSql Node) *CreateTransformStmt
NewCreateTransformStmt creates a new CreateTransformStmt node
func (*CreateTransformStmt) SqlString ¶
func (cts *CreateTransformStmt) SqlString() string
func (*CreateTransformStmt) StatementType ¶
func (cts *CreateTransformStmt) StatementType() string
func (*CreateTransformStmt) String ¶
func (cts *CreateTransformStmt) String() string
String returns string representation of CreateTransformStmt
type CreateTriggerStmt ¶
type CreateTriggerStmt struct {
BaseNode
Replace bool // Replace existing trigger? - parsenodes.h:3003
IsConstraint bool // Is this a constraint trigger? - parsenodes.h:3004
Trigname string // Trigger name - parsenodes.h:3005
Relation *RangeVar // Relation trigger is on - parsenodes.h:3006
Funcname *NodeList // Qual. name of function to call - parsenodes.h:3007
Args *NodeList // List of (T_String) Values or NIL - parsenodes.h:3008
Row bool // ROW/STATEMENT - parsenodes.h:3009
Timing int16 // BEFORE, AFTER, or INSTEAD - parsenodes.h:3010
Events int16 // "OR" of INSERT/UPDATE/DELETE/TRUNCATE - parsenodes.h:3011
Columns *NodeList // Column names, or NIL for all columns - parsenodes.h:3012
WhenClause Node // WHEN clause - parsenodes.h:3013
Constrrel *RangeVar // Opposite relation, if RI trigger - parsenodes.h:3014
Deferrable bool // DEFERRABLE - parsenodes.h:3015
Initdeferred bool // INITIALLY DEFERRED - parsenodes.h:3016
Transitions *NodeList // Transition table clauses - parsenodes.h:3017
}
CreateTriggerStmt represents CREATE TRIGGER statements. Triggers are essential for PostgreSQL's event system. Ported from postgres/src/include/nodes/parsenodes.h:3001
func CloneRefOfCreateTriggerStmt ¶
func CloneRefOfCreateTriggerStmt(n *CreateTriggerStmt) *CreateTriggerStmt
CloneRefOfCreateTriggerStmt creates a deep clone of the input.
func NewAfterUpdateTrigger ¶
func NewAfterUpdateTrigger(trigname string, relation *RangeVar, funcname *NodeList) *CreateTriggerStmt
NewAfterUpdateTrigger creates an AFTER UPDATE trigger.
func NewBeforeInsertTrigger ¶
func NewBeforeInsertTrigger(trigname string, relation *RangeVar, funcname *NodeList) *CreateTriggerStmt
NewBeforeInsertTrigger creates a BEFORE INSERT trigger.
func NewConstraintTrigger ¶
func NewConstraintTrigger(trigname string, relation *RangeVar, funcname *NodeList, timing int16, events int16, constrrel *RangeVar) *CreateTriggerStmt
NewConstraintTrigger creates a constraint trigger.
func NewCreateTriggerStmt ¶
func NewCreateTriggerStmt(trigname string, relation *RangeVar, funcname *NodeList, timing int16, events int16) *CreateTriggerStmt
NewCreateTriggerStmt creates a new CreateTriggerStmt node.
func NewDeferrableConstraintTrigger ¶
func NewDeferrableConstraintTrigger(trigname string, relation *RangeVar, funcname *NodeList, timing int16, events int16, constrrel *RangeVar, initdeferred bool) *CreateTriggerStmt
NewDeferrableConstraintTrigger creates a deferrable constraint trigger.
func (*CreateTriggerStmt) Location ¶
func (cts *CreateTriggerStmt) Location() int
Location returns the location for this node
func (*CreateTriggerStmt) NodeTag ¶
func (cts *CreateTriggerStmt) NodeTag() NodeTag
NodeTag returns the node's type tag
func (*CreateTriggerStmt) SqlString ¶
func (cts *CreateTriggerStmt) SqlString() string
SqlString returns SQL representation of the CREATE TRIGGER statement
func (*CreateTriggerStmt) StatementType ¶
func (cts *CreateTriggerStmt) StatementType() string
StatementType returns the statement type for this node
func (*CreateTriggerStmt) String ¶
func (cts *CreateTriggerStmt) String() string
type CreateUserMappingStmt ¶
type CreateUserMappingStmt struct {
BaseNode
User *RoleSpec // User role - parsenodes.h:2909
Servername string // Foreign server name - parsenodes.h:2910
IfNotExists bool // IF NOT EXISTS clause - parsenodes.h:2911
Options *NodeList // Generic options to FDW - parsenodes.h:2912
}
CreateUserMappingStmt represents CREATE USER MAPPING statements. This maps database users to foreign server users. Ported from postgres/src/include/nodes/parsenodes.h:2907
func CloneRefOfCreateUserMappingStmt ¶
func CloneRefOfCreateUserMappingStmt(n *CreateUserMappingStmt) *CreateUserMappingStmt
CloneRefOfCreateUserMappingStmt creates a deep clone of the input.
func NewCreateUserMappingStmt ¶
func NewCreateUserMappingStmt(user *RoleSpec, servername string, options *NodeList, ifNotExists bool) *CreateUserMappingStmt
NewCreateUserMappingStmt creates a new CreateUserMappingStmt node. NewCreateUserMappingStmt creates a new CreateUserMappingStmt node.
func (*CreateUserMappingStmt) SqlString ¶
func (cums *CreateUserMappingStmt) SqlString() string
SqlString returns the SQL representation of the CREATE USER MAPPING statement
func (*CreateUserMappingStmt) StatementType ¶
func (cums *CreateUserMappingStmt) StatementType() string
func (*CreateUserMappingStmt) String ¶
func (cums *CreateUserMappingStmt) String() string
type CreatedbStmt ¶
type CreatedbStmt struct {
BaseNode
Dbname string // name of database to create - postgres/src/include/nodes/parsenodes.h:3789
Options *NodeList // list of DefElem nodes - postgres/src/include/nodes/parsenodes.h:3790
}
CreatedbStmt represents a CREATE DATABASE statement. Ported from postgres/src/include/nodes/parsenodes.h:3787
func CloneRefOfCreatedbStmt ¶
func CloneRefOfCreatedbStmt(n *CreatedbStmt) *CreatedbStmt
CloneRefOfCreatedbStmt creates a deep clone of the input.
func NewCreatedbStmt ¶
func NewCreatedbStmt(dbname string, options *NodeList) *CreatedbStmt
NewCreatedbStmt creates a new CreatedbStmt node.
func (*CreatedbStmt) SqlString ¶
func (c *CreatedbStmt) SqlString() string
SqlString returns the SQL representation of CreatedbStmt
func (*CreatedbStmt) StatementType ¶
func (c *CreatedbStmt) StatementType() string
func (*CreatedbStmt) String ¶
func (c *CreatedbStmt) String() string
type CurrentOfExpr ¶
type CurrentOfExpr struct {
BaseExpr
Cvarno Index // RT index of target relation - primnodes.h:2097
CursorName string // Name of referenced cursor, or NULL - primnodes.h:2098
CursorParam int // Refcursor parameter number, or 0 - primnodes.h:2099
}
CurrentOfExpr represents CURRENT OF cursor_name expressions. This is used in UPDATE and DELETE statements to refer to the current row of a cursor. Ported from postgres/src/include/nodes/primnodes.h:2094
func CloneRefOfCurrentOfExpr ¶
func CloneRefOfCurrentOfExpr(n *CurrentOfExpr) *CurrentOfExpr
CloneRefOfCurrentOfExpr creates a deep clone of the input.
func NewCurrentOfExpr ¶
func NewCurrentOfExpr(cvarno Index, cursor_name string) *CurrentOfExpr
NewCurrentOfExpr creates a new CurrentOfExpr node.
func NewCurrentOfExprParam ¶
func NewCurrentOfExprParam(cvarno Index, cursor_param int) *CurrentOfExpr
NewCurrentOfExprParam creates a new CurrentOfExpr with parameter reference.
func (*CurrentOfExpr) ExpressionType ¶
func (coe *CurrentOfExpr) ExpressionType() string
func (*CurrentOfExpr) SqlString ¶
func (c *CurrentOfExpr) SqlString() string
SqlString returns the SQL representation of the CurrentOfExpr.
func (*CurrentOfExpr) String ¶
func (coe *CurrentOfExpr) String() string
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
A Cursor describes a node encountered during Rewrite. Information about the node and its parent is available from the Node and Parent methods.
func (*Cursor) Replace ¶
Replace replaces the current node in the parent field with this new object. The caller needs to make sure to not replace the object with something of the wrong type, or the visitor will panic.
func (*Cursor) ReplaceAndRevisit ¶
ReplaceAndRevisit replaces the current node in the parent field with this new object. When used, this will abort the visitation of the current node - no post or children visited, and the new node visited.
type Datum ¶
Datum is the value carried by a Const - ported from postgres/src/include/postgres.h:64. It is the evaluation engine's GC-safe Datum, aliased from the leaf datum package: PostgreSQL's parser and executor share one Datum definition through postgres.h, and the analyzed expression tree here carries exactly the values the engine evaluates.
func CloneRefOfDatum ¶
CloneRefOfDatum creates a deep clone of the input.
type DeallocateStmt ¶
type DeallocateStmt struct {
BaseNode
Name string // Statement name, or NULL for all - postgres/src/include/nodes/parsenodes.h:4060
IsAll bool // True if DEALLOCATE ALL - postgres/src/include/nodes/parsenodes.h:4067
}
DeallocateStmt represents a DEALLOCATE statement. Ported from postgres/src/include/nodes/parsenodes.h:4056
func CloneRefOfDeallocateStmt ¶
func CloneRefOfDeallocateStmt(n *DeallocateStmt) *DeallocateStmt
CloneRefOfDeallocateStmt creates a deep clone of the input.
func NewDeallocateAllStmt ¶
func NewDeallocateAllStmt() *DeallocateStmt
NewDeallocateAllStmt creates a new DEALLOCATE ALL statement.
func NewDeallocateStmt ¶
func NewDeallocateStmt(name string) *DeallocateStmt
NewDeallocateStmt creates a new DEALLOCATE statement.
func (*DeallocateStmt) SqlString ¶
func (ds *DeallocateStmt) SqlString() string
SqlString returns the SQL representation of the DEALLOCATE statement
func (*DeallocateStmt) StatementType ¶
func (ds *DeallocateStmt) StatementType() string
func (*DeallocateStmt) String ¶
func (ds *DeallocateStmt) String() string
type DeclareCursorStmt ¶
type DeclareCursorStmt struct {
BaseNode
PortalName string // name of the portal (cursor)
Options int // bitmask of options
Query Node // the query (raw parse tree)
}
DeclareCursorStmt represents a DECLARE cursor statement Ported from postgres/src/include/nodes/parsenodes.h:3293-3299
func CloneRefOfDeclareCursorStmt ¶
func CloneRefOfDeclareCursorStmt(n *DeclareCursorStmt) *DeclareCursorStmt
CloneRefOfDeclareCursorStmt creates a deep clone of the input.
func NewDeclareCursorStmt ¶
func NewDeclareCursorStmt(portalName string, options int, query Node) *DeclareCursorStmt
NewDeclareCursorStmt creates a new DeclareCursorStmt node
func (*DeclareCursorStmt) SqlString ¶
func (dcs *DeclareCursorStmt) SqlString() string
SqlString returns the SQL representation of the DECLARE CURSOR statement
func (*DeclareCursorStmt) StatementType ¶
func (dcs *DeclareCursorStmt) StatementType() string
func (*DeclareCursorStmt) String ¶
func (dcs *DeclareCursorStmt) String() string
String returns string representation of DeclareCursorStmt
type DefElem ¶
type DefElem struct {
BaseNode
Defnamespace string // NULL if unqualified name - postgres/src/include/nodes/parsenodes.h:813
Defname string // postgres/src/include/nodes/parsenodes.h:814
Arg Node // typically Integer, Float, String, or TypeName - postgres/src/include/nodes/parsenodes.h:815
Defaction DefElemAction // unspecified action, or SET/ADD/DROP - postgres/src/include/nodes/parsenodes.h:816
}
DefElem represents a generic name/value pair for options. Ported from postgres/src/include/nodes/parsenodes.h:811
func CloneRefOfDefElem ¶
CloneRefOfDefElem creates a deep clone of the input.
func CloneSliceOfRefOfDefElem ¶
CloneSliceOfRefOfDefElem creates a deep clone of the input.
func NewDefElem ¶
NewDefElem creates a new DefElem node.
func NewDefElemExtended ¶
func NewDefElemExtended(defnamespace, defname string, arg Node, action DefElemAction) *DefElem
NewDefElemExtended creates a new DefElem node with a qualified name.
func (*DefElem) SqlStringForFunction ¶
SqlStringForFunction returns the SQL representation of DefElem for function options This handles the special formatting needed for ALTER FUNCTION statements
type DefElemAction ¶
type DefElemAction int
DefElemAction represents actions for DefElem - ported from postgres/src/include/nodes/parsenodes.h:803-809
const ( DEFELEM_UNSPEC DefElemAction = iota // no action given DEFELEM_SET // SET DEFELEM_ADD // ADD DEFELEM_DROP // DROP )
func (DefElemAction) String ¶
func (d DefElemAction) String() string
type DefineStmt ¶
type DefineStmt struct {
BaseNode
Kind ObjectType // aggregate, operator, type
OldStyle bool // hack to signal old CREATE AGG syntax
DefNames *NodeList // qualified name (list of String)
Args *NodeList // list of TypeName (if needed)
Definition *NodeList // list of DefElem
IfNotExists bool // true for IF NOT EXISTS
Replace bool // true for CREATE OR REPLACE
}
DefineStmt represents a CREATE {AGGREGATE|OPERATOR|TYPE} statement Ported from postgres/src/include/nodes/parsenodes.h:3140-3150
func CloneRefOfDefineStmt ¶
func CloneRefOfDefineStmt(n *DefineStmt) *DefineStmt
CloneRefOfDefineStmt creates a deep clone of the input.
func NewDefineStmt ¶
func NewDefineStmt(kind ObjectType, oldStyle bool, defNames *NodeList, args *NodeList, definition *NodeList, ifNotExists, replace bool) *DefineStmt
NewDefineStmt creates a new DefineStmt node
func (*DefineStmt) SqlString ¶
func (ds *DefineStmt) SqlString() string
func (*DefineStmt) StatementType ¶
func (ds *DefineStmt) StatementType() string
StatementType returns the statement type
func (*DefineStmt) String ¶
func (ds *DefineStmt) String() string
String returns string representation of DefineStmt
type DeleteStmt ¶
type DeleteStmt struct {
BaseNode
Relation *RangeVar // Relation to delete from - postgres/src/include/nodes/parsenodes.h:2058
UsingClause *NodeList // Optional using clause for more tables - postgres/src/include/nodes/parsenodes.h:2059
WhereClause Node // Qualifications - postgres/src/include/nodes/parsenodes.h:2060
ReturningList *NodeList // List of expressions to return - postgres/src/include/nodes/parsenodes.h:2061
WithClause *WithClause // WITH clause - postgres/src/include/nodes/parsenodes.h:2062
}
DeleteStmt represents a DELETE statement. Ported from postgres/src/include/nodes/parsenodes.h:2055
func CloneRefOfDeleteStmt ¶
func CloneRefOfDeleteStmt(n *DeleteStmt) *DeleteStmt
CloneRefOfDeleteStmt creates a deep clone of the input.
func NewDeleteStmt ¶
func NewDeleteStmt(relation *RangeVar) *DeleteStmt
NewDeleteStmt creates a new DeleteStmt node.
func (*DeleteStmt) SqlString ¶
func (d *DeleteStmt) SqlString() string
SqlString returns the SQL representation of the DeleteStmt
func (*DeleteStmt) StatementType ¶
func (d *DeleteStmt) StatementType() string
func (*DeleteStmt) String ¶
func (d *DeleteStmt) String() string
type DiscardMode ¶
type DiscardMode int
DiscardMode represents the mode for DISCARD statement. Ported from postgres/src/include/nodes/parsenodes.h:3924-3930
const ( DISCARD_ALL DiscardMode = iota // DISCARD ALL DISCARD_PLANS // DISCARD PLANS DISCARD_SEQUENCES // DISCARD SEQUENCES DISCARD_TEMP // DISCARD TEMP )
func (DiscardMode) String ¶
func (d DiscardMode) String() string
type DiscardStmt ¶
type DiscardStmt struct {
BaseNode
Target DiscardMode // What to discard - postgres/src/include/nodes/parsenodes.h:3935
}
DiscardStmt represents a DISCARD statement. Ported from postgres/src/include/nodes/parsenodes.h:3932-3936
func CloneRefOfDiscardStmt ¶
func CloneRefOfDiscardStmt(n *DiscardStmt) *DiscardStmt
CloneRefOfDiscardStmt creates a deep clone of the input.
func NewDiscardStmt ¶
func NewDiscardStmt(target DiscardMode) *DiscardStmt
NewDiscardStmt creates a new DISCARD statement.
func (*DiscardStmt) SqlString ¶
func (ds *DiscardStmt) SqlString() string
func (*DiscardStmt) StatementType ¶
func (ds *DiscardStmt) StatementType() string
func (*DiscardStmt) String ¶
func (ds *DiscardStmt) String() string
type DistinctExpr ¶
type DistinctExpr struct {
BaseExpr
Opno Oid // pg_operator OID of the "=" operator - primnodes.h:816
Opfuncid Oid // Underlying function OID - primnodes.h:817
Opresulttype Oid // Result type (always bool) - primnodes.h:818
Opretset bool // Returns set? - primnodes.h:819
Opcollid Oid // Result collation - primnodes.h:820
Inputcollid Oid // Input collation - primnodes.h:821
Args *NodeList // The two operands - primnodes.h:822
}
DistinctExpr represents an IS DISTINCT FROM test. PostgreSQL declares it as "typedef OpExpr DistinctExpr" (primnodes.h:845): the same fields as OpExpr, distinguished only by the node tag, since the executor evaluates the underlying "=" operator with different NULL semantics. Ported from postgres/src/include/nodes/primnodes.h:838
func CloneRefOfDistinctExpr ¶
func CloneRefOfDistinctExpr(n *DistinctExpr) *DistinctExpr
CloneRefOfDistinctExpr creates a deep clone of the input.
func NewDistinctExpr ¶
func NewDistinctExpr(opno Oid, opfuncid Oid, opresulttype Oid, args *NodeList) *DistinctExpr
NewDistinctExpr creates a new DistinctExpr node.
func (*DistinctExpr) ExpressionType ¶
func (d *DistinctExpr) ExpressionType() string
func (*DistinctExpr) String ¶
func (d *DistinctExpr) String() string
type DoStmt ¶
DoStmt represents DO statements Ported from postgres/src/include/nodes/parsenodes.h:3437-3441
func CloneRefOfDoStmt ¶
CloneRefOfDoStmt creates a deep clone of the input.
func (*DoStmt) StatementType ¶
type DropBehavior ¶
type DropBehavior int
DropBehavior represents CASCADE/RESTRICT behavior - ported from postgres/src/include/nodes/parsenodes.h:2329-2333
const ( DropRestrict DropBehavior = iota // drop fails if any dependent objects DropCascade // remove dependent objects too )
func (DropBehavior) String ¶
func (d DropBehavior) String() string
type DropConnectionStmt ¶
DropConnectionStmt represents `DROP CONNECTION [IF EXISTS] name [, ...]`.
func CloneRefOfDropConnectionStmt ¶
func CloneRefOfDropConnectionStmt(n *DropConnectionStmt) *DropConnectionStmt
CloneRefOfDropConnectionStmt creates a deep clone of the input.
func NewDropConnectionStmt ¶
func NewDropConnectionStmt(names *NodeList, ifExists bool) *DropConnectionStmt
func (*DropConnectionStmt) SqlString ¶
func (n *DropConnectionStmt) SqlString() string
func (*DropConnectionStmt) StatementType ¶
func (n *DropConnectionStmt) StatementType() string
func (*DropConnectionStmt) String ¶
func (n *DropConnectionStmt) String() string
type DropMigrationStmt ¶
type DropMigrationStmt struct {
BaseNode
Names *NodeList // *String list
IfExists bool
Force bool
When *A_Expr // WHEN (field OP constant); nil if omitted, defaults to requiring the migration already caught up
Options *NodeList // WITH (...) options, a DefElem list; may be nil
}
DropMigrationStmt represents `DROP MIGRATION [IF EXISTS] name [, ...] [FORCE | [WHEN (cond)] [WITH (...)]]`.
func CloneRefOfDropMigrationStmt ¶
func CloneRefOfDropMigrationStmt(n *DropMigrationStmt) *DropMigrationStmt
CloneRefOfDropMigrationStmt creates a deep clone of the input.
func NewDropMigrationStmt ¶
func NewDropMigrationStmt(names *NodeList, ifExists bool, behavior *MigrationDropBehavior) *DropMigrationStmt
func (*DropMigrationStmt) SqlString ¶
func (n *DropMigrationStmt) SqlString() string
func (*DropMigrationStmt) StatementType ¶
func (n *DropMigrationStmt) StatementType() string
func (*DropMigrationStmt) String ¶
func (n *DropMigrationStmt) String() string
type DropOwnedStmt ¶
type DropOwnedStmt struct {
BaseNode
Roles *NodeList // list of RoleSpec - postgres/src/include/nodes/parsenodes.h:4078
Behavior DropBehavior // CASCADE or RESTRICT - postgres/src/include/nodes/parsenodes.h:4079
}
DropOwnedStmt represents a DROP OWNED statement. Ported from postgres/src/include/nodes/parsenodes.h:4075
func CloneRefOfDropOwnedStmt ¶
func CloneRefOfDropOwnedStmt(n *DropOwnedStmt) *DropOwnedStmt
CloneRefOfDropOwnedStmt creates a deep clone of the input.
func NewDropOwnedStmt ¶
func NewDropOwnedStmt(roles *NodeList, behavior DropBehavior) *DropOwnedStmt
NewDropOwnedStmt creates a new DropOwnedStmt node.
func (*DropOwnedStmt) SqlString ¶
func (d *DropOwnedStmt) SqlString() string
SqlString returns the SQL representation of DropOwnedStmt
func (*DropOwnedStmt) StatementType ¶
func (d *DropOwnedStmt) StatementType() string
func (*DropOwnedStmt) String ¶
func (d *DropOwnedStmt) String() string
type DropReplicationSlotCmd ¶
type DropReplicationSlotCmd struct {
BaseNode
SlotName string // replnodes.h:70
Wait bool // replnodes.h:71
}
DropReplicationSlotCmd - DROP_REPLICATION_SLOT command. Ported from postgres/src/include/nodes/replnodes.h:67-72
func CloneRefOfDropReplicationSlotCmd ¶
func CloneRefOfDropReplicationSlotCmd(n *DropReplicationSlotCmd) *DropReplicationSlotCmd
CloneRefOfDropReplicationSlotCmd creates a deep clone of the input.
func NewDropReplicationSlotCmd ¶
func NewDropReplicationSlotCmd(slot string, wait bool) *DropReplicationSlotCmd
func (*DropReplicationSlotCmd) SqlString ¶
func (n *DropReplicationSlotCmd) SqlString() string
func (*DropReplicationSlotCmd) StatementType ¶
func (n *DropReplicationSlotCmd) StatementType() string
type DropRoleStmt ¶
type DropRoleStmt struct {
BaseNode
Roles *NodeList // List of roles to remove - postgres/src/include/nodes/parsenodes.h:3108
MissingOk bool // Skip error if a role is missing? - postgres/src/include/nodes/parsenodes.h:3109
}
DropRoleStmt represents a DROP ROLE/USER/GROUP statement. Ported from postgres/src/include/nodes/parsenodes.h:3105
func CloneRefOfDropRoleStmt ¶
func CloneRefOfDropRoleStmt(n *DropRoleStmt) *DropRoleStmt
CloneRefOfDropRoleStmt creates a deep clone of the input.
func NewDropRoleStmt ¶
func NewDropRoleStmt(roles *NodeList, missingOk bool) *DropRoleStmt
NewDropRoleStmt creates a new DROP ROLE statement.
func (*DropRoleStmt) SqlString ¶
func (drs *DropRoleStmt) SqlString() string
func (*DropRoleStmt) StatementType ¶
func (drs *DropRoleStmt) StatementType() string
func (*DropRoleStmt) String ¶
func (drs *DropRoleStmt) String() string
type DropStmt ¶
type DropStmt struct {
BaseNode
Objects *NodeList // List of names - postgres/src/include/nodes/parsenodes.h:3229
RemoveType ObjectType // Object type - postgres/src/include/nodes/parsenodes.h:3230
Behavior DropBehavior // RESTRICT or CASCADE behavior - postgres/src/include/nodes/parsenodes.h:3231
MissingOk bool // Skip error if object is missing? - postgres/src/include/nodes/parsenodes.h:3232
Concurrent bool // Drop index concurrently? - postgres/src/include/nodes/parsenodes.h:3233
}
DropStmt represents a DROP statement. Ported from postgres/src/include/nodes/parsenodes.h:3226
func CloneRefOfDropStmt ¶
CloneRefOfDropStmt creates a deep clone of the input.
func NewDropStmt ¶
func NewDropStmt(objects *NodeList, removeType ObjectType) *DropStmt
NewDropStmt creates a new DropStmt node.
func (*DropStmt) StatementType ¶
type DropTableSpaceStmt ¶
type DropTableSpaceStmt struct {
BaseNode
Tablespacename string // tablespace to drop - postgres/src/include/nodes/parsenodes.h:2792
MissingOk bool // skip error if missing? - postgres/src/include/nodes/parsenodes.h:2793
}
DropTableSpaceStmt represents a DROP TABLESPACE statement. Ported from postgres/src/include/nodes/parsenodes.h:2790
func CloneRefOfDropTableSpaceStmt ¶
func CloneRefOfDropTableSpaceStmt(n *DropTableSpaceStmt) *DropTableSpaceStmt
CloneRefOfDropTableSpaceStmt creates a deep clone of the input.
func NewDropTableSpaceStmt ¶
func NewDropTableSpaceStmt(tablespacename string, missingOk bool) *DropTableSpaceStmt
NewDropTableSpaceStmt creates a new DropTableSpaceStmt node.
func (*DropTableSpaceStmt) SqlString ¶
func (d *DropTableSpaceStmt) SqlString() string
SqlString returns the SQL representation of DropTableSpaceStmt
func (*DropTableSpaceStmt) StatementType ¶
func (d *DropTableSpaceStmt) StatementType() string
func (*DropTableSpaceStmt) String ¶
func (d *DropTableSpaceStmt) String() string
type DropUserMappingStmt ¶
type DropUserMappingStmt struct {
BaseNode
User *RoleSpec `json:"user"` // user name or role
Servername string `json:"servername"` // server name
MissingOk bool `json:"missing_ok"` // IF EXISTS option
}
DropUserMappingStmt represents DROP USER MAPPING statement Ported from postgres/src/include/nodes/parsenodes.h DropUserMappingStmt
func CloneRefOfDropUserMappingStmt ¶
func CloneRefOfDropUserMappingStmt(n *DropUserMappingStmt) *DropUserMappingStmt
CloneRefOfDropUserMappingStmt creates a deep clone of the input.
func NewDropUserMappingStmt ¶
func NewDropUserMappingStmt(user *RoleSpec, servername string, missingOk bool) *DropUserMappingStmt
NewDropUserMappingStmt creates a new DropUserMappingStmt node
func (*DropUserMappingStmt) SqlString ¶
func (d *DropUserMappingStmt) SqlString() string
SqlString returns the SQL representation of DropUserMappingStmt
func (*DropUserMappingStmt) StatementType ¶
func (d *DropUserMappingStmt) StatementType() string
func (*DropUserMappingStmt) String ¶
func (d *DropUserMappingStmt) String() string
type DropdbStmt ¶
type DropdbStmt struct {
BaseNode
Dbname string // database to drop - postgres/src/include/nodes/parsenodes.h:3803
MissingOk bool // skip error if db is missing? - postgres/src/include/nodes/parsenodes.h:3804
Options *NodeList // currently only FORCE is supported - postgres/src/include/nodes/parsenodes.h:3805
}
DropdbStmt represents a DROP DATABASE statement. Ported from postgres/src/include/nodes/parsenodes.h:3800
func CloneRefOfDropdbStmt ¶
func CloneRefOfDropdbStmt(n *DropdbStmt) *DropdbStmt
CloneRefOfDropdbStmt creates a deep clone of the input.
func NewDropdbStmt ¶
func NewDropdbStmt(dbname string, missingOk bool, options *NodeList) *DropdbStmt
NewDropdbStmt creates a new DropdbStmt node.
func (*DropdbStmt) SqlString ¶
func (d *DropdbStmt) SqlString() string
SqlString returns the SQL representation of DropdbStmt
func (*DropdbStmt) StatementType ¶
func (d *DropdbStmt) StatementType() string
func (*DropdbStmt) String ¶
func (d *DropdbStmt) String() string
type ExecuteStmt ¶
type ExecuteStmt struct {
BaseNode
Name string // Statement name - postgres/src/include/nodes/parsenodes.h:4047
Params *NodeList // List of parameter expressions - postgres/src/include/nodes/parsenodes.h:4048
}
ExecuteStmt represents an EXECUTE statement. Ported from postgres/src/include/nodes/parsenodes.h:4044
func CloneRefOfExecuteStmt ¶
func CloneRefOfExecuteStmt(n *ExecuteStmt) *ExecuteStmt
CloneRefOfExecuteStmt creates a deep clone of the input.
func NewExecuteStmt ¶
func NewExecuteStmt(name string, params *NodeList) *ExecuteStmt
NewExecuteStmt creates a new EXECUTE statement.
func (*ExecuteStmt) SqlString ¶
func (es *ExecuteStmt) SqlString() string
SqlString returns the SQL representation of the EXECUTE statement
func (*ExecuteStmt) StatementType ¶
func (es *ExecuteStmt) StatementType() string
func (*ExecuteStmt) String ¶
func (es *ExecuteStmt) String() string
type ExplainStmt ¶
type ExplainStmt struct {
BaseNode
Query Node // The query to explain - postgres/src/include/nodes/parsenodes.h:3871
Options *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:3872
}
ExplainStmt represents an EXPLAIN statement. Ported from postgres/src/include/nodes/parsenodes.h:3868
func CloneRefOfExplainStmt ¶
func CloneRefOfExplainStmt(n *ExplainStmt) *ExplainStmt
CloneRefOfExplainStmt creates a deep clone of the input.
func NewExplainStmt ¶
func NewExplainStmt(query Node, options *NodeList) *ExplainStmt
NewExplainStmt creates a new EXPLAIN statement.
func (*ExplainStmt) SqlString ¶
func (es *ExplainStmt) SqlString() string
SqlString returns the SQL representation of the EXPLAIN statement
func (*ExplainStmt) StatementType ¶
func (es *ExplainStmt) StatementType() string
func (*ExplainStmt) String ¶
func (es *ExplainStmt) String() string
type Expr ¶
Expr is the abstract base type for all expression nodes. Ported from postgres/src/include/nodes/primnodes.h:187-192
type Expression ¶
Expression represents the base interface for all SQL expressions. All expressions in WHERE clauses, SELECT lists, etc. implement this. Ported from postgres expression node concept
func CloneExpression ¶
func CloneExpression(in Expression) Expression
CloneExpression creates a deep clone of the input.
func CloneSliceOfExpression ¶
func CloneSliceOfExpression(n []Expression) []Expression
CloneSliceOfExpression creates a deep clone of the input.
type FetchDirection ¶
type FetchDirection int
FetchDirection represents the direction for cursor fetch operations Ported from postgres/src/include/nodes/parsenodes.h:3316-3324
const ( FETCH_FORWARD FetchDirection = iota // forward direction, howMany is row count FETCH_BACKWARD // backward direction, howMany is row count FETCH_ABSOLUTE // absolute position, howMany is position FETCH_RELATIVE // relative position, howMany is offset )
func (FetchDirection) String ¶
func (fd FetchDirection) String() string
String returns string representation of FetchDirection
type FetchStmt ¶
type FetchStmt struct {
BaseNode
Direction FetchDirection // see FetchDirection enum
HowMany int64 // number of rows, or position argument
PortalName string // name of portal (cursor)
IsMove bool // true if MOVE
}
FetchStmt represents a FETCH statement (also MOVE) Ported from postgres/src/include/nodes/parsenodes.h:3328-3335
func CloneRefOfFetchStmt ¶
CloneRefOfFetchStmt creates a deep clone of the input.
func NewFetchStmt ¶
func NewFetchStmt(direction FetchDirection, howMany int64, portalName string, isMove bool) *FetchStmt
NewFetchStmt creates a new FetchStmt node
func (*FetchStmt) StatementType ¶
type FieldSelect ¶
type FieldSelect struct {
BaseExpr
Arg Expression // Input expression (composite type) - primnodes.h:1409
Fieldnum AttrNumber // Attribute number of field to extract - primnodes.h:1410
Resulttype Oid // Type OID of the field - primnodes.h:1411
Resulttypmod int32 // Output typmod (usually -1) - primnodes.h:1412
}
FieldSelect represents field selection from a composite value (record.field). This extracts a single field from a composite type value. Ported from postgres/src/include/nodes/primnodes.h:1125
func CloneRefOfFieldSelect ¶
func CloneRefOfFieldSelect(n *FieldSelect) *FieldSelect
CloneRefOfFieldSelect creates a deep clone of the input.
func NewFieldSelect ¶
func NewFieldSelect(arg Expression, fieldnum AttrNumber, resulttype Oid) *FieldSelect
NewFieldSelect creates a new FieldSelect node.
func (*FieldSelect) ExpressionType ¶
func (fs *FieldSelect) ExpressionType() string
func (*FieldSelect) String ¶
func (fs *FieldSelect) String() string
type FieldStore ¶
type FieldStore struct {
BaseExpr
Arg Expression // Input expression (composite type) - primnodes.h:1429
Newvals []Expression // New value(s) for field(s) - primnodes.h:1430
Fieldnums []AttrNumber // Field number(s) to be updated - primnodes.h:1431
Resulttype Oid // Type OID of result (same as input type) - primnodes.h:1432
}
FieldStore represents field assignment to a composite value. This is used for UPDATE operations on composite type columns. Ported from postgres/src/include/nodes/primnodes.h:1156
func CloneRefOfFieldStore ¶
func CloneRefOfFieldStore(n *FieldStore) *FieldStore
CloneRefOfFieldStore creates a deep clone of the input.
func NewFieldStore ¶
func NewFieldStore(arg Expression, newvals []Expression, fieldnums []AttrNumber, resulttype Oid) *FieldStore
NewFieldStore creates a new FieldStore node.
func NewSingleFieldStore ¶
func NewSingleFieldStore(arg Expression, newval Expression, fieldnum AttrNumber, resulttype Oid) *FieldStore
NewSingleFieldStore creates a FieldStore for updating a single field.
func (*FieldStore) ExpressionType ¶
func (fs *FieldStore) ExpressionType() string
func (*FieldStore) String ¶
func (fs *FieldStore) String() string
type Float ¶
type Float struct {
BaseNode
FVal string // Float value as string - postgres/src/include/nodes/value.h:52
}
Float represents a floating-point literal value node. Stored as string to preserve precision, like PostgreSQL. Ported from postgres/src/include/nodes/value.h:47-53
func CloneRefOfFloat ¶
CloneRefOfFloat creates a deep clone of the input.
func NewFloat ¶
NewFloat creates a new float literal node. Ported from postgres/src/include/nodes/value.h:85 (makeFloat)
func (*Float) ExpressionType ¶
type FromExpr ¶
type FromExpr struct {
BaseExpr
Fromlist *NodeList // List of join subtrees - primnodes.h:2308
Quals Expression // Qualifiers on join, if any - primnodes.h:2309
}
FromExpr represents a FROM clause. This node represents the FROM clause of a query, including all table references and their qualifying conditions. Ported from postgres/src/include/nodes/primnodes.h:2305
func CloneRefOfFromExpr ¶
CloneRefOfFromExpr creates a deep clone of the input.
func NewFromExpr ¶
func NewFromExpr(fromlist *NodeList, quals Expression) *FromExpr
NewFromExpr creates a new FromExpr node.
func (*FromExpr) ExpressionType ¶
type FuncCall ¶
type FuncCall struct {
BaseNode
Funcname *NodeList // Qualified function name
Args *NodeList // List of arguments
AggOrder *NodeList // ORDER BY list for aggregates
AggFilter Node // FILTER clause for aggregates
Over *WindowDef // OVER clause for window functions
AggWithinGroup bool // ORDER BY appeared in WITHIN GROUP
AggStar bool // Function was written as foo(*)
AggDistinct bool // DISTINCT was specified
FuncVariadic bool // VARIADIC was specified
Funcformat CoercionForm // How to display this node
}
FuncCall represents a function call in the parse tree. Ported from postgres/src/include/nodes/parsenodes.h:423-444
func CloneRefOfFuncCall ¶
CloneRefOfFuncCall creates a deep clone of the input.
func NewFuncCall ¶
NewFuncCall creates a new FuncCall node.
func (*FuncCall) ExpressionType ¶
type FuncExpr ¶
type FuncExpr struct {
BaseExpr
Funcid Oid // pg_proc OID - postgres/src/include/nodes/primnodes.h:749
Funcresulttype Oid // Result type OID - postgres/src/include/nodes/primnodes.h:750
Funcretset bool // Returns set? - postgres/src/include/nodes/primnodes.h:751
Funcvariadic bool // Variadic arguments? - postgres/src/include/nodes/primnodes.h:752
Funcformat CoercionForm // Display format - postgres/src/include/nodes/primnodes.h:753
Funccollid Oid // Result collation - postgres/src/include/nodes/primnodes.h:754
Inputcollid Oid // Input collation - postgres/src/include/nodes/primnodes.h:755
Args *NodeList // Function arguments - postgres/src/include/nodes/primnodes.h:756
}
FuncExpr represents a function call expression. Ported from postgres/src/include/nodes/primnodes.h:746
func CloneRefOfFuncExpr ¶
CloneRefOfFuncExpr creates a deep clone of the input.
func NewFuncExpr ¶
NewFuncExpr creates a new FuncExpr node.
func (*FuncExpr) ExpressionType ¶
type FunctionParameter ¶
type FunctionParameter struct {
BaseNode
Name string // parameter name, or empty string if not given
ArgType *TypeName // type name for parameter type
Mode FunctionParameterMode // IN/OUT/INOUT/VARIADIC/TABLE/DEFAULT
DefExpr Node // raw default expr, or nil if not given
}
FunctionParameter represents a function parameter specification Ported from postgres/src/include/nodes/parsenodes.h:3451-3458
func CloneRefOfFunctionParameter ¶
func CloneRefOfFunctionParameter(n *FunctionParameter) *FunctionParameter
CloneRefOfFunctionParameter creates a deep clone of the input.
func NewFunctionParameter ¶
func NewFunctionParameter(name string, argType *TypeName, mode FunctionParameterMode, defExpr Node) *FunctionParameter
NewFunctionParameter creates a new FunctionParameter node
func (*FunctionParameter) SqlString ¶
func (fp *FunctionParameter) SqlString() string
SqlString returns the SQL representation of FunctionParameter
func (*FunctionParameter) String ¶
func (fp *FunctionParameter) String() string
String returns string representation of FunctionParameter
type FunctionParameterMode ¶
type FunctionParameterMode int
FunctionParameterMode represents parameter passing modes for function parameters Ported from postgres/src/include/nodes/parsenodes.h:3439-3449
const ( FUNC_PARAM_IN FunctionParameterMode = iota // input only FUNC_PARAM_OUT // output only FUNC_PARAM_INOUT // both FUNC_PARAM_VARIADIC // variadic (always input) FUNC_PARAM_TABLE // table function output column FUNC_PARAM_DEFAULT // default; effectively same as IN )
func (FunctionParameterMode) String ¶
func (fpm FunctionParameterMode) String() string
String returns string representation of FunctionParameterMode
type GrantRoleStmt ¶
type GrantRoleStmt struct {
BaseNode
GrantedRoles *NodeList // List of roles to be granted/revoked - postgres/src/include/nodes/parsenodes.h:2559
GranteeRoles *NodeList // List of member roles to add/delete - postgres/src/include/nodes/parsenodes.h:2560
IsGrant bool // True = GRANT, false = REVOKE - postgres/src/include/nodes/parsenodes.h:2561
Opt *NodeList // Options e.g. WITH GRANT OPTION - postgres/src/include/nodes/parsenodes.h:2562
Grantor *RoleSpec // Set by GRANTED BY (when not NULL) - postgres/src/include/nodes/parsenodes.h:2563
Behavior DropBehavior // Drop behavior for REVOKE - postgres/src/include/nodes/parsenodes.h:2564
}
GrantRoleStmt represents a GRANT/REVOKE role statement. Ported from postgres/src/include/nodes/parsenodes.h:2556
func CloneRefOfGrantRoleStmt ¶
func CloneRefOfGrantRoleStmt(n *GrantRoleStmt) *GrantRoleStmt
CloneRefOfGrantRoleStmt creates a deep clone of the input.
func NewGrantRoleStmt ¶
func NewGrantRoleStmt(grantedRoles, granteeRoles *NodeList) *GrantRoleStmt
NewGrantRoleStmt creates a new GRANT role statement.
func NewGrantRoleStmtWithOptions ¶
func NewGrantRoleStmtWithOptions(grantedRoles, granteeRoles *NodeList, opt *NodeList) *GrantRoleStmt
NewGrantRoleStmtWithOptions creates a new GRANT role statement with options.
func NewRevokeRoleStmt ¶
func NewRevokeRoleStmt(grantedRoles, granteeRoles *NodeList) *GrantRoleStmt
NewRevokeRoleStmt creates a new REVOKE role statement.
func (*GrantRoleStmt) SqlString ¶
func (grs *GrantRoleStmt) SqlString() string
SqlString returns the SQL representation of the GRANT/REVOKE role statement
func (*GrantRoleStmt) StatementType ¶
func (grs *GrantRoleStmt) StatementType() string
func (*GrantRoleStmt) String ¶
func (grs *GrantRoleStmt) String() string
type GrantStmt ¶
type GrantStmt struct {
BaseNode
IsGrant bool // True = GRANT, false = REVOKE - postgres/src/include/nodes/parsenodes.h:2494
Targtype GrantTargetType // Type of target - postgres/src/include/nodes/parsenodes.h:2495
Objtype ObjectType // Kind of object being operated on - postgres/src/include/nodes/parsenodes.h:2496
Objects *NodeList // List of RangeVar nodes, or list of String nodes - postgres/src/include/nodes/parsenodes.h:2497
Privileges *NodeList // List of AccessPriv nodes - postgres/src/include/nodes/parsenodes.h:2498
Grantees *NodeList // List of RoleSpec nodes - postgres/src/include/nodes/parsenodes.h:2499
GrantOption bool // Grant or revoke grant option - postgres/src/include/nodes/parsenodes.h:2500
Grantor *RoleSpec // Set by GRANTED BY (when not NULL) - postgres/src/include/nodes/parsenodes.h:2501
Behavior DropBehavior // Drop behavior - postgres/src/include/nodes/parsenodes.h:2502
}
GrantStmt represents a GRANT or REVOKE statement. Ported from postgres/src/include/nodes/parsenodes.h:2491
func CloneRefOfGrantStmt ¶
CloneRefOfGrantStmt creates a deep clone of the input.
func NewGrantStmt ¶
func NewGrantStmt(objtype ObjectType, objects *NodeList, privileges *NodeList, grantees *NodeList) *GrantStmt
NewGrantStmt creates a new GRANT statement.
func NewRevokeStmt ¶
func NewRevokeStmt(objtype ObjectType, objects *NodeList, privileges *NodeList, grantees *NodeList) *GrantStmt
NewRevokeStmt creates a new REVOKE statement.
func (*GrantStmt) SqlString ¶
SqlString returns the SQL representation of the GRANT/REVOKE statement
func (*GrantStmt) StatementType ¶
type GrantTargetType ¶
type GrantTargetType int
GrantTargetType represents the target type for GRANT/REVOKE statements. Ported from postgres/src/include/nodes/parsenodes.h:2472-2489
const ( ACL_TARGET_OBJECT GrantTargetType = iota // Grant on specific objects ACL_TARGET_ALL_IN_SCHEMA // Grant on all objects in schema ACL_TARGET_DEFAULTS // Alter default privileges )
func (GrantTargetType) String ¶
func (g GrantTargetType) String() string
type GroupClause ¶
type GroupClause struct {
Distinct bool // true if GROUP BY DISTINCT
List *NodeList // list of GROUP BY expressions
}
GroupClause represents a GROUP BY clause with quantifier. Private struct for the result of group_clause production Ported from postgres/src/backend/parser/gram.y:135
type GroupingFunc ¶
type GroupingFunc struct {
BaseExpr
Args *NodeList // Arguments, not evaluated but kept for EXPLAIN
Refs *NodeList // Resource sort group refs of arguments
Cols *NodeList // Actual column positions set by planner
AggLevelsUp Index // Same as Aggref.agglevelsup
}
GroupingFunc represents a GROUPING function call Ported from postgres/src/include/nodes/primnodes.h:537-548
func CloneRefOfGroupingFunc ¶
func CloneRefOfGroupingFunc(n *GroupingFunc) *GroupingFunc
CloneRefOfGroupingFunc creates a deep clone of the input.
func NewGroupingFunc ¶
func NewGroupingFunc(args *NodeList, refs, cols *NodeList, aggLevelsUp Index, location int) *GroupingFunc
NewGroupingFunc creates a new GroupingFunc node.
func (*GroupingFunc) ExpressionType ¶
func (g *GroupingFunc) ExpressionType() string
func (*GroupingFunc) SqlString ¶
func (g *GroupingFunc) SqlString() string
SqlString returns the SQL representation of GroupingFunc
func (*GroupingFunc) String ¶
func (g *GroupingFunc) String() string
type GroupingSet ¶
type GroupingSet struct {
BaseNode
Kind GroupingSetKind // Type of grouping set
Content *NodeList // List of expressions
}
GroupingSet represents a grouping set in GROUP BY clauses. Ported from postgres/src/include/nodes/parsenodes.h:1506-1517
func CloneRefOfGroupingSet ¶
func CloneRefOfGroupingSet(n *GroupingSet) *GroupingSet
CloneRefOfGroupingSet creates a deep clone of the input.
func NewGroupingSet ¶
func NewGroupingSet(kind GroupingSetKind, content *NodeList, location int) *GroupingSet
NewGroupingSet creates a new GroupingSet node.
func (*GroupingSet) SqlString ¶
func (g *GroupingSet) SqlString() string
SqlString returns the SQL representation of the GroupingSet
func (*GroupingSet) StatementType ¶
func (g *GroupingSet) StatementType() string
func (*GroupingSet) String ¶
func (g *GroupingSet) String() string
type GroupingSetKind ¶
type GroupingSetKind int
GroupingSetKind represents the type of grouping set. Ported from postgres/src/include/nodes/parsenodes.h:1490-1505
const ( GROUPING_SET_EMPTY GroupingSetKind = iota GROUPING_SET_SIMPLE GROUPING_SET_ROLLUP GROUPING_SET_CUBE GROUPING_SET_SETS )
type Identifier ¶
Identifier represents a simple identifier (table name, column name, etc.). Ported from basic identifier concept used throughout postgres AST
func CloneRefOfIdentifier ¶
func CloneRefOfIdentifier(n *Identifier) *Identifier
CloneRefOfIdentifier creates a deep clone of the input.
func NewIdentifier ¶
func NewIdentifier(name string) *Identifier
NewIdentifier creates a new identifier node.
func (*Identifier) ExpressionType ¶
func (i *Identifier) ExpressionType() string
ExpressionType returns the expression type for Expression interface.
func (*Identifier) String ¶
func (i *Identifier) String() string
String returns the identifier name.
type IdentifySystemCmd ¶
type IdentifySystemCmd struct {
BaseNode
}
IdentifySystemCmd - IDENTIFY_SYSTEM command. Ported from postgres/src/include/nodes/replnodes.h:31-34
func CloneRefOfIdentifySystemCmd ¶
func CloneRefOfIdentifySystemCmd(n *IdentifySystemCmd) *IdentifySystemCmd
CloneRefOfIdentifySystemCmd creates a deep clone of the input.
func NewIdentifySystemCmd ¶
func NewIdentifySystemCmd() *IdentifySystemCmd
func (*IdentifySystemCmd) SqlString ¶
func (n *IdentifySystemCmd) SqlString() string
func (*IdentifySystemCmd) StatementType ¶
func (n *IdentifySystemCmd) StatementType() string
type ImportForeignSchemaStmt ¶
type ImportForeignSchemaStmt struct {
BaseNode
ServerName *String // FDW server name
RemoteSchema *String // remote schema name to query
LocalSchema *String // local schema to create objects in
ListType ImportForeignSchemaType // type of table list
TableList *NodeList // List of RangeVar
Options *NodeList // list of options to pass to FDW
}
ImportForeignSchemaStmt represents an IMPORT FOREIGN SCHEMA statement Ported from postgres/src/include/nodes/parsenodes.h:4105-4115
func CloneRefOfImportForeignSchemaStmt ¶
func CloneRefOfImportForeignSchemaStmt(n *ImportForeignSchemaStmt) *ImportForeignSchemaStmt
CloneRefOfImportForeignSchemaStmt creates a deep clone of the input.
func NewImportForeignSchemaStmt ¶
func NewImportForeignSchemaStmt(serverName, remoteSchema, localSchema *String, listType ImportForeignSchemaType, tableList, options *NodeList, ) *ImportForeignSchemaStmt
NewImportForeignSchemaStmt creates a new ImportForeignSchemaStmt node
func (*ImportForeignSchemaStmt) SqlString ¶
func (i *ImportForeignSchemaStmt) SqlString() string
SqlString returns the SQL representation of ImportForeignSchemaStmt
func (*ImportForeignSchemaStmt) StatementType ¶
func (i *ImportForeignSchemaStmt) StatementType() string
func (*ImportForeignSchemaStmt) String ¶
func (i *ImportForeignSchemaStmt) String() string
type ImportForeignSchemaType ¶
type ImportForeignSchemaType int
ImportForeignSchemaType represents import qualification types for IMPORT FOREIGN SCHEMA Ported from postgres/src/include/nodes/parsenodes.h:4094-4100
const ( FDW_IMPORT_SCHEMA_ALL ImportForeignSchemaType = iota // all relations wanted FDW_IMPORT_SCHEMA_LIMIT_TO // include only listed tables in import FDW_IMPORT_SCHEMA_EXCEPT // exclude listed tables from import )
func (ImportForeignSchemaType) String ¶
func (t ImportForeignSchemaType) String() string
String returns string representation of ImportForeignSchemaType
type Index ¶
type Index uint32
Index represents an array index - ported from postgres/src/include/c.h:614
func GetWindowFuncRef ¶
GetWindowFuncRef returns the window reference index from a WindowFunc.
type IndexElem ¶
type IndexElem struct {
BaseNode
Name string // name of attribute to index, or NULL - postgres/src/include/nodes/parsenodes.h:782
Expr Node // expression to index, or NULL - postgres/src/include/nodes/parsenodes.h:783
Indexcolname string // name for index column; NULL = default - postgres/src/include/nodes/parsenodes.h:784
Collation *NodeList // name of collation; NIL = default - postgres/src/include/nodes/parsenodes.h:785
Opclass *NodeList // name of desired opclass; NIL = default - postgres/src/include/nodes/parsenodes.h:786
Opclassopts *NodeList // opclass-specific options, or NIL - postgres/src/include/nodes/parsenodes.h:787
Ordering SortByDir // ASC/DESC/default - postgres/src/include/nodes/parsenodes.h:788
NullsOrdering SortByNulls // FIRST/LAST/default - postgres/src/include/nodes/parsenodes.h:789
}
IndexElem represents one index element (column or expression). Ported from postgres/src/include/nodes/parsenodes.h:780
func CloneRefOfIndexElem ¶
CloneRefOfIndexElem creates a deep clone of the input.
func NewBtreeIndexElem ¶
NewBtreeIndexElem creates a B-tree index element with default ordering.
func NewDescIndexElem ¶
NewDescIndexElem creates a descending index element.
func NewExpressionIndexElem ¶
NewExpressionIndexElem creates an index element on an expression.
func NewIndexElem ¶
NewIndexElem creates a new IndexElem node.
type IndexStmt ¶
type IndexStmt struct {
BaseNode
Idxname string // name of new index, or NULL for default - postgres/src/include/nodes/parsenodes.h:3350
Relation *RangeVar // relation to build index on - postgres/src/include/nodes/parsenodes.h:3351
AccessMethod string // name of access method (eg. btree) - postgres/src/include/nodes/parsenodes.h:3352
TableSpace string // tablespace, or NULL for default - postgres/src/include/nodes/parsenodes.h:3353
IndexParams *NodeList // columns to index: a list of IndexElem - postgres/src/include/nodes/parsenodes.h:3354
IndexIncludingParams *NodeList // additional columns to index - postgres/src/include/nodes/parsenodes.h:3355
Options *NodeList // WITH clause options: a list of DefElem - postgres/src/include/nodes/parsenodes.h:3357
WhereClause Node // qualification (partial-index predicate) - postgres/src/include/nodes/parsenodes.h:3358
ExcludeOpNames *NodeList // exclusion operator names, or NIL if none - postgres/src/include/nodes/parsenodes.h:3359
Idxcomment string // comment to apply to index, or NULL - postgres/src/include/nodes/parsenodes.h:3360
IndexOid Oid // OID of an existing index, if any - postgres/src/include/nodes/parsenodes.h:3361
OldNumber uint32 // relfilenumber of existing storage, if any - postgres/src/include/nodes/parsenodes.h:3362
OldCreateSubid uint32 // rd_createSubid of existing storage, if any - postgres/src/include/nodes/parsenodes.h:3363
OldFirstRelfilenodeSubid uint32 // rd_firstRelfilenodeSubid of existing storage - postgres/src/include/nodes/parsenodes.h:3364
Unique bool // is index unique? - postgres/src/include/nodes/parsenodes.h:3365
NullsNotDistinct bool // null treatment in unique index - postgres/src/include/nodes/parsenodes.h:3366
Primary bool // is index a primary key? - postgres/src/include/nodes/parsenodes.h:3367
Isconstraint bool // is it for a pkey/unique constraint? - postgres/src/include/nodes/parsenodes.h:3368
Deferrable bool // is the constraint DEFERRABLE? - postgres/src/include/nodes/parsenodes.h:3369
Initdeferred bool // is the constraint INITIALLY DEFERRED? - postgres/src/include/nodes/parsenodes.h:3370
Transformed bool // true when transformIndexStmt is finished - postgres/src/include/nodes/parsenodes.h:3371
Concurrent bool // should this be a concurrent index build? - postgres/src/include/nodes/parsenodes.h:3372
IfNotExists bool // just do nothing if index already exists? - postgres/src/include/nodes/parsenodes.h:3373
ResetDefaultTblspc bool // reset default_tablespace prior to creating the index - postgres/src/include/nodes/parsenodes.h:3374
}
IndexStmt represents a CREATE INDEX statement. Ported from postgres/src/include/nodes/parsenodes.h:3348
func CloneRefOfIndexStmt ¶
CloneRefOfIndexStmt creates a deep clone of the input.
func NewIndexStmt ¶
NewIndexStmt creates a new IndexStmt node.
func NewUniqueIndex ¶
NewUniqueIndex creates a unique index statement.
func (*IndexStmt) StatementType ¶
type InferClause ¶
type InferClause struct {
BaseNode
IndexElems *NodeList `json:"indexElems"` // IndexElems to infer unique index
WhereClause Node `json:"whereClause"` // Qualification (partial-index predicate)
Conname string `json:"conname"` // Constraint name, or NULL if unnamed
}
InferClause represents index inference clause for ON CONFLICT Ported from postgres/src/include/nodes/parsenodes.h:1606-1613
func CloneRefOfInferClause ¶
func CloneRefOfInferClause(n *InferClause) *InferClause
CloneRefOfInferClause creates a deep clone of the input.
func NewInferClause ¶
func NewInferClause() *InferClause
NewInferClause creates a new InferClause node
func (*InferClause) SqlString ¶
func (n *InferClause) SqlString() string
func (*InferClause) String ¶
func (n *InferClause) String() string
type InferenceElem ¶
type InferenceElem struct {
BaseExpr
Expr Node // Expression to infer from - primnodes.h:2014
Infercollid Oid // OID of collation, or InvalidOid - primnodes.h:2015
Inferopclass Oid // OID of operator class, or InvalidOid - primnodes.h:2016
}
InferenceElem represents an inference element for ON CONFLICT clauses. This is used to specify which unique index to use for conflict detection. Ported from postgres/src/include/nodes/primnodes.h:2123
func CloneRefOfInferenceElem ¶
func CloneRefOfInferenceElem(n *InferenceElem) *InferenceElem
CloneRefOfInferenceElem creates a deep clone of the input.
func NewInferenceElem ¶
func NewInferenceElem(expr Node) *InferenceElem
NewInferenceElem creates a new InferenceElem node.
func NewInferenceElemWithCollation ¶
func NewInferenceElemWithCollation(expr Node, infercollid, inferopclass Oid) *InferenceElem
NewInferenceElemWithCollation creates a new InferenceElem with collation.
func (*InferenceElem) ExpressionType ¶
func (ie *InferenceElem) ExpressionType() string
func (*InferenceElem) String ¶
func (ie *InferenceElem) String() string
type InsertStmt ¶
type InsertStmt struct {
BaseNode
Relation *RangeVar // Relation to insert into - postgres/src/include/nodes/parsenodes.h:2042
Cols *NodeList // Optional: names of the target columns - postgres/src/include/nodes/parsenodes.h:2043
SelectStmt Node // Source SELECT/VALUES, or NULL - postgres/src/include/nodes/parsenodes.h:2044
OnConflictClause *OnConflictClause // ON CONFLICT clause - postgres/src/include/nodes/parsenodes.h:2045
ReturningList *NodeList // List of expressions to return - postgres/src/include/nodes/parsenodes.h:2046
WithClause *WithClause // WITH clause - postgres/src/include/nodes/parsenodes.h:2047
Override OverridingKind // OVERRIDING clause - postgres/src/include/nodes/parsenodes.h:2048
}
InsertStmt represents an INSERT statement. Ported from postgres/src/include/nodes/parsenodes.h:2039
func CloneRefOfInsertStmt ¶
func CloneRefOfInsertStmt(n *InsertStmt) *InsertStmt
CloneRefOfInsertStmt creates a deep clone of the input.
func NewInsertStmt ¶
func NewInsertStmt(relation *RangeVar) *InsertStmt
NewInsertStmt creates a new InsertStmt node.
func (*InsertStmt) SqlString ¶
func (i *InsertStmt) SqlString() string
SqlString returns the SQL representation of the InsertStmt
func (*InsertStmt) StatementType ¶
func (i *InsertStmt) StatementType() string
func (*InsertStmt) String ¶
func (i *InsertStmt) String() string
type Integer ¶
Integer represents an integer literal value node. Ported from postgres/src/include/nodes/value.h:28-34
func CloneRefOfInteger ¶
CloneRefOfInteger creates a deep clone of the input.
func NewInteger ¶
NewInteger creates a new integer literal node. Ported from postgres/src/include/nodes/value.h:84 (makeInteger)
func (*Integer) ExpressionType ¶
type IntoClause ¶
type IntoClause struct {
BaseNode
Rel *RangeVar // Target relation name
ColNames *NodeList // Column names to assign, or NIL
AccessMethod string // Table access method
Options *NodeList // Options from WITH clause
OnCommit OnCommitAction // What do we do at COMMIT?
TableSpaceName string // Table space to use, or NULL
ViewQuery Node // Materialized view's SELECT query
SkipData bool // True for WITH NO DATA
}
IntoClause represents target information for SELECT INTO, CREATE TABLE AS, and CREATE MATERIALIZED VIEW Ported from postgres/src/include/nodes/primnodes.h:158-171
func CloneRefOfIntoClause ¶
func CloneRefOfIntoClause(n *IntoClause) *IntoClause
CloneRefOfIntoClause creates a deep clone of the input.
func NewIntoClause ¶
func NewIntoClause(rel *RangeVar, colNames *NodeList, accessMethod string, options *NodeList, onCommit OnCommitAction, tableSpaceName string, viewQuery Node, skipData bool, location int) *IntoClause
NewIntoClause creates a new IntoClause node.
func (*IntoClause) SqlString ¶
func (i *IntoClause) SqlString() string
func (*IntoClause) StatementType ¶
func (i *IntoClause) StatementType() string
func (*IntoClause) String ¶
func (i *IntoClause) String() string
func (*IntoClause) TargetString ¶
func (i *IntoClause) TargetString() string
SqlString returns the SQL representation of the IntoClause TargetString returns just the target relation and column list without "INTO"
type JoinExpr ¶
type JoinExpr struct {
BaseExpr
Jointype JoinType // Type of join - primnodes.h:2280
IsNatural bool // Natural join? Will need to shape the join - primnodes.h:2281
Larg Node // Left subtree - primnodes.h:2282
Rarg Node // Right subtree - primnodes.h:2283
UsingClause *NodeList // USING clause, if any (list of String nodes) - primnodes.h:2285
JoinUsingAlias *Alias // JOIN USING alias clause - primnodes.h:2287
Quals Expression // Qualifiers on join, if any - primnodes.h:2289
Alias *Alias // User-written alias clause, if any - primnodes.h:2291
Rtindex Index // RT index assigned for join, or 0 - primnodes.h:2293
}
JoinExpr represents a JOIN operation. This represents all types of JOIN operations (INNER, LEFT, RIGHT, FULL, etc.) and is core to SQL functionality. Ported from postgres/src/include/nodes/primnodes.h:2277
func CloneRefOfJoinExpr ¶
CloneRefOfJoinExpr creates a deep clone of the input.
func NewJoinExpr ¶
func NewJoinExpr(jointype JoinType, larg, rarg Node, quals Expression) *JoinExpr
NewJoinExpr creates a new JoinExpr node.
func NewNaturalJoinExpr ¶
NewNaturalJoinExpr creates a new natural JOIN expression.
func NewUsingJoinExpr ¶
NewUsingJoinExpr creates a new USING JOIN expression.
func (*JoinExpr) ExpressionType ¶
type JoinType ¶
type JoinType int
JoinType represents the type of join operation. Ported from postgres/src/include/nodes/nodes.h:287
const ( JOIN_INNER JoinType = iota // Inner join - nodes.h:293 JOIN_LEFT // Left outer join - nodes.h:294 JOIN_FULL // Full outer join - nodes.h:295 JOIN_RIGHT // Right outer join - nodes.h:296 JOIN_SEMI // Semi join - nodes.h:302 JOIN_ANTI // Anti join - nodes.h:303 JOIN_RIGHT_ANTI // Right anti join - nodes.h:304 JOIN_UNIQUE_OUTER // LHS path must be made unique - nodes.h:308 JOIN_UNIQUE_INNER // RHS path must be made unique - nodes.h:309 )
type JsonAggConstructor ¶
type JsonAggConstructor struct {
BaseNode
Output *JsonOutput // RETURNING clause, if any
AggFilter Node // FILTER clause, if any
AggOrder *NodeList // ORDER BY clause, if any
Over *WindowDef // OVER clause, if any
}
JsonAggConstructor represents common fields of JSON_ARRAYAGG() and JSON_OBJECTAGG() Ported from postgres/src/include/nodes/parsenodes.h:1962-1970
func CloneRefOfJsonAggConstructor ¶
func CloneRefOfJsonAggConstructor(n *JsonAggConstructor) *JsonAggConstructor
CloneRefOfJsonAggConstructor creates a deep clone of the input.
func NewJsonAggConstructor ¶
func NewJsonAggConstructor(output *JsonOutput) *JsonAggConstructor
NewJsonAggConstructor creates a new JsonAggConstructor node
func (*JsonAggConstructor) SqlString ¶
func (n *JsonAggConstructor) SqlString() string
SqlString returns the SQL representation of filter and over clauses
func (*JsonAggConstructor) String ¶
func (n *JsonAggConstructor) String() string
type JsonArgument ¶
type JsonArgument struct {
BaseNode
Val *JsonValueExpr // argument value expression
Name string // argument name
}
JsonArgument represents an argument from JSON PASSING clause Ported from postgres/src/include/nodes/parsenodes.h:1762-1767
func CloneRefOfJsonArgument ¶
func CloneRefOfJsonArgument(n *JsonArgument) *JsonArgument
CloneRefOfJsonArgument creates a deep clone of the input.
func NewJsonArgument ¶
func NewJsonArgument(val *JsonValueExpr, name string) *JsonArgument
NewJsonArgument creates a new JsonArgument node
func (*JsonArgument) SqlString ¶
func (n *JsonArgument) SqlString() string
SqlString returns the SQL representation of JsonArgument
func (*JsonArgument) String ¶
func (n *JsonArgument) String() string
type JsonArrayAgg ¶
type JsonArrayAgg struct {
BaseNode
Constructor *JsonAggConstructor // common fields
Arg *JsonValueExpr // array element expression
AbsentOnNull bool // skip NULL elements?
}
JsonArrayAgg represents untransformed JSON_ARRAYAGG() Ported from postgres/src/include/nodes/parsenodes.h:1989-1995
func CloneRefOfJsonArrayAgg ¶
func CloneRefOfJsonArrayAgg(n *JsonArrayAgg) *JsonArrayAgg
CloneRefOfJsonArrayAgg creates a deep clone of the input.
func NewJsonArrayAgg ¶
func NewJsonArrayAgg(constructor *JsonAggConstructor, arg *JsonValueExpr, absentOnNull bool) *JsonArrayAgg
NewJsonArrayAgg creates a new JsonArrayAgg node
func (*JsonArrayAgg) ExpressionType ¶
func (n *JsonArrayAgg) ExpressionType() string
func (*JsonArrayAgg) IsExpr ¶
func (n *JsonArrayAgg) IsExpr() bool
func (*JsonArrayAgg) SqlString ¶
func (n *JsonArrayAgg) SqlString() string
SqlString returns the SQL representation of JsonArrayAgg
func (*JsonArrayAgg) String ¶
func (n *JsonArrayAgg) String() string
type JsonArrayConstructor ¶
type JsonArrayConstructor struct {
BaseNode
Exprs *NodeList // list of JsonValueExpr elements
Output *JsonOutput // RETURNING clause, if specified
AbsentOnNull bool // skip NULL elements?
}
JsonArrayConstructor represents untransformed JSON_ARRAY(element,...) constructor Ported from postgres/src/include/nodes/parsenodes.h:1934-1941
func CloneRefOfJsonArrayConstructor ¶
func CloneRefOfJsonArrayConstructor(n *JsonArrayConstructor) *JsonArrayConstructor
CloneRefOfJsonArrayConstructor creates a deep clone of the input.
func NewJsonArrayConstructor ¶
func NewJsonArrayConstructor(exprs *NodeList, absentOnNull bool) *JsonArrayConstructor
NewJsonArrayConstructor creates a new JsonArrayConstructor node
func (*JsonArrayConstructor) ExpressionType ¶
func (n *JsonArrayConstructor) ExpressionType() string
func (*JsonArrayConstructor) IsExpr ¶
func (n *JsonArrayConstructor) IsExpr() bool
func (*JsonArrayConstructor) SqlString ¶
func (n *JsonArrayConstructor) SqlString() string
SqlString returns the SQL representation of JsonArrayConstructor
func (*JsonArrayConstructor) String ¶
func (n *JsonArrayConstructor) String() string
type JsonArrayQueryConstructor ¶
type JsonArrayQueryConstructor struct {
BaseNode
Query Node // subquery
Output *JsonOutput // RETURNING clause, if specified
Format *JsonFormat // FORMAT clause for subquery, if specified
AbsentOnNull bool // skip NULL elements?
}
JsonArrayQueryConstructor represents untransformed JSON_ARRAY(subquery) constructor Ported from postgres/src/include/nodes/parsenodes.h:1947-1955
func CloneRefOfJsonArrayQueryConstructor ¶
func CloneRefOfJsonArrayQueryConstructor(n *JsonArrayQueryConstructor) *JsonArrayQueryConstructor
CloneRefOfJsonArrayQueryConstructor creates a deep clone of the input.
func NewJsonArrayQueryConstructor ¶
func NewJsonArrayQueryConstructor(query Node, absentOnNull bool) *JsonArrayQueryConstructor
NewJsonArrayQueryConstructor creates a new JsonArrayQueryConstructor node
func (*JsonArrayQueryConstructor) ExpressionType ¶
func (n *JsonArrayQueryConstructor) ExpressionType() string
func (*JsonArrayQueryConstructor) IsExpr ¶
func (n *JsonArrayQueryConstructor) IsExpr() bool
func (*JsonArrayQueryConstructor) SqlString ¶
func (n *JsonArrayQueryConstructor) SqlString() string
SqlString returns the SQL representation of JsonArrayQueryConstructor
func (*JsonArrayQueryConstructor) String ¶
func (n *JsonArrayQueryConstructor) String() string
type JsonBehavior ¶
type JsonBehavior struct {
BaseNode
Btype JsonBehaviorType
Expr Node
Coerce bool
}
JsonBehavior represents specifications for ON ERROR / ON EMPTY behaviors Ported from postgres/src/include/nodes/primnodes.h:1786-1797
func CloneRefOfJsonBehavior ¶
func CloneRefOfJsonBehavior(n *JsonBehavior) *JsonBehavior
CloneRefOfJsonBehavior creates a deep clone of the input.
func NewJsonBehavior ¶
func NewJsonBehavior(btype JsonBehaviorType, expr Node, location int) *JsonBehavior
NewJsonBehavior creates a new JsonBehavior node
func (*JsonBehavior) SqlString ¶
func (n *JsonBehavior) SqlString() string
SqlString returns the SQL representation of JsonBehavior
func (*JsonBehavior) String ¶
func (n *JsonBehavior) String() string
type JsonBehaviorType ¶
type JsonBehaviorType int
JsonBehaviorType represents behavior types used in SQL/JSON ON ERROR/EMPTY clauses Ported from postgres/src/include/nodes/primnodes.h:1771-1783
const ( JSON_BEHAVIOR_NULL JsonBehaviorType = iota JSON_BEHAVIOR_ERROR JSON_BEHAVIOR_EMPTY JSON_BEHAVIOR_TRUE JSON_BEHAVIOR_FALSE JSON_BEHAVIOR_UNKNOWN JSON_BEHAVIOR_EMPTY_ARRAY JSON_BEHAVIOR_EMPTY_OBJECT JSON_BEHAVIOR_DEFAULT )
type JsonConstructorExpr ¶
type JsonConstructorExpr struct {
BaseExpr
Type JsonConstructorType // constructor type
Args *NodeList // arguments list
Func Expr // underlying json[b]_xxx() function call
Coercion Expr // coercion to RETURNING type
Returning *JsonReturning // RETURNING clause
AbsentOnNull bool // ABSENT ON NULL?
Unique bool // WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only)
}
JsonConstructorExpr represents a wrapper over FuncExpr/Aggref/WindowFunc for SQL/JSON constructors Ported from postgres/src/include/nodes/primnodes.h:1703-1714
func CloneRefOfJsonConstructorExpr ¶
func CloneRefOfJsonConstructorExpr(n *JsonConstructorExpr) *JsonConstructorExpr
CloneRefOfJsonConstructorExpr creates a deep clone of the input.
func NewJsonConstructorExpr ¶
func NewJsonConstructorExpr(constructorType JsonConstructorType, args *NodeList, function, coercion Expr, returning *JsonReturning, absentOnNull, unique bool, location int) *JsonConstructorExpr
NewJsonConstructorExpr creates a new JsonConstructorExpr node
func (*JsonConstructorExpr) ExpressionType ¶
func (j *JsonConstructorExpr) ExpressionType() string
func (*JsonConstructorExpr) String ¶
func (j *JsonConstructorExpr) String() string
type JsonConstructorType ¶
type JsonConstructorType int
JsonConstructorType represents JSON constructor types Ported from postgres/src/include/nodes/primnodes.h:1688-1697
const ( JSCTOR_JSON_OBJECT JsonConstructorType = iota + 1 // JSON_OBJECT constructor JSCTOR_JSON_ARRAY // JSON_ARRAY constructor JSCTOR_JSON_OBJECTAGG // JSON_OBJECTAGG constructor JSCTOR_JSON_ARRAYAGG // JSON_ARRAYAGG constructor JSCTOR_JSON_PARSE // JSON_PARSE constructor JSCTOR_JSON_SCALAR // JSON_SCALAR constructor JSCTOR_JSON_SERIALIZE // JSON_SERIALIZE constructor )
type JsonEncoding ¶
type JsonEncoding int
JsonEncoding represents the JSON ENCODING clause Ported from postgres/src/include/nodes/primnodes.h:1636-1643
const ( JS_ENC_DEFAULT JsonEncoding = iota // unspecified JS_ENC_UTF8 JS_ENC_UTF16 JS_ENC_UTF32 )
type JsonExpr ¶
type JsonExpr struct {
BaseExpr
Op JsonExprOp // JSON expression operation type
ColumnName string // JSON_TABLE() column name or empty if not for JSON_TABLE()
FormattedExpr Node // jsonb-valued expression to query
Format *JsonFormat // Format of the above expression needed by ruleutils.c
PathSpec Node // jsonpath-valued expression containing the query pattern
Returning *JsonReturning // Expected type/format of the output
PassingNames []string // PASSING argument names
PassingValues *NodeList // PASSING argument values
OnEmpty *JsonBehavior // User-specified or default ON EMPTY behavior
OnError *JsonBehavior // User-specified or default ON ERROR behavior
UseIOCoercion bool // Information about converting the result to RETURNING type
UseJsonCoercion bool // Additional conversion information
Wrapper JsonWrapper // WRAPPER specification for JSON_QUERY
OmitQuotes bool // KEEP or OMIT QUOTES for singleton scalars returned by JSON_QUERY()
Collation Oid // JsonExpr's collation
}
JsonExpr represents transformed representation of JSON_VALUE(), JSON_QUERY(), and JSON_EXISTS() Ported from postgres/src/include/nodes/primnodes.h:1813-1860
func CloneRefOfJsonExpr ¶
CloneRefOfJsonExpr creates a deep clone of the input.
func NewJsonExpr ¶
func NewJsonExpr(op JsonExprOp, columnName string, formattedExpr Node, format *JsonFormat, pathSpec Node, returning *JsonReturning, passingNames []string, passingValues *NodeList, onEmpty, onError *JsonBehavior, useIOCoercion, useJsonCoercion bool, wrapper JsonWrapper, omitQuotes bool, collation Oid, location int) *JsonExpr
NewJsonExpr creates a new JsonExpr node
func (*JsonExpr) ExpressionType ¶
type JsonExprOp ¶
type JsonExprOp int
JsonExprOp represents enumeration of SQL/JSON query function types Ported from postgres/src/include/nodes/primnodes.h:1802-1808
const ( JSON_EXISTS_OP JsonExprOp = iota // JSON_EXISTS() JSON_QUERY_OP // JSON_QUERY() JSON_VALUE_OP // JSON_VALUE() JSON_TABLE_OP // JSON_TABLE() )
type JsonFormat ¶
type JsonFormat struct {
BaseNode
FormatType JsonFormatType // format type
Encoding JsonEncoding // JSON encoding
}
JsonFormat represents a JSON FORMAT clause Ported from postgres/src/include/nodes/primnodes.h:1648-1655
func CloneRefOfJsonFormat ¶
func CloneRefOfJsonFormat(n *JsonFormat) *JsonFormat
CloneRefOfJsonFormat creates a deep clone of the input.
func NewJsonFormat ¶
func NewJsonFormat(formatType JsonFormatType, encoding JsonEncoding, location int) *JsonFormat
NewJsonFormat creates a new JsonFormat node
func (*JsonFormat) SqlString ¶
func (n *JsonFormat) SqlString() string
SqlString returns the SQL representation of JsonFormat
func (*JsonFormat) String ¶
func (n *JsonFormat) String() string
type JsonFormatType ¶
type JsonFormatType int
JsonFormatType represents the JSON format types Ported from postgres/src/include/nodes/primnodes.h:1644-1651
const ( JS_FORMAT_DEFAULT JsonFormatType = iota // unspecified JS_FORMAT_JSON // FORMAT JSON [ENCODING ...] JS_FORMAT_JSONB // implicit internal format for RETURNING jsonb )
type JsonFuncExpr ¶
type JsonFuncExpr struct {
BaseNode
Op JsonExprOp // expression type
ColumnName string // JSON_TABLE() column name or NULL
ContextItem *JsonValueExpr // context item expression
Pathspec Node // JSON path specification expression
Passing *NodeList // list of PASSING clause arguments, if any
Output *JsonOutput // output clause, if specified
OnEmpty *JsonBehavior // ON EMPTY behavior
OnError *JsonBehavior // ON ERROR behavior
Wrapper JsonWrapper // array wrapper behavior (JSON_QUERY only)
Quotes JsonQuotes // omit or keep quotes? (JSON_QUERY only)
}
JsonFuncExpr represents untransformed function expressions for SQL/JSON query functions Ported from postgres/src/include/nodes/parsenodes.h:1785-1800
func CloneRefOfJsonFuncExpr ¶
func CloneRefOfJsonFuncExpr(n *JsonFuncExpr) *JsonFuncExpr
CloneRefOfJsonFuncExpr creates a deep clone of the input.
func NewJsonFuncExpr ¶
func NewJsonFuncExpr(op JsonExprOp, contextItem *JsonValueExpr, pathspec Node) *JsonFuncExpr
NewJsonFuncExpr creates a new JsonFuncExpr node
func (*JsonFuncExpr) ExpressionType ¶
func (n *JsonFuncExpr) ExpressionType() string
func (*JsonFuncExpr) IsExpr ¶
func (n *JsonFuncExpr) IsExpr() bool
func (*JsonFuncExpr) SqlString ¶
func (n *JsonFuncExpr) SqlString() string
SqlString returns the SQL representation of JsonFuncExpr
func (*JsonFuncExpr) String ¶
func (n *JsonFuncExpr) String() string
type JsonIsPredicate ¶
type JsonIsPredicate struct {
BaseNode
Expr Node // subject expression
Format *JsonFormat // FORMAT clause, if specified
ItemType JsonValueType // JSON item type
UniqueKeys bool // check key uniqueness?
}
JsonIsPredicate represents an IS JSON predicate Ported from postgres/src/include/nodes/primnodes.h:1732-1740
func CloneRefOfJsonIsPredicate ¶
func CloneRefOfJsonIsPredicate(n *JsonIsPredicate) *JsonIsPredicate
CloneRefOfJsonIsPredicate creates a deep clone of the input.
func NewJsonIsPredicate ¶
func NewJsonIsPredicate(expr Node, format *JsonFormat, itemType JsonValueType, uniqueKeys bool, location int) *JsonIsPredicate
NewJsonIsPredicate creates a new JsonIsPredicate node
func (*JsonIsPredicate) SqlString ¶
func (j *JsonIsPredicate) SqlString() string
SqlString returns the SQL representation of JsonIsPredicate
func (*JsonIsPredicate) String ¶
func (j *JsonIsPredicate) String() string
type JsonKeyValue ¶
type JsonKeyValue struct {
BaseNode
Key Expr // key expression
Value *JsonValueExpr // JSON value expression
}
JsonKeyValue represents untransformed JSON object key-value pair Ported from postgres/src/include/nodes/parsenodes.h:1872-1877
func CloneRefOfJsonKeyValue ¶
func CloneRefOfJsonKeyValue(n *JsonKeyValue) *JsonKeyValue
CloneRefOfJsonKeyValue creates a deep clone of the input.
func NewJsonKeyValue ¶
func NewJsonKeyValue(key Expr, value *JsonValueExpr) *JsonKeyValue
NewJsonKeyValue creates a new JsonKeyValue node
func (*JsonKeyValue) SqlString ¶
func (n *JsonKeyValue) SqlString() string
SqlString returns the SQL representation of JsonKeyValue
func (*JsonKeyValue) String ¶
func (n *JsonKeyValue) String() string
type JsonObjectAgg ¶
type JsonObjectAgg struct {
BaseNode
Constructor *JsonAggConstructor // common fields
Arg *JsonKeyValue // object key-value pair
AbsentOnNull bool // skip NULL values?
Unique bool // check key uniqueness?
}
JsonObjectAgg represents untransformed JSON_OBJECTAGG() Ported from postgres/src/include/nodes/parsenodes.h:1976-1983
func CloneRefOfJsonObjectAgg ¶
func CloneRefOfJsonObjectAgg(n *JsonObjectAgg) *JsonObjectAgg
CloneRefOfJsonObjectAgg creates a deep clone of the input.
func NewJsonObjectAgg ¶
func NewJsonObjectAgg(constructor *JsonAggConstructor, arg *JsonKeyValue, absentOnNull bool, unique bool) *JsonObjectAgg
NewJsonObjectAgg creates a new JsonObjectAgg node
func (*JsonObjectAgg) ExpressionType ¶
func (n *JsonObjectAgg) ExpressionType() string
func (*JsonObjectAgg) IsExpr ¶
func (n *JsonObjectAgg) IsExpr() bool
func (*JsonObjectAgg) SqlString ¶
func (n *JsonObjectAgg) SqlString() string
SqlString returns the SQL representation of JsonObjectAgg
func (*JsonObjectAgg) String ¶
func (n *JsonObjectAgg) String() string
type JsonObjectConstructor ¶
type JsonObjectConstructor struct {
BaseNode
Exprs *NodeList // list of JsonKeyValue pairs
Output *JsonOutput // RETURNING clause, if specified
AbsentOnNull bool // skip NULL values?
Unique bool // check key uniqueness?
}
JsonObjectConstructor represents untransformed JSON_OBJECT() constructor Ported from postgres/src/include/nodes/parsenodes.h:1920-1928
func CloneRefOfJsonObjectConstructor ¶
func CloneRefOfJsonObjectConstructor(n *JsonObjectConstructor) *JsonObjectConstructor
CloneRefOfJsonObjectConstructor creates a deep clone of the input.
func NewJsonObjectConstructor ¶
func NewJsonObjectConstructor(exprs *NodeList, absentOnNull bool, unique bool) *JsonObjectConstructor
NewJsonObjectConstructor creates a new JsonObjectConstructor node
func (*JsonObjectConstructor) ExpressionType ¶
func (n *JsonObjectConstructor) ExpressionType() string
func (*JsonObjectConstructor) IsExpr ¶
func (n *JsonObjectConstructor) IsExpr() bool
func (*JsonObjectConstructor) SqlString ¶
func (n *JsonObjectConstructor) SqlString() string
SqlString returns the SQL representation of JsonObjectConstructor
func (*JsonObjectConstructor) String ¶
func (n *JsonObjectConstructor) String() string
type JsonOutput ¶
type JsonOutput struct {
BaseNode
TypeName *TypeName // RETURNING type name, if specified
Returning *JsonReturning // RETURNING FORMAT clause and type Oids
}
JsonOutput represents a JSON output specification Ported from postgres/src/include/nodes/parsenodes.h:1751-1756
func CloneRefOfJsonOutput ¶
func CloneRefOfJsonOutput(n *JsonOutput) *JsonOutput
CloneRefOfJsonOutput creates a deep clone of the input.
func NewJsonOutput ¶
func NewJsonOutput(typeName *TypeName, returning *JsonReturning) *JsonOutput
NewJsonOutput creates a new JsonOutput node
func (*JsonOutput) String ¶
func (n *JsonOutput) String() string
type JsonParseExpr ¶
type JsonParseExpr struct {
BaseNode
Expr *JsonValueExpr // string expression
Output *JsonOutput // RETURNING clause, if specified
UniqueKeys bool // WITH UNIQUE KEYS?
}
JsonParseExpr represents untransformed JSON() Ported from postgres/src/include/nodes/parsenodes.h:1883-1890
func CloneRefOfJsonParseExpr ¶
func CloneRefOfJsonParseExpr(n *JsonParseExpr) *JsonParseExpr
CloneRefOfJsonParseExpr creates a deep clone of the input.
func NewJsonParseExpr ¶
func NewJsonParseExpr(expr *JsonValueExpr, uniqueKeys bool) *JsonParseExpr
NewJsonParseExpr creates a new JsonParseExpr node
func (*JsonParseExpr) ExpressionType ¶
func (n *JsonParseExpr) ExpressionType() string
func (*JsonParseExpr) IsExpr ¶
func (n *JsonParseExpr) IsExpr() bool
func (*JsonParseExpr) SqlString ¶
func (n *JsonParseExpr) SqlString() string
SqlString returns the SQL representation of JsonParseExpr
func (*JsonParseExpr) String ¶
func (n *JsonParseExpr) String() string
type JsonQuotes ¶
type JsonQuotes int
JsonQuotes represents [KEEP|OMIT] QUOTES clause for JSON_QUERY() Ported from postgres/src/include/nodes/parsenodes.h:1773-1778
const ( JS_QUOTES_UNSPEC JsonQuotes = iota // unspecified JS_QUOTES_KEEP // KEEP QUOTES JS_QUOTES_OMIT // OMIT QUOTES )
type JsonReturning ¶
type JsonReturning struct {
BaseNode
Format *JsonFormat // output JSON format
Typid Oid // target type Oid
Typmod int32 // target type modifier
}
JsonReturning represents a transformed JSON RETURNING clause Ported from postgres/src/include/nodes/primnodes.h:1660-1668
func CloneRefOfJsonReturning ¶
func CloneRefOfJsonReturning(n *JsonReturning) *JsonReturning
CloneRefOfJsonReturning creates a deep clone of the input.
func NewJsonReturning ¶
func NewJsonReturning(format *JsonFormat, typid Oid, typmod int32) *JsonReturning
NewJsonReturning creates a new JsonReturning node
func (*JsonReturning) SqlString ¶
func (n *JsonReturning) SqlString() string
SqlString returns the SQL representation of JsonReturning
type JsonScalarExpr ¶
type JsonScalarExpr struct {
BaseNode
Expr Expr // scalar expression
Output *JsonOutput // RETURNING clause, if specified
}
JsonScalarExpr represents untransformed JSON_SCALAR() Ported from postgres/src/include/nodes/parsenodes.h:1896-1902
func CloneRefOfJsonScalarExpr ¶
func CloneRefOfJsonScalarExpr(n *JsonScalarExpr) *JsonScalarExpr
CloneRefOfJsonScalarExpr creates a deep clone of the input.
func NewJsonScalarExpr ¶
func NewJsonScalarExpr(expr Expr) *JsonScalarExpr
NewJsonScalarExpr creates a new JsonScalarExpr node
func (*JsonScalarExpr) ExpressionType ¶
func (n *JsonScalarExpr) ExpressionType() string
func (*JsonScalarExpr) IsExpr ¶
func (n *JsonScalarExpr) IsExpr() bool
func (*JsonScalarExpr) SqlString ¶
func (n *JsonScalarExpr) SqlString() string
SqlString returns the SQL representation of JsonScalarExpr
func (*JsonScalarExpr) String ¶
func (n *JsonScalarExpr) String() string
type JsonSerializeExpr ¶
type JsonSerializeExpr struct {
BaseNode
Expr *JsonValueExpr // json value expression
Output *JsonOutput // RETURNING clause, if specified
}
JsonSerializeExpr represents untransformed JSON_SERIALIZE() function Ported from postgres/src/include/nodes/parsenodes.h:1908-1914
func CloneRefOfJsonSerializeExpr ¶
func CloneRefOfJsonSerializeExpr(n *JsonSerializeExpr) *JsonSerializeExpr
CloneRefOfJsonSerializeExpr creates a deep clone of the input.
func NewJsonSerializeExpr ¶
func NewJsonSerializeExpr(expr *JsonValueExpr) *JsonSerializeExpr
NewJsonSerializeExpr creates a new JsonSerializeExpr node
func (*JsonSerializeExpr) ExpressionType ¶
func (n *JsonSerializeExpr) ExpressionType() string
func (*JsonSerializeExpr) IsExpr ¶
func (n *JsonSerializeExpr) IsExpr() bool
func (*JsonSerializeExpr) SqlString ¶
func (n *JsonSerializeExpr) SqlString() string
SqlString returns the SQL representation of JsonSerializeExpr
func (*JsonSerializeExpr) String ¶
func (n *JsonSerializeExpr) String() string
type JsonTable ¶
type JsonTable struct {
BaseNode
ContextItem *JsonValueExpr // context item expression
Pathspec *JsonTablePathSpec // JSON path specification
Passing *NodeList // list of PASSING clause arguments, if any
Columns *NodeList // list of JsonTableColumn
OnError *JsonBehavior // ON ERROR behavior
Alias *Alias // table alias in FROM clause
Lateral bool // does it have LATERAL prefix?
}
JsonTable represents untransformed JSON_TABLE Ported from postgres/src/include/nodes/parsenodes.h:1821-1832
func CloneRefOfJsonTable ¶
CloneRefOfJsonTable creates a deep clone of the input.
func NewJsonTable ¶
func NewJsonTable(contextItem *JsonValueExpr, pathspec *JsonTablePathSpec) *JsonTable
NewJsonTable creates a new JsonTable node
type JsonTableColumn ¶
type JsonTableColumn struct {
BaseNode
Coltype JsonTableColumnType // column type
Name string // column name
TypeName *TypeName // column type name
Pathspec *JsonTablePathSpec // JSON path specification
Format *JsonFormat // JSON format clause, if specified
Wrapper JsonWrapper // WRAPPER behavior for formatted columns
Quotes JsonQuotes // omit or keep quotes on scalar strings?
Columns *NodeList // nested columns
OnEmpty *JsonBehavior // ON EMPTY behavior
OnError *JsonBehavior // ON ERROR behavior
}
JsonTableColumn represents untransformed JSON_TABLE column Ported from postgres/src/include/nodes/parsenodes.h:1851-1865
func CloneRefOfJsonTableColumn ¶
func CloneRefOfJsonTableColumn(n *JsonTableColumn) *JsonTableColumn
CloneRefOfJsonTableColumn creates a deep clone of the input.
func NewJsonTableColumn ¶
func NewJsonTableColumn(coltype JsonTableColumnType, name string) *JsonTableColumn
NewJsonTableColumn creates a new JsonTableColumn node
func (*JsonTableColumn) SqlString ¶
func (n *JsonTableColumn) SqlString() string
SqlString returns the SQL representation of the JsonTableColumn.
func (*JsonTableColumn) String ¶
func (n *JsonTableColumn) String() string
type JsonTableColumnType ¶
type JsonTableColumnType int
JsonTableColumnType represents enumeration of JSON_TABLE column types Ported from postgres/src/include/nodes/parsenodes.h:1838-1845
const ( JTC_FOR_ORDINALITY JsonTableColumnType = iota JTC_REGULAR JTC_EXISTS JTC_FORMATTED JTC_NESTED )
type JsonTablePath ¶
JsonTablePath represents a JSON path expression to be computed as part of evaluating a JSON_TABLE plan node Ported from postgres/src/include/nodes/primnodes.h:1867-1873
func CloneRefOfJsonTablePath ¶
func CloneRefOfJsonTablePath(n *JsonTablePath) *JsonTablePath
CloneRefOfJsonTablePath creates a deep clone of the input.
func NewJsonTablePath ¶
func NewJsonTablePath(value *Const, name string, location int) *JsonTablePath
NewJsonTablePath creates a new JsonTablePath node
func (*JsonTablePath) String ¶
func (j *JsonTablePath) String() string
type JsonTablePathScan ¶
type JsonTablePathScan struct {
BaseNode
Path *JsonTablePath // JSON path to evaluate
ErrorOnError bool // ERROR/EMPTY ON ERROR behavior; only significant in the plan for the top-level path
Child *JsonTablePlan // Plan(s) for nested columns, if any
ColMin int // 0-based index in TableFunc.colvalexprs of the 1st column covered by this plan
ColMax int // 0-based index in TableFunc.colvalexprs of the last column covered by this plan
}
JsonTablePathScan represents a JSON_TABLE plan to evaluate a JSON path expression and NESTED paths Ported from postgres/src/include/nodes/primnodes.h:1893-1916
func CloneRefOfJsonTablePathScan ¶
func CloneRefOfJsonTablePathScan(n *JsonTablePathScan) *JsonTablePathScan
CloneRefOfJsonTablePathScan creates a deep clone of the input.
func NewJsonTablePathScan ¶
func NewJsonTablePathScan(path *JsonTablePath, errorOnError bool, child *JsonTablePlan, colMin, colMax, location int) *JsonTablePathScan
NewJsonTablePathScan creates a new JsonTablePathScan node
func (*JsonTablePathScan) String ¶
func (j *JsonTablePathScan) String() string
type JsonTablePathSpec ¶
type JsonTablePathSpec struct {
BaseNode
StringExpr Node // JSON path string expression
Name string // optional path name
NameLocation int // location of 'name'
}
JsonTablePathSpec represents untransformed specification of JSON path expression with an optional name Ported from postgres/src/include/nodes/parsenodes.h:1807-1815
func CloneRefOfJsonTablePathSpec ¶
func CloneRefOfJsonTablePathSpec(n *JsonTablePathSpec) *JsonTablePathSpec
CloneRefOfJsonTablePathSpec creates a deep clone of the input.
func NewJsonTablePathSpec ¶
func NewJsonTablePathSpec(str Node, name string, location int) *JsonTablePathSpec
NewJsonTablePathSpec creates a new JsonTablePathSpec node
func (*JsonTablePathSpec) SqlString ¶
func (n *JsonTablePathSpec) SqlString() string
SqlString returns the SQL representation of the JsonTablePathSpec. The optional `AS <name>` suffix is required for PG to detect duplicate column/path-name conflicts inside JSON_TABLE.
func (*JsonTablePathSpec) String ¶
func (n *JsonTablePathSpec) String() string
type JsonTablePlan ¶
type JsonTablePlan struct {
BaseNode
}
JsonTablePlan represents abstract base type for different types of JSON_TABLE "plans" Ported from postgres/src/include/nodes/primnodes.h:1882-1887
func CloneRefOfJsonTablePlan ¶
func CloneRefOfJsonTablePlan(n *JsonTablePlan) *JsonTablePlan
CloneRefOfJsonTablePlan creates a deep clone of the input.
func NewJsonTablePlan ¶
func NewJsonTablePlan(location int) *JsonTablePlan
NewJsonTablePlan creates a new JsonTablePlan node
func (*JsonTablePlan) String ¶
func (j *JsonTablePlan) String() string
type JsonTableSiblingJoin ¶
type JsonTableSiblingJoin struct {
BaseNode
Lplan *JsonTablePlan // left plan
Rplan *JsonTablePlan // right plan
}
JsonTableSiblingJoin represents a plan to join rows of sibling NESTED COLUMNS clauses in the same parent COLUMNS clause Ported from postgres/src/include/nodes/primnodes.h:1923-1929
func CloneRefOfJsonTableSiblingJoin ¶
func CloneRefOfJsonTableSiblingJoin(n *JsonTableSiblingJoin) *JsonTableSiblingJoin
CloneRefOfJsonTableSiblingJoin creates a deep clone of the input.
func NewJsonTableSiblingJoin ¶
func NewJsonTableSiblingJoin(lplan, rplan *JsonTablePlan, location int) *JsonTableSiblingJoin
NewJsonTableSiblingJoin creates a new JsonTableSiblingJoin node
func (*JsonTableSiblingJoin) String ¶
func (j *JsonTableSiblingJoin) String() string
type JsonValueExpr ¶
type JsonValueExpr struct {
BaseNode
RawExpr Node // user-specified expression
FormattedExpr Expr // coerced formatted expression
Format *JsonFormat // FORMAT clause, if specified
}
JsonValueExpr represents a JSON value expression (expr [FORMAT JsonFormat]) Ported from postgres/src/include/nodes/primnodes.h:1680-1691
func CloneRefOfJsonValueExpr ¶
func CloneRefOfJsonValueExpr(n *JsonValueExpr) *JsonValueExpr
CloneRefOfJsonValueExpr creates a deep clone of the input.
func NewJsonValueExpr ¶
func NewJsonValueExpr(rawExpr Node, format *JsonFormat) *JsonValueExpr
NewJsonValueExpr creates a new JsonValueExpr node
func (*JsonValueExpr) ExpressionType ¶
func (n *JsonValueExpr) ExpressionType() string
func (*JsonValueExpr) IsExpr ¶
func (n *JsonValueExpr) IsExpr() bool
func (*JsonValueExpr) SqlString ¶
func (n *JsonValueExpr) SqlString() string
SqlString returns the SQL representation of the JsonValueExpr.
func (*JsonValueExpr) String ¶
func (n *JsonValueExpr) String() string
type JsonValueType ¶
type JsonValueType int
JsonValueType represents JSON item types in IS JSON predicate Ported from postgres/src/include/nodes/primnodes.h:1723-1730
const ( JS_TYPE_ANY JsonValueType = iota // IS JSON [VALUE] JS_TYPE_OBJECT // IS JSON OBJECT JS_TYPE_ARRAY // IS JSON ARRAY JS_TYPE_SCALAR // IS JSON SCALAR )
type JsonWrapper ¶
type JsonWrapper int
JsonWrapper represents WRAPPER clause for JSON_QUERY() Ported from postgres/src/include/nodes/primnodes.h:1761-1768
const ( JSW_UNSPEC JsonWrapper = iota JSW_NONE JSW_CONDITIONAL JSW_UNCONDITIONAL )
type KeyAction ¶
type KeyAction struct {
BaseNode
Action byte // FKCONSTR_ACTION_* constant
Cols *NodeList // optional column list for SET NULL/SET DEFAULT
}
KeyAction represents a foreign key action with optional column list Ported from postgres/src/backend/parser/gram.y:142-146
func CloneRefOfKeyAction ¶
CloneRefOfKeyAction creates a deep clone of the input.
type KeyActions ¶
KeyActions represents both update and delete actions for foreign keys Ported from postgres/src/backend/parser/gram.y:148-152
func CloneRefOfKeyActions ¶
func CloneRefOfKeyActions(n *KeyActions) *KeyActions
CloneRefOfKeyActions creates a deep clone of the input.
type KeywordCategory ¶
type KeywordCategory int
KeywordCategory is PostgreSQL's grammar keyword-category classification. Every keyword belongs to exactly one category (postgres/src/backend/parser/gram.y).
const ( // UnreservedKeyword — available for use as any kind of name: column, table, // type, or function. (gram.y: "available for use as any kind of name".) UnreservedKeyword KeywordCategory = iota // ColNameKeyword — usable as a column or table name. Many are ALSO recognized // as type or function names, but only through dedicated grammar productions, so // they are NOT usable as a *generic* type or function name (gram.y: "they have // special productions for the purpose, and so can't be treated as 'generic' // type or function names"). This is precisely why one must be double-quoted to // be emitted as an ordinary function name — bare, the grammar grabs it for its // special production instead (e.g. NORMALIZE(...)). ColNameKeyword // TypeFuncNameKeyword — usable as a type or function name, but NOT as a column // name: these are typically operator-like keywords that would be ambiguous with // variables in column position (gram.y: "can't be column names because they // would be ambiguous with variables, but ... unambiguous as function // identifiers"). TypeFuncNameKeyword // ReservedKeyword — usable only as a column label (and only with AS, unless // also bare-label-able). Not usable as a column, table, type, or function name // (gram.y: "usable only as a ColLabel"). ReservedKeyword )
func LookupKeywordCategory ¶
func LookupKeywordCategory(name string) (KeywordCategory, bool)
LookupKeywordCategory returns the category of name (which must be lower case) and whether it is a keyword.
func (KeywordCategory) String ¶
func (kc KeywordCategory) String() string
String returns the PostgreSQL name of the category.
type KeywordClass ¶
type KeywordClass struct {
Name string // keyword name (lower case)
Category KeywordCategory // grammar category
CanBareLabel bool // usable as a bare column label (without AS)
}
KeywordClass is the category classification of one keyword. It deliberately omits the parser token constant, which lives in the parser package.
func LookupKeywordClass ¶
func LookupKeywordClass(name string) (KeywordClass, bool)
LookupKeywordClass returns the classification of name (which must be lower case) and whether it is a keyword.
type LimitOption ¶
type LimitOption int
LimitOption represents LIMIT clause options. Ported from postgres/src/include/nodes/nodes.h:428
const ( LIMIT_OPTION_COUNT LimitOption = iota // FETCH FIRST... ONLY - nodes.h:430 LIMIT_OPTION_WITH_TIES // FETCH FIRST... WITH TIES - nodes.h:431 )
type ListenStmt ¶
type ListenStmt struct {
BaseNode
Conditionname string // Condition name to listen for - postgres/src/include/nodes/parsenodes.h:3636
}
ListenStmt represents a LISTEN statement. Ported from postgres/src/include/nodes/parsenodes.h:3633-3637
func CloneRefOfListenStmt ¶
func CloneRefOfListenStmt(n *ListenStmt) *ListenStmt
CloneRefOfListenStmt creates a deep clone of the input.
func NewListenStmt ¶
func NewListenStmt(conditionname string) *ListenStmt
NewListenStmt creates a new LISTEN statement.
func (*ListenStmt) SqlString ¶
func (ls *ListenStmt) SqlString() string
SqlString returns the SQL representation of the LISTEN statement
func (*ListenStmt) StatementType ¶
func (ls *ListenStmt) StatementType() string
func (*ListenStmt) String ¶
func (ls *ListenStmt) String() string
type LoadStmt ¶
type LoadStmt struct {
BaseNode
Filename string // File to load - postgres/src/include/nodes/parsenodes.h:3758
}
LoadStmt represents a LOAD statement. Ported from postgres/src/include/nodes/parsenodes.h:3755-3759
func CloneRefOfLoadStmt ¶
CloneRefOfLoadStmt creates a deep clone of the input.
func NewLoadStmt ¶
NewLoadStmt creates a new LOAD statement.
func (*LoadStmt) StatementType ¶
type LockClauseStrength ¶
type LockClauseStrength int
LockClauseStrength represents lock strength. Ported from postgres/src/include/nodes/parsenodes.h:61-67
const ( LCS_NONE LockClauseStrength = iota LCS_FORKEYSHARE LCS_FORSHARE LCS_FORNOKEYUPDATE LCS_FORUPDATE )
type LockMode ¶
type LockMode int
Lock mode constants based on PostgreSQL's LOCKMODE From postgres/src/include/storage/lockdefs.h
type LockStmt ¶
type LockStmt struct {
BaseNode
Relations *NodeList `json:"relations"` // Relations to lock
Mode LockMode `json:"mode"` // Lock mode
Nowait bool `json:"nowait"` // No wait mode
}
LockStmt represents LOCK TABLE statements Ported from postgres/src/include/nodes/parsenodes.h:3942-3948
func CloneRefOfLockStmt ¶
CloneRefOfLockStmt creates a deep clone of the input.
func NewLockStmt ¶
NewLockStmt creates a new LockStmt node
func (*LockStmt) StatementType ¶
StatementType implements the Stmt interface
type LockWaitPolicy ¶
type LockWaitPolicy int
LockWaitPolicy represents lock wait policies. Ported from postgres/src/include/nodes/lockoptions.h:36
const ( LockWaitBlock LockWaitPolicy = iota // Block on locks - lockoptions.h:39 LockWaitSkip // SKIP LOCKED - lockoptions.h:41 LockWaitError // NOWAIT - lockoptions.h:43 )
type LockingClause ¶
type LockingClause struct {
BaseNode
LockedRels *NodeList // For table locking, list of RangeVar nodes
Strength LockClauseStrength // Lock strength
WaitPolicy LockWaitPolicy // NOWAIT and SKIP LOCKED
}
LockingClause represents a complete locking clause (FOR UPDATE, FOR SHARE, etc.). Ported from postgres/src/include/nodes/parsenodes.h:831-841
func CloneRefOfLockingClause ¶
func CloneRefOfLockingClause(n *LockingClause) *LockingClause
CloneRefOfLockingClause creates a deep clone of the input.
func NewLockingClause ¶
func NewLockingClause(lockedRels *NodeList, strength LockClauseStrength, waitPolicy LockWaitPolicy, location int) *LockingClause
NewLockingClause creates a new LockingClause node.
func (*LockingClause) SqlString ¶
func (l *LockingClause) SqlString() string
SqlString returns the SQL representation of the LockingClause
func (*LockingClause) StatementType ¶
func (l *LockingClause) StatementType() string
func (*LockingClause) String ¶
func (l *LockingClause) String() string
type MergeAction ¶
type MergeAction struct {
BaseNode
MatchKind MergeMatchKind // MATCHED/NOT MATCHED BY SOURCE/TARGET
CommandType CmdType // INSERT/UPDATE/DELETE/DO NOTHING
Override OverridingKind // OVERRIDING clause
Qual Node // Transformed WHEN conditions
TargetList []*TargetEntry // The target list (of TargetEntry)
UpdateColnos []AttrNumber // Target attribute numbers of an UPDATE
}
MergeAction represents a MERGE action Ported from postgres/src/include/nodes/primnodes.h:2003-2013
func CloneRefOfMergeAction ¶
func CloneRefOfMergeAction(n *MergeAction) *MergeAction
CloneRefOfMergeAction creates a deep clone of the input.
func NewMergeAction ¶
func NewMergeAction(matchKind MergeMatchKind, commandType CmdType, override OverridingKind, qual Node, targetList []*TargetEntry, updateColnos []AttrNumber, location int) *MergeAction
NewMergeAction creates a new MergeAction node.
func (*MergeAction) StatementType ¶
func (m *MergeAction) StatementType() string
func (*MergeAction) String ¶
func (m *MergeAction) String() string
type MergeMatchKind ¶
type MergeMatchKind int
MergeMatchKind represents the type of WHEN clause in MERGE statements Ported from postgres/src/include/nodes/primnodes.h:1994-1999
const ( MERGE_WHEN_MATCHED MergeMatchKind = iota // WHEN MATCHED MERGE_WHEN_NOT_MATCHED_BY_SOURCE // WHEN NOT MATCHED BY SOURCE MERGE_WHEN_NOT_MATCHED_BY_TARGET // WHEN NOT MATCHED BY TARGET )
func (MergeMatchKind) SqlString ¶
func (m MergeMatchKind) SqlString() string
func (MergeMatchKind) String ¶
func (m MergeMatchKind) String() string
type MergeStmt ¶
type MergeStmt struct {
BaseNode
Relation *RangeVar `json:"relation"` // Target relation to merge into
SourceRelation Node `json:"sourceRelation"` // Source relation
JoinCondition Node `json:"joinCondition"` // Join condition between source and target
MergeWhenClauses *NodeList `json:"mergeWhenClauses"` // List of WHEN clauses
ReturningList *NodeList `json:"returningList"` // List of expressions to return
WithClause *WithClause `json:"withClause"` // WITH clause
}
MergeStmt represents a MERGE statement for conditional INSERT/UPDATE/DELETE operations Ported from postgres/src/include/nodes/parsenodes.h:2084-2093
func CloneRefOfMergeStmt ¶
CloneRefOfMergeStmt creates a deep clone of the input.
func NewMergeStmt ¶
NewMergeStmt creates a new MergeStmt node
func (*MergeStmt) StatementType ¶
type MergeSupportFunc ¶
type MergeSupportFunc struct {
BaseExpr
MsfType Oid // Type OID of result
MsfCollid Oid // OID of collation, or InvalidOid if none
}
MergeSupportFunc represents a merge support function Ported from postgres/src/include/nodes/primnodes.h:628-635
func CloneRefOfMergeSupportFunc ¶
func CloneRefOfMergeSupportFunc(n *MergeSupportFunc) *MergeSupportFunc
CloneRefOfMergeSupportFunc creates a deep clone of the input.
func NewMergeSupportFunc ¶
func NewMergeSupportFunc(msfType, msfCollid Oid, location int) *MergeSupportFunc
NewMergeSupportFunc creates a new MergeSupportFunc node.
func (*MergeSupportFunc) ExpressionType ¶
func (m *MergeSupportFunc) ExpressionType() string
func (*MergeSupportFunc) SqlString ¶
func (m *MergeSupportFunc) SqlString() string
SqlString returns the SQL representation of MergeSupportFunc
func (*MergeSupportFunc) String ¶
func (m *MergeSupportFunc) String() string
type MergeWhenClause ¶
type MergeWhenClause struct {
BaseNode
MatchKind MergeMatchKind `json:"matchKind"` // MATCHED/NOT MATCHED BY SOURCE/TARGET
CommandType CmdType `json:"commandType"` // INSERT/UPDATE/DELETE/DO NOTHING
Override OverridingKind `json:"override"` // OVERRIDING clause
Condition Node `json:"condition"` // WHEN conditions
TargetList []*ResTarget `json:"targetList"` // INSERT/UPDATE targetlist
Values *NodeList `json:"values"` // VALUES to INSERT, or NULL
}
MergeWhenClause represents individual WHEN clauses in MERGE statements Ported from postgres/src/include/nodes/parsenodes.h:1717-1727
func CloneRefOfMergeWhenClause ¶
func CloneRefOfMergeWhenClause(n *MergeWhenClause) *MergeWhenClause
CloneRefOfMergeWhenClause creates a deep clone of the input.
func NewMergeWhenClause ¶
func NewMergeWhenClause(matchKind MergeMatchKind, commandType CmdType) *MergeWhenClause
NewMergeWhenClause creates a new MergeWhenClause node
func (*MergeWhenClause) SqlString ¶
func (n *MergeWhenClause) SqlString() string
func (*MergeWhenClause) String ¶
func (n *MergeWhenClause) String() string
type MigrationActionSpec ¶
type MigrationActionSpec struct {
Direction MigrationDirection
When *A_Expr // WHEN (field OP constant); nil if omitted
Options *NodeList // *DefElem list; may be nil
}
MigrationActionSpec carries a parsed ALTER MIGRATION PHASE action's parameters. It lets the grammar express the IF EXISTS split once rather than duplicating the action grammar per branch. Not an AST Node; a grammar-only value type.
CONNECTION/SET subcommands existed here previously, re-pointing a migration's source connection or changing its sequence_margin or objects in place, backed by the now-removed UpdateMigration RPC. They are a candidate for future reintroduction but are not currently implemented.
type MigrationDirection ¶
type MigrationDirection int
MigrationDirection is the replication direction a PHASE action sets. The keyword's two values name the direction being set, not a literal MigrationPhase value: multigres.stat_migration's migration_phase column reports the derived steady state as IMPORTING/EXPORTING, not IMPORT/EXPORT.
const ( MigrationDirectionImport MigrationDirection = iota MigrationDirectionExport )
func (MigrationDirection) String ¶
func (d MigrationDirection) String() string
type MigrationDropBehavior ¶
type MigrationDropBehavior struct {
Force bool
When *A_Expr // WHEN (field OP constant); nil if omitted, defaults to requiring the migration already caught up
Options *NodeList // WITH (...) options, a DefElem list; may be nil
}
MigrationDropBehavior carries the trailing `[FORCE | WHEN (cond)] [WITH (...)]` of a DROP MIGRATION, so the grammar can express the IF EXISTS split once. Not an AST Node; a grammar-only value type.
type MigrationTables ¶
type MigrationTables struct {
ForAllTables bool
Objects *NodeList // *PublicationObjSpec list; nil when ForAllTables
}
MigrationTables carries the parsed table-selection clause of a CREATE MIGRATION: FOR ALL TABLES or a FOR object list. Not an AST Node; a grammar-only value type.
type MinMaxExpr ¶
type MinMaxExpr struct {
BaseExpr
MinMaxType Oid // Common type of arguments and result
MinMaxCollid Oid // OID of collation of result
InputCollid Oid // OID of collation that function should use
Op MinMaxOp // Function to execute
Args *NodeList // The arguments
}
MinMaxExpr represents a MIN/MAX expression Ported from postgres/src/include/nodes/primnodes.h:1506-1517
func CloneRefOfMinMaxExpr ¶
func CloneRefOfMinMaxExpr(n *MinMaxExpr) *MinMaxExpr
CloneRefOfMinMaxExpr creates a deep clone of the input.
func NewMinMaxExpr ¶
func NewMinMaxExpr(minMaxType, minMaxCollid, inputCollid Oid, op MinMaxOp, args *NodeList, location int) *MinMaxExpr
NewMinMaxExpr creates a new MinMaxExpr node.
func (*MinMaxExpr) ExpressionType ¶
func (m *MinMaxExpr) ExpressionType() string
func (*MinMaxExpr) SqlString ¶
func (m *MinMaxExpr) SqlString() string
SqlString returns the SQL representation of MinMaxExpr
func (*MinMaxExpr) String ¶
func (m *MinMaxExpr) String() string
type MinMaxOp ¶
type MinMaxOp int
MinMaxOp represents MIN/MAX operation types Ported from postgres/src/include/nodes/primnodes.h:1499-1502
type MultiAssignRef ¶
type MultiAssignRef struct {
BaseNode
Source Node // The sub-expression
Colno int // Column number (1-based)
Ncolumns int // Number of columns in the multi-assignment
}
MultiAssignRef represents a multi-assignment reference (used in UPDATE (col1, col2) = (val1, val2)). Ported from postgres/src/include/nodes/parsenodes.h:532-542
func CloneRefOfMultiAssignRef ¶
func CloneRefOfMultiAssignRef(n *MultiAssignRef) *MultiAssignRef
CloneRefOfMultiAssignRef creates a deep clone of the input.
func NewMultiAssignRef ¶
func NewMultiAssignRef(source Node, colno, ncolumns int, location int) *MultiAssignRef
NewMultiAssignRef creates a new MultiAssignRef node.
func (*MultiAssignRef) ExpressionType ¶
func (m *MultiAssignRef) ExpressionType() string
func (*MultiAssignRef) IsExpr ¶
func (m *MultiAssignRef) IsExpr() bool
func (*MultiAssignRef) SqlString ¶
func (m *MultiAssignRef) SqlString() string
SqlString returns the SQL representation of MultiAssignRef
func (*MultiAssignRef) String ¶
func (m *MultiAssignRef) String() string
type NamedArgExpr ¶
type NamedArgExpr struct {
BaseExpr
Arg Expression // The argument expression
Name string // The name
ArgNumber int // Argument's number in positional notation
}
NamedArgExpr represents a named argument expression Ported from postgres/src/include/nodes/primnodes.h:787-795
func CloneRefOfNamedArgExpr ¶
func CloneRefOfNamedArgExpr(n *NamedArgExpr) *NamedArgExpr
CloneRefOfNamedArgExpr creates a deep clone of the input.
func NewNamedArgExpr ¶
func NewNamedArgExpr(arg Expression, name string, argNumber, location int) *NamedArgExpr
NewNamedArgExpr creates a new NamedArgExpr node.
func (*NamedArgExpr) ExpressionType ¶
func (n *NamedArgExpr) ExpressionType() string
func (*NamedArgExpr) SqlString ¶
func (n *NamedArgExpr) SqlString() string
SqlString returns the SQL representation of NamedArgExpr
func (*NamedArgExpr) String ¶
func (n *NamedArgExpr) String() string
type NextValueExpr ¶
type NextValueExpr struct {
BaseExpr
Seqid Oid // OID of sequence relation - primnodes.h:2112
TypeId Oid // Type OID of result - primnodes.h:2113
}
NextValueExpr represents nextval() and currval() sequence operations. This handles sequence value generation and retrieval. Ported from postgres/src/include/nodes/primnodes.h:2109
func CloneRefOfNextValueExpr ¶
func CloneRefOfNextValueExpr(n *NextValueExpr) *NextValueExpr
CloneRefOfNextValueExpr creates a deep clone of the input.
func NewNextValueExpr ¶
func NewNextValueExpr(seqid, typeId Oid) *NextValueExpr
NewNextValueExpr creates a new NextValueExpr node.
func (*NextValueExpr) ExpressionType ¶
func (nve *NextValueExpr) ExpressionType() string
func (*NextValueExpr) String ¶
func (nve *NextValueExpr) String() string
type Node ¶
type Node interface {
// NodeTag returns the type tag for this node
NodeTag() NodeTag
// Location returns the byte offset in the source string where this node begins.
// Returns -1 if location is not available.
// Ported from postgres/src/include/nodes/parsenodes.h:6-12 location concept
Location() int
// SetLocation sets the byte offset in the source string where this node begins.
SetLocation(location int)
// String returns a string representation of the node (for debugging)
String() string
// SqlString returns the SQL representation of this node for deparsing
// This enables round-trip parsing: SQL -> AST -> SQL
SqlString() string
}
Node is the base interface for all PostgreSQL AST nodes. Every node in the parse tree implements this interface. Ported from postgres/src/include/nodes/nodes.h:128 (base node concept)
func CloneNode ¶
Code generated by asthelpergen. DO NOT EDIT. CloneNode creates a deep clone of the input.
func CloneSliceOfNode ¶
CloneSliceOfNode creates a deep clone of the input.
func FuncCallArg ¶
FuncCallArg resolves fc's parameter at positionalIndex, however the caller passed it: positionally or with name => value syntax (parsed as a *NamedArgExpr). given reports whether the parameter was specified at all; when false, the caller gave neither form and the parameter's default applies.
Shared by this file's own literalBoolArgAt and the planner's equivalent check (funcCallBoolArg in go/services/multigateway/planner/unsafe_funccall.go) so both enforcement points resolve an argument's position identically and can only differ in how they parse the resolved node as a literal — literalBoolArg's doc comment explains why that part can't be shared too.
The raw parser doesn't validate that named arguments only follow positional ones — PostgreSQL enforces that during catalog-aware semantic analysis, which this codebase (parser-only, no catalog) never performs — so this scans every item once rather than assuming a fixed layout: each non-named item advances a running positional counter, and a NamedArgExpr is matched by name regardless of where it appears.
func GetAggregateFilter ¶
GetAggregateFilter returns the FILTER expression of an aggregate.
func GetSubLinkTest ¶
GetSubLinkTest returns the test expression from a SubLink.
func GetSubquery ¶
GetSubquery returns the subquery node from a SubLink.
func NewQualifiedName ¶
NewQualifiedName creates a qualified name node (schema.name)
func NewValue ¶
NewValue creates a properly typed value node based on the Go type. This is a convenience function that delegates to the specific typed constructors.
func Rewrite ¶
Rewrite traverses a syntax tree recursively, starting with root, and calling pre and post for each node as described below. Rewrite returns the syntax tree, possibly modified.
If pre is not nil, it is called for each node before the node's children are traversed (pre-order). If pre returns false, no children are traversed, and post is not called for that node.
If post is not nil, and a prior call of pre didn't return false, post is called for each node after its children are traversed (post-order). If post returns false, traversal is terminated and Rewrite returns immediately.
Only fields that refer to AST nodes are considered children; i.e., fields of basic types (strings, []byte, etc.) are ignored.
Example usage:
// Find all table references
tables := []string{}
Rewrite(stmt, func(cursor *Cursor) bool {
if rv, ok := cursor.Node().(*RangeVar); ok {
tables = append(tables, rv.RelName)
}
return true // Continue traversal
}, nil)
// Replace all integer constants
Rewrite(stmt, func(cursor *Cursor) bool {
if intVal, ok := cursor.Node().(*Integer); ok {
if intVal.IVal == 42 {
cursor.Replace(NewInteger(100))
}
}
return true
}, nil)
type NodeList ¶
NodeList represents a list of nodes. This is a fundamental PostgreSQL concept used throughout the AST. Ported from postgres List structure concept
func CloneRefOfNodeList ¶
CloneRefOfNodeList creates a deep clone of the input.
func CloneSliceOfRefOfNodeList ¶
CloneSliceOfRefOfNodeList creates a deep clone of the input.
func ExtractArgTypes ¶
ExtractArgTypes extracts argument types from function arguments This function is used to convert FunctionParameter nodes to TypeName nodes
func GetAggregateArgs ¶
GetAggregateArgs returns the arguments of an aggregate expression.
func GetAggregateDirectArgs ¶
GetAggregateDirectArgs returns the direct arguments of an ordered-set aggregate.
func GetAggregateOrderBy ¶
GetAggregateOrderBy returns the ORDER BY expressions of an aggregate.
func GetArrayElements ¶
GetArrayElements returns the elements of an array expression.
func GetExpressionArgs ¶
GetExpressionArgs returns the arguments of an expression if it has any.
func MergeTableFuncParameters ¶
MergeTableFuncParameters merges regular function parameters with RETURNS TABLE columns. The table columns are appended to the parameter list with FUNC_PARAM_TABLE mode. This matches PostgreSQL's mergeTableFuncParameters function.
type NodeTag ¶
type NodeTag int
NodeTag represents the type of an AST node. Ported from postgres/src/include/nodes/nodes.h:26-31 (NodeTag enum)
const ( T_Invalid NodeTag = iota // Ported from postgres/src/include/nodes/nodes.h:28 // Basic node types - will be expanded in full implementation T_Node T_Query T_SelectStmt T_InsertStmt T_UpdateStmt T_DeleteStmt T_MergeStmt T_CreateStmt T_DropStmt T_AlterStmt T_AlterTableStmt T_AlterTableMoveAllStmt T_AlterTableCmd T_ReplicaIdentityStmt T_AlterDomainStmt T_IndexStmt T_IndexElem T_DefElem T_Constraint T_ViewStmt T_CreateSchemaStmt T_CreateSeqStmt T_AlterSeqStmt T_CreateTableAsStmt T_CreateAssertionStmt T_RefreshMatViewStmt T_CreateExtensionStmt T_AlterExtensionStmt T_AlterExtensionContentsStmt T_CreateFdwStmt T_AlterFdwStmt T_AlterForeignServerStmt T_AlterUserMappingStmt T_DropUserMappingStmt T_CreateEventTrigStmt T_AlterEventTrigStmt T_CreatedbStmt T_DropdbStmt T_DropTableSpaceStmt T_DropOwnedStmt T_ReassignOwnedStmt T_ImportForeignSchemaStmt T_CreateTableSpaceStmt T_AlterTableSpaceStmt T_CreateAmStmt T_CreateStatsStmt T_CreateCastStmt T_AlterStatsStmt T_AlterFunctionStmt T_AlterTypeStmt T_CreatePublicationStmt T_AlterPublicationStmt T_PublicationTable T_PublicationObjSpec T_CreateSubscriptionStmt T_AlterSubscriptionStmt T_AlterOpFamilyStmt T_CreateOpClassItem T_CreateOpClassStmt T_CreateOpFamilyStmt T_CreateDomainStmt T_DefineStmt T_CreateEnumStmt T_CreateRangeStmt T_AlterEnumStmt T_CompositeTypeStmt T_CreateFunctionStmt T_FunctionParameter T_CreateConversionStmt T_CreateTransformStmt T_CreatePLangStmt T_RoleSpec T_TypeName T_CollateClause // Utility statement nodes T_TransactionStmt T_GrantStmt T_GrantRoleStmt T_AlterDefaultPrivilegesStmt T_AccessPriv T_CreateRoleStmt T_AlterRoleStmt T_AlterRoleSetStmt T_DropRoleStmt T_VariableSetStmt T_VariableShowStmt T_AlterSystemStmt T_ExplainStmt T_PrepareStmt T_ExecuteStmt T_DeallocateStmt T_DeclareCursorStmt T_FetchStmt T_ClosePortalStmt T_CopyStmt T_VacuumStmt T_VacuumRelation T_ReindexStmt T_ClusterStmt T_CheckPointStmt T_DiscardStmt T_LoadStmt T_NotifyStmt T_ListenStmt T_UnlistenStmt T_ConstraintsSetStmt // Replication command nodes - ported from postgres/src/include/nodes/replnodes.h T_IdentifySystemCmd T_CreateReplicationSlotCmd T_DropReplicationSlotCmd T_AlterReplicationSlotCmd T_StartReplicationCmd T_ReadReplicationSlotCmd // Expression nodes T_Expr T_Var T_Const T_Param T_Aggref T_WindowFunc T_FuncExpr T_OpExpr T_DistinctExpr T_NullIfExpr T_BoolExpr T_CaseExpr T_ArrayExpr T_RowExpr T_CoalesceExpr T_ScalarArrayOpExpr T_SubLink // Query execution nodes (essential for SQL functionality) T_TargetEntry T_FromExpr T_JoinExpr T_SubPlan T_AlternativeSubPlan T_CommonTableExpr T_WindowClause T_SortGroupClause T_RowMarkClause T_OnConflictExpr // Type coercion and advanced expression nodes (essential for PostgreSQL type system) T_RelabelType T_CoerceViaIO T_ArrayCoerceExpr T_ConvertRowtypeExpr T_CollateExpr T_FieldSelect T_FieldStore T_SubscriptingRef T_NullTest T_BooleanTest T_CoerceToDomain T_CoerceToDomainValue T_SetToDefault T_CurrentOfExpr T_NextValueExpr T_InferenceElem // Administrative and advanced DDL nodes (comprehensive PostgreSQL DDL support) T_TableLikeClause T_PartitionSpec T_PartitionBoundSpec T_PartitionRangeDatum T_StatsElem T_CreateForeignServerStmt T_CreateForeignTableStmt T_CreateUserMappingStmt T_CreateTriggerStmt T_CreatePolicyStmt T_AlterPolicyStmt T_TriggerTransition // List and utility nodes T_List T_ResTarget T_RangeVar T_ColumnRef T_AConst // Core parse infrastructure nodes - Stage 1A (25 nodes) T_RawStmt T_A_Expr T_A_Const T_ParamRef T_TypeCast T_ParenExpr T_FuncCall T_A_Star T_A_Indices T_A_Indirection T_A_ArrayExpr T_ColumnDef T_WithClause T_CTESearchClause T_CTECycleClause T_MultiAssignRef T_WindowDef T_SortBy T_GroupingSet T_LockingClause T_XmlSerialize T_PartitionElem T_TableSampleClause T_ObjectWithArgs T_SinglePartitionSpec T_PartitionCmd // Advanced statement nodes - Phase 1B (12 nodes) T_SetOperationStmt T_ReturnStmt T_PLAssignStmt T_OnConflictClause T_InferClause T_WithCheckOption T_MergeWhenClause T_TruncateStmt T_CommentStmt T_SecLabelStmt T_DoStmt T_CallStmt T_RenameStmt T_AlterOwnerStmt T_RuleStmt T_LockStmt T_AlterObjectSchemaStmt T_AlterOperatorStmt T_AlterObjectDependsStmt T_AlterCollationStmt T_AlterDatabaseStmt T_AlterDatabaseSetStmt T_AlterDatabaseRefreshCollStmt T_AlterCompositeTypeStmt T_AlterTSConfigurationStmt T_AlterTSDictionaryStmt // Range table and FROM clause nodes - Phase 1D (9 nodes) T_RangeTblEntry T_RangeSubselect T_RangeFunction T_RangeTableFunc T_RangeTableFuncCol T_RangeTableSample T_RangeTblFunction T_RTEPermissionInfo T_RangeTblRef // JSON parse tree nodes - Phase 1E (16 main nodes + 4 supporting types) T_JsonFormat T_JsonReturning T_JsonValueExpr T_JsonBehavior T_JsonOutput T_JsonArgument T_JsonFuncExpr T_JsonTablePathSpec T_JsonTable T_JsonTableColumn T_JsonKeyValue T_JsonParseExpr T_JsonScalarExpr T_JsonSerializeExpr T_JsonObjectConstructor T_JsonArrayConstructor T_JsonArrayQueryConstructor T_JsonAggConstructor T_JsonObjectAgg T_JsonArrayAgg // Phase 1G: JSON Primitive Expressions - primnodes.h JSON expression nodes T_JsonConstructorExpr // JSON constructor expression - primnodes.h:1703 T_JsonIsPredicate // JSON IS predicate - primnodes.h:1732 T_JsonExpr // JSON expression - primnodes.h:1813 T_JsonTablePath // JSON table path - primnodes.h:1867 T_JsonTablePlan // JSON table plan - primnodes.h:1882 T_JsonTablePathScan // JSON table path scan - primnodes.h:1893 T_JsonTableSiblingJoin // JSON table sibling join - primnodes.h:1923 // Phase 1F: Primitive Expression Completion Part 1 - primnodes.h nodes T_GroupingFunc // GROUPING function - primnodes.h:537 T_WindowFuncRunCondition // Window function run condition - primnodes.h:596 T_MergeSupportFunc // Merge support function - primnodes.h:628 T_NamedArgExpr // Named argument expression - primnodes.h:787 T_CaseTestExpr // CASE test expression - primnodes.h:1352 T_MinMaxExpr // MIN/MAX expression - primnodes.h:1506 T_RowCompareExpr // Row comparison - primnodes.h:1463 T_SQLValueFunction // SQL value function - primnodes.h:1553 T_XmlExpr // XML expression - primnodes.h:1596 T_MergeAction // MERGE action - primnodes.h:2003 T_TableFunc // Table function - primnodes.h:109 T_IntoClause // INTO clause - primnodes.h:158 // Value nodes - ported from postgres/src/include/nodes/value.h T_Integer // Integer literal - postgres/src/include/nodes/value.h:28-34 T_Float // Float literal - postgres/src/include/nodes/value.h:47-53 T_Boolean // Boolean literal - postgres/src/include/nodes/value.h:55-61 T_String // String literal - postgres/src/include/nodes/value.h:63-69 T_BitString // Bit string literal - postgres/src/include/nodes/value.h:71-77 T_Null // NULL literal // Multigres-specific migration/connection statements, not part of PostgreSQL. T_CreateConnectionStmt T_DropConnectionStmt T_ShowConnectionsStmt T_CreateMigrationStmt T_AlterMigrationStmt T_DropMigrationStmt // Multigres tablegroup DDL (go/common/parser/ast/sharding.go) T_CreateTableGroupStmt T_AlterTableGroupStmt )
NodeTag constants - ported from postgres/src/include/nodes/nodes.h:28-30 These represent the fundamental node types in the PostgreSQL AST
func GetExprTag ¶
GetExprTag maps expression types to NodeTag constants. Expression NodeTag constants are defined in nodes.go
type NodeWalker ¶
NodeWalker is a function type for walking the AST. It receives a node and returns whether to continue walking.
type NormalizeResult ¶
type NormalizeResult struct {
// NormalizedSQL is the SQL string with literals replaced by $1, $2, ...
// Used as the plan cache key.
NormalizedSQL string
// NormalizedAST is the cloned AST with A_Const replaced by ParamRef.
// Used for planning on cache miss and for SQL reconstruction at execution time.
NormalizedAST Stmt
// BindValues holds the extracted literal A_Const values in parameter order.
// BindValues[0] corresponds to $1, etc.
BindValues []*A_Const
}
NormalizeResult holds the output of AST normalization.
func Normalize ¶
func Normalize(stmt Stmt) *NormalizeResult
Normalize replaces literal A_Const values in the AST with ParamRef ($1, $2, ...) placeholders and returns the normalized SQL string along with the extracted values.
The input AST is cloned before modification — the original is not mutated. Only A_Const nodes in expression positions are replaced. Nodes inside VariableSetStmt, VariableShowStmt, and DefElem subtrees are skipped because their literal values carry semantic meaning that affects planning.
The same applies inside built-in function calls whose arguments the planner inspects literally — `set_config(name, value, is_local)`, where the planner rewrites a bare SELECT into the equivalent SET and needs the literal values to build the SessionSettings update; `current_setting(name[, missing_ok])`, where the planner reads the literal name to decide whether the setting is gateway-managed and, if so, rewrites the call to return the gateway-owned value; and `pg_create_physical_replication_slot`/ `pg_create_logical_replication_slot`, where the planner rejects a call whose `temporary` argument isn't a literal `true`. See go/services/multigateway/planner/unsafe_funccall.go.
NULL constants (A_Const with Isnull=true) are NOT normalized because NULL is a keyword that affects query semantics (e.g., IS NULL vs IS $1).
func (*NormalizeResult) Fingerprint ¶
func (r *NormalizeResult) Fingerprint() string
Fingerprint returns a stable 16-character hex hash of the normalized SQL. Two queries with the same NormalizedSQL produce identical fingerprints, which makes the fingerprint suitable as a per-query-shape identifier for metrics aggregation and cache keys.
func (*NormalizeResult) WasNormalized ¶
func (r *NormalizeResult) WasNormalized() bool
WasNormalized reports whether any literals were replaced during normalization.
type NotifyStmt ¶
type NotifyStmt struct {
BaseNode
Conditionname string // Condition name - postgres/src/include/nodes/parsenodes.h:3625
Payload string // Optional payload string - postgres/src/include/nodes/parsenodes.h:3626
}
NotifyStmt represents a NOTIFY statement. Ported from postgres/src/include/nodes/parsenodes.h:3622-3627
func CloneRefOfNotifyStmt ¶
func CloneRefOfNotifyStmt(n *NotifyStmt) *NotifyStmt
CloneRefOfNotifyStmt creates a deep clone of the input.
func NewNotifyStmt ¶
func NewNotifyStmt(conditionname, payload string) *NotifyStmt
NewNotifyStmt creates a new NOTIFY statement.
func (*NotifyStmt) SqlString ¶
func (ns *NotifyStmt) SqlString() string
SqlString returns the SQL representation of the NOTIFY statement
func (*NotifyStmt) StatementType ¶
func (ns *NotifyStmt) StatementType() string
func (*NotifyStmt) String ¶
func (ns *NotifyStmt) String() string
type Null ¶
type Null struct {
BaseNode
}
Null represents a NULL literal value node.
func CloneRefOfNull ¶
CloneRefOfNull creates a deep clone of the input.
func (*Null) ExpressionType ¶
type NullIfExpr ¶
type NullIfExpr struct {
BaseExpr
Opno Oid // pg_operator OID of the "=" operator - primnodes.h:816
Opfuncid Oid // Underlying function OID - primnodes.h:817
Opresulttype Oid // Result type: the first operand's type - primnodes.h:818
Opretset bool // Returns set? - primnodes.h:819
Opcollid Oid // Result collation - primnodes.h:820
Inputcollid Oid // Input collation - primnodes.h:821
Args *NodeList // The two operands - primnodes.h:822
}
NullIfExpr represents NULLIF(a, b). Like DistinctExpr it is PostgreSQL's "typedef OpExpr NullIfExpr" (primnodes.h:855): the "=" operator's fields, with Opresulttype set to the first operand's type rather than bool. Ported from postgres/src/include/nodes/primnodes.h:848
func CloneRefOfNullIfExpr ¶
func CloneRefOfNullIfExpr(n *NullIfExpr) *NullIfExpr
CloneRefOfNullIfExpr creates a deep clone of the input.
func NewNullIfExpr ¶
func NewNullIfExpr(opno Oid, opfuncid Oid, opresulttype Oid, args *NodeList) *NullIfExpr
NewNullIfExpr creates a new NullIfExpr node.
func (*NullIfExpr) ExpressionType ¶
func (n *NullIfExpr) ExpressionType() string
func (*NullIfExpr) String ¶
func (n *NullIfExpr) String() string
type NullTest ¶
type NullTest struct {
BaseExpr
Arg Expression // Input expression - primnodes.h:1958
Nulltesttype NullTestType // IS NULL or IS NOT NULL - primnodes.h:1959
Argisrow bool // True if input is known to be a row value - primnodes.h:1961
}
NullTest represents IS NULL and IS NOT NULL tests. This is one of the most fundamental SQL test expressions. Ported from postgres/src/include/nodes/primnodes.h:1955
func CloneRefOfNullTest ¶
CloneRefOfNullTest creates a deep clone of the input.
func NewIsNotNullTest ¶
func NewIsNotNullTest(arg Expression) *NullTest
NewIsNotNullTest creates a new IS NOT NULL test.
func NewIsNullTest ¶
func NewIsNullTest(arg Expression) *NullTest
NewIsNullTest creates a new IS NULL test.
func NewNullTest ¶
func NewNullTest(arg Expression, nulltesttype NullTestType) *NullTest
NewNullTest creates a new NullTest node.
func NewRowNullTest ¶
func NewRowNullTest(arg Expression, nulltesttype NullTestType) *NullTest
NewRowNullTest creates a NullTest for row values.
func (*NullTest) ExpressionType ¶
type NullTestType ¶
type NullTestType int
NullTestType represents the type of NULL test. Ported from postgres/src/include/nodes/primnodes.h:1950
const ( IS_NULL NullTestType = iota // IS NULL - primnodes.h:1952 IS_NOT_NULL // IS NOT NULL - primnodes.h:1952 )
type ObjectType ¶
type ObjectType int
ObjectType represents the type of database object - ported from postgres/src/include/nodes/parsenodes.h:2256-2310
const ( OBJECT_ACCESS_METHOD ObjectType = iota OBJECT_AGGREGATE OBJECT_AMOP OBJECT_AMPROC OBJECT_ATTRIBUTE // type's attribute, when distinct from column OBJECT_CAST OBJECT_COLUMN OBJECT_COLLATION OBJECT_CONVERSION OBJECT_DATABASE OBJECT_DEFAULT OBJECT_DEFACL OBJECT_DOMAIN OBJECT_DOMCONSTRAINT OBJECT_EVENT_TRIGGER OBJECT_EXTENSION OBJECT_FDW OBJECT_FOREIGN_SERVER OBJECT_FOREIGN_TABLE OBJECT_FUNCTION OBJECT_INDEX OBJECT_LANGUAGE OBJECT_LARGEOBJECT OBJECT_MATVIEW OBJECT_OPCLASS OBJECT_OPERATOR OBJECT_OPFAMILY OBJECT_PARAMETER_ACL OBJECT_POLICY OBJECT_PROCEDURE OBJECT_PUBLICATION OBJECT_PUBLICATION_NAMESPACE OBJECT_PUBLICATION_REL OBJECT_ROLE OBJECT_ROUTINE OBJECT_RULE OBJECT_SCHEMA OBJECT_SEQUENCE OBJECT_SUBSCRIPTION OBJECT_STATISTIC_EXT OBJECT_TABCONSTRAINT OBJECT_TABLE OBJECT_TABLESPACE OBJECT_TABLEGROUP // Multigres tablegroup (sharding.go) OBJECT_TRANSFORM OBJECT_TRIGGER OBJECT_TSCONFIGURATION OBJECT_TSDICTIONARY OBJECT_TSPARSER OBJECT_TSTEMPLATE OBJECT_TYPE OBJECT_USER_MAPPING OBJECT_VIEW )
func (ObjectType) String ¶
func (o ObjectType) String() string
type ObjectWithArgs ¶
type ObjectWithArgs struct {
BaseNode
Objname *NodeList // Qualified object name
Objargs *NodeList // List of argument types (TypeName nodes)
ObjfuncArgs *NodeList // List of function arguments for ALTER FUNCTION
ArgsUnspecified bool // Arguments were omitted, so name must be unique
}
ObjectWithArgs represents an object name with arguments (used for functions, operators, etc.). Ported from postgres/src/include/nodes/parsenodes.h:2524-2539
func CloneRefOfObjectWithArgs ¶
func CloneRefOfObjectWithArgs(n *ObjectWithArgs) *ObjectWithArgs
CloneRefOfObjectWithArgs creates a deep clone of the input.
func NewEmptyObjectWithArgs ¶
func NewEmptyObjectWithArgs() *ObjectWithArgs
NewEmptyObjectWithArgs creates a new ObjectWithArgs node with empty constructor
func NewObjectWithArgs ¶
func NewObjectWithArgs(objname *NodeList, objargs *NodeList, argsUnspecified bool, location int) *ObjectWithArgs
NewObjectWithArgs creates a new ObjectWithArgs node.
func (*ObjectWithArgs) SqlString ¶
func (o *ObjectWithArgs) SqlString() string
SqlString returns the SQL representation of ObjectWithArgs
func (*ObjectWithArgs) StatementType ¶
func (o *ObjectWithArgs) StatementType() string
func (*ObjectWithArgs) String ¶
func (o *ObjectWithArgs) String() string
type Oid ¶
Oid is an alias for the object identifier type defined in pgoid (the analogue of postgres/src/include/postgres_ext.h); the builtin type OID constants are re-exported in oids_generated.go.
func ArrayTypeOid ¶
ArrayTypeOid returns the built-in array OID for an element OID.
func CloneSliceOfOid ¶
CloneSliceOfOid creates a deep clone of the input.
func TypeNameToOid ¶
TypeNameToOid resolves a simple (unqualified) PostgreSQL type name to its OID. Handles common aliases like "int" → INT4OID, "boolean" → BOOLOID, etc. Returns InvalidOid for unrecognized type names.
type OnCommitAction ¶
type OnCommitAction int
OnCommitAction represents actions for temporary tables on transaction commit. Ported from postgres/src/include/nodes/primnodes.h:55
const ( ONCOMMIT_NOOP OnCommitAction = iota // No ON COMMIT clause (do nothing) - primnodes.h:57 ONCOMMIT_PRESERVE_ROWS // ON COMMIT PRESERVE ROWS (do nothing) - primnodes.h:58 ONCOMMIT_DELETE_ROWS // ON COMMIT DELETE ROWS - primnodes.h:59 ONCOMMIT_DROP // ON COMMIT DROP - primnodes.h:60 )
type OnConflictAction ¶
type OnConflictAction int
OnConflictAction represents the action to take on conflicts. Ported from postgres/src/include/nodes/nodes.h:415
const ( ONCONFLICT_NONE OnConflictAction = iota // No ON CONFLICT clause - nodes.h:417 ONCONFLICT_NOTHING // ON CONFLICT DO NOTHING - nodes.h:418 ONCONFLICT_UPDATE // ON CONFLICT DO UPDATE - nodes.h:419 )
func (OnConflictAction) SqlString ¶
func (o OnConflictAction) SqlString() string
func (OnConflictAction) String ¶
func (o OnConflictAction) String() string
type OnConflictClause ¶
type OnConflictClause struct {
BaseNode
Action OnConflictAction `json:"action"` // DO NOTHING or UPDATE?
Infer *InferClause `json:"infer"` // Optional index inference clause
TargetList *NodeList `json:"targetList"` // The target list (of ResTarget)
WhereClause Node `json:"whereClause"` // Qualifications
}
OnConflictClause represents ON CONFLICT clause for INSERT statements Ported from postgres/src/include/nodes/parsenodes.h:1621-1629
func CloneRefOfOnConflictClause ¶
func CloneRefOfOnConflictClause(n *OnConflictClause) *OnConflictClause
CloneRefOfOnConflictClause creates a deep clone of the input.
func NewOnConflictClause ¶
func NewOnConflictClause(action OnConflictAction) *OnConflictClause
NewOnConflictClause creates a new OnConflictClause node
func (*OnConflictClause) SqlString ¶
func (n *OnConflictClause) SqlString() string
func (*OnConflictClause) String ¶
func (n *OnConflictClause) String() string
type OnConflictExpr ¶
type OnConflictExpr struct {
BaseExpr
Action OnConflictAction // The action to take - primnodes.h:2324
ArbiterElems *NodeList // Unique index arbiter list (of InferenceElem's) - primnodes.h:2327
ArbiterWhere Expression // Unique index arbiter WHERE clause - primnodes.h:2329
Constraint Oid // Constraint to infer from - primnodes.h:2330
OnConflictSet *NodeList // List of ON CONFLICT SET targets - primnodes.h:2333
OnConflictWhere Expression // WHERE clause for ON CONFLICT UPDATE - primnodes.h:2334
ExclRelIndex int // RT index of the EXCLUDED pseudo-relation - primnodes.h:2335
ExclRelTlist *NodeList // Tlist of the EXCLUDED pseudo-relation - primnodes.h:2336
}
OnConflictExpr represents INSERT ... ON CONFLICT expressions. This is an important PostgreSQL-specific feature for handling conflicts during INSERT operations (UPSERT functionality). Ported from postgres/src/include/nodes/primnodes.h:2321
func CloneRefOfOnConflictExpr ¶
func CloneRefOfOnConflictExpr(n *OnConflictExpr) *OnConflictExpr
CloneRefOfOnConflictExpr creates a deep clone of the input.
func NewOnConflictDoNothing ¶
func NewOnConflictDoNothing() *OnConflictExpr
NewOnConflictDoNothing creates a new ON CONFLICT DO NOTHING expression.
func NewOnConflictDoUpdate ¶
func NewOnConflictDoUpdate(onConflictSet *NodeList) *OnConflictExpr
NewOnConflictDoUpdate creates a new ON CONFLICT DO UPDATE expression.
func NewOnConflictExpr ¶
func NewOnConflictExpr(action OnConflictAction) *OnConflictExpr
NewOnConflictExpr creates a new OnConflictExpr node.
func (*OnConflictExpr) ExpressionType ¶
func (oce *OnConflictExpr) ExpressionType() string
func (*OnConflictExpr) String ¶
func (oce *OnConflictExpr) String() string
type OpClassItemType ¶
type OpClassItemType int
OpClassItemType represents types of operator class items
const ( OPCLASS_ITEM_OPERATOR OpClassItemType = 1 // #define OPCLASS_ITEM_OPERATOR 1 OPCLASS_ITEM_FUNCTION OpClassItemType = 2 // #define OPCLASS_ITEM_FUNCTION 2 OPCLASS_ITEM_STORAGETYPE OpClassItemType = 3 // #define OPCLASS_ITEM_STORAGETYPE 3 )
type OpExpr ¶
type OpExpr struct {
BaseExpr
Opno Oid // pg_operator OID - postgres/src/include/nodes/primnodes.h:816
Opfuncid Oid // Underlying function OID - postgres/src/include/nodes/primnodes.h:817
Opresulttype Oid // Result type - postgres/src/include/nodes/primnodes.h:818
Opretset bool // Returns set? - postgres/src/include/nodes/primnodes.h:819
Opcollid Oid // Result collation - postgres/src/include/nodes/primnodes.h:820
Inputcollid Oid // Input collation - postgres/src/include/nodes/primnodes.h:821
Args *NodeList // Operator arguments (1 or 2) - postgres/src/include/nodes/primnodes.h:822
}
OpExpr represents a binary or unary operator expression. Ported from postgres/src/include/nodes/primnodes.h:813
func CloneRefOfOpExpr ¶
CloneRefOfOpExpr creates a deep clone of the input.
func NewBinaryOp ¶
NewBinaryOp creates a binary operator expression.
func NewUnaryOp ¶
NewUnaryOp creates a unary operator expression.
func (*OpExpr) ExpressionType ¶
type OverridingKind ¶
type OverridingKind int
OverridingKind represents OVERRIDING clause options Ported from postgres/src/include/nodes/primnodes.h:25-30
const ( OVERRIDING_NOT_SET OverridingKind = iota // No OVERRIDING clause OVERRIDING_USER_VALUE // OVERRIDING USER VALUE OVERRIDING_SYSTEM_VALUE // OVERRIDING SYSTEM VALUE )
func (OverridingKind) SqlString ¶
func (o OverridingKind) SqlString() string
func (OverridingKind) String ¶
func (o OverridingKind) String() string
type PLAssignStmt ¶
type PLAssignStmt struct {
BaseNode
Name string `json:"name"` // Initial column name
Indirection *NodeList `json:"indirection"` // Subscripts and field names, if any
Nnames int `json:"nnames"` // Number of names to use in ColumnRef
Val *SelectStmt `json:"val"` // The PL/pgSQL expression to assign
}
PLAssignStmt represents PL/pgSQL assignment statements Ported from postgres/src/include/nodes/parsenodes.h:2224-2233
func CloneRefOfPLAssignStmt ¶
func CloneRefOfPLAssignStmt(n *PLAssignStmt) *PLAssignStmt
CloneRefOfPLAssignStmt creates a deep clone of the input.
func NewPLAssignStmt ¶
func NewPLAssignStmt(name string, val *SelectStmt) *PLAssignStmt
NewPLAssignStmt creates a new PLAssignStmt node
func (*PLAssignStmt) SqlString ¶
func (n *PLAssignStmt) SqlString() string
SqlString returns the SQL representation of the PLAssignStmt
func (*PLAssignStmt) StatementType ¶
func (n *PLAssignStmt) StatementType() string
StatementType returns the statement type
func (*PLAssignStmt) String ¶
func (n *PLAssignStmt) String() string
type Param ¶
type Param struct {
BaseExpr
Paramkind ParamKind // Parameter type - postgres/src/include/nodes/primnodes.h:390
Paramid int // Parameter ID - postgres/src/include/nodes/primnodes.h:391
Paramtype Oid // Datatype OID - postgres/src/include/nodes/primnodes.h:392
Paramtypmod int32 // Type modifier - postgres/src/include/nodes/primnodes.h:393
Paramcollid Oid // Collation OID - postgres/src/include/nodes/primnodes.h:394
}
Param represents a parameter reference in a prepared statement. Ported from postgres/src/include/nodes/primnodes.h:373
func CloneRefOfParam ¶
CloneRefOfParam creates a deep clone of the input.
func (*Param) ExpressionType ¶
type ParamKind ¶
type ParamKind int
ParamKind represents parameter types - ported from postgres/src/include/nodes/primnodes.h:365-371
type ParamRef ¶
ParamRef represents a parameter reference ($1, $2, etc.) in the parse tree. Ported from postgres/src/include/nodes/parsenodes.h:301-309
func CloneRefOfParamRef ¶
CloneRefOfParamRef creates a deep clone of the input.
func NewParamRef ¶
NewParamRef creates a new ParamRef node.
func (*ParamRef) ExpressionType ¶
type ParenExpr ¶
ParenExpr represents a parenthesized expression to preserve grouping
func CloneRefOfParenExpr ¶
CloneRefOfParenExpr creates a deep clone of the input.
func NewParenExpr ¶
NewParenExpr creates a new ParenExpr node.
func (*ParenExpr) ExpressionType ¶
type PartitionBoundSpec ¶
type PartitionBoundSpec struct {
BaseNode
Strategy PartitionStrategy // Partitioning strategy - parsenodes.h:898
IsDefault bool // Is this a default partition? - parsenodes.h:899
Modulus int // Hash partition modulus - parsenodes.h:900
Remainder int // Hash partition remainder - parsenodes.h:901
ListDatums *NodeList // List of list datums per column - parsenodes.h:902
LowDatums *NodeList // List of lower datums for range bounds - parsenodes.h:903
HighDatums *NodeList // List of upper datums for range bounds - parsenodes.h:904
}
PartitionBoundSpec represents partition boundary specifications. This defines the actual bounds for individual partitions. Ported from postgres/src/include/nodes/parsenodes.h:896
func CloneRefOfPartitionBoundSpec ¶
func CloneRefOfPartitionBoundSpec(n *PartitionBoundSpec) *PartitionBoundSpec
CloneRefOfPartitionBoundSpec creates a deep clone of the input.
func NewDefaultPartitionBound ¶
func NewDefaultPartitionBound() *PartitionBoundSpec
NewDefaultPartitionBound creates a new default partition bound.
func NewHashPartitionBound ¶
func NewHashPartitionBound(modulus, remainder int) *PartitionBoundSpec
NewHashPartitionBound creates a new hash partition bound.
func NewListPartitionBound ¶
func NewListPartitionBound(listDatums *NodeList) *PartitionBoundSpec
NewListPartitionBound creates a new list partition bound.
func NewPartitionBoundSpec ¶
func NewPartitionBoundSpec(strategy PartitionStrategy) *PartitionBoundSpec
NewPartitionBoundSpec creates a new PartitionBoundSpec node.
func NewRangePartitionBound ¶
func NewRangePartitionBound(lowDatums, highDatums *NodeList) *PartitionBoundSpec
NewRangePartitionBound creates a new range partition bound.
func (*PartitionBoundSpec) SqlString ¶
func (pbs *PartitionBoundSpec) SqlString() string
func (*PartitionBoundSpec) String ¶
func (pbs *PartitionBoundSpec) String() string
type PartitionCmd ¶
type PartitionCmd struct {
BaseNode
Name *RangeVar // Name of the partition
Bound *PartitionBoundSpec // Partition bound specification
Concurrent bool // CONCURRENTLY option
}
PartitionCmd represents a partition command in ALTER TABLE. Ported from postgres/src/include/nodes/parsenodes.h:953-964
func CloneRefOfPartitionCmd ¶
func CloneRefOfPartitionCmd(n *PartitionCmd) *PartitionCmd
CloneRefOfPartitionCmd creates a deep clone of the input.
func NewPartitionCmd ¶
func NewPartitionCmd(name *RangeVar, bound *PartitionBoundSpec, concurrent bool, location int) *PartitionCmd
NewPartitionCmd creates a new PartitionCmd node.
func (*PartitionCmd) SqlString ¶
func (p *PartitionCmd) SqlString() string
func (*PartitionCmd) StatementType ¶
func (p *PartitionCmd) StatementType() string
func (*PartitionCmd) String ¶
func (p *PartitionCmd) String() string
type PartitionElem ¶
type PartitionElem struct {
BaseNode
Name string // Name of column to partition on
Expr Node // Expression to partition on, or NULL
Collation *NodeList // Collation name
Opclass *NodeList // Operator class name
}
PartitionElem represents a partition element in partition specifications. Ported from postgres/src/include/nodes/parsenodes.h:860-881
func CloneRefOfPartitionElem ¶
func CloneRefOfPartitionElem(n *PartitionElem) *PartitionElem
CloneRefOfPartitionElem creates a deep clone of the input.
func NewPartitionElem ¶
func NewPartitionElem(name string, expr Node, location int) *PartitionElem
NewPartitionElem creates a new PartitionElem node.
func (*PartitionElem) SqlString ¶
func (p *PartitionElem) SqlString() string
SqlString returns the SQL representation of PartitionElem
func (*PartitionElem) StatementType ¶
func (p *PartitionElem) StatementType() string
func (*PartitionElem) String ¶
func (p *PartitionElem) String() string
type PartitionRangeDatum ¶
type PartitionRangeDatum struct {
BaseNode
Kind PartitionRangeDatumKind // What kind of datum this is - parsenodes.h:931
Value Node // The actual datum value - parsenodes.h:932
}
PartitionRangeDatum represents partition range datum values. Ported from postgres/src/include/nodes/parsenodes.h:929
func CloneRefOfPartitionRangeDatum ¶
func CloneRefOfPartitionRangeDatum(n *PartitionRangeDatum) *PartitionRangeDatum
CloneRefOfPartitionRangeDatum creates a deep clone of the input.
func NewMaxValueDatum ¶
func NewMaxValueDatum() *PartitionRangeDatum
NewMaxValueDatum creates a MAXVALUE range datum.
func NewMinValueDatum ¶
func NewMinValueDatum() *PartitionRangeDatum
NewMinValueDatum creates a MINVALUE range datum.
func NewPartitionRangeDatum ¶
func NewPartitionRangeDatum(kind PartitionRangeDatumKind, value Node) *PartitionRangeDatum
NewPartitionRangeDatum creates a new PartitionRangeDatum node.
func NewValueDatum ¶
func NewValueDatum(value Node) *PartitionRangeDatum
NewValueDatum creates a specific value range datum.
func (*PartitionRangeDatum) String ¶
func (prd *PartitionRangeDatum) String() string
type PartitionRangeDatumKind ¶
type PartitionRangeDatumKind int
PartitionRangeDatumKind represents types of range datums. Ported from postgres/src/include/nodes/parsenodes.h:935-939
const ( PARTITION_RANGE_DATUM_MINVALUE PartitionRangeDatumKind = iota // MINVALUE - parsenodes.h:936 PARTITION_RANGE_DATUM_VALUE // Specific value - parsenodes.h:937 PARTITION_RANGE_DATUM_MAXVALUE // MAXVALUE - parsenodes.h:938 )
type PartitionSpec ¶
type PartitionSpec struct {
BaseNode
Strategy PartitionStrategy // Partitioning strategy - parsenodes.h:884
PartParams *NodeList // List of PartitionElem nodes - parsenodes.h:885
}
PartitionSpec represents table partitioning specifications. Modern PostgreSQL feature for table partitioning. Ported from postgres/src/include/nodes/parsenodes.h:882
func CloneRefOfPartitionSpec ¶
func CloneRefOfPartitionSpec(n *PartitionSpec) *PartitionSpec
CloneRefOfPartitionSpec creates a deep clone of the input.
func NewHashPartitionSpec ¶
func NewHashPartitionSpec(partParams *NodeList) *PartitionSpec
NewHashPartitionSpec creates a new HASH partition specification.
func NewListPartitionSpec ¶
func NewListPartitionSpec(partParams *NodeList) *PartitionSpec
NewListPartitionSpec creates a new LIST partition specification.
func NewPartitionSpec ¶
func NewPartitionSpec(strategy PartitionStrategy, partParams *NodeList) *PartitionSpec
NewPartitionSpec creates a new PartitionSpec node.
func NewRangePartitionSpec ¶
func NewRangePartitionSpec(partParams *NodeList) *PartitionSpec
NewRangePartitionSpec creates a new RANGE partition specification.
func (*PartitionSpec) SqlString ¶
func (ps *PartitionSpec) SqlString() string
SqlString returns the SQL representation of the PartitionSpec
func (*PartitionSpec) String ¶
func (ps *PartitionSpec) String() string
type PartitionStrategy ¶
type PartitionStrategy string
PartitionStrategy represents partitioning strategies. Ported from postgres/src/include/nodes/parsenodes.h:865-869
const ( PARTITION_STRATEGY_LIST PartitionStrategy = "list" // LIST partitioning - parsenodes.h:866 PARTITION_STRATEGY_RANGE PartitionStrategy = "range" // RANGE partitioning - parsenodes.h:867 PARTITION_STRATEGY_HASH PartitionStrategy = "hash" // HASH partitioning - parsenodes.h:868 )
type PrepareStmt ¶
type PrepareStmt struct {
BaseNode
Name string // Statement name - postgres/src/include/nodes/parsenodes.h:4033
Argtypes *NodeList // List of TypeName nodes (specified arg types) - postgres/src/include/nodes/parsenodes.h:4034
Query Node // Statement to prepare - postgres/src/include/nodes/parsenodes.h:4035
}
PrepareStmt represents a PREPARE statement. Ported from postgres/src/include/nodes/parsenodes.h:4030
func CloneRefOfPrepareStmt ¶
func CloneRefOfPrepareStmt(n *PrepareStmt) *PrepareStmt
CloneRefOfPrepareStmt creates a deep clone of the input.
func NewPrepareStmt ¶
func NewPrepareStmt(name string, argtypes *NodeList, query Node) *PrepareStmt
NewPrepareStmt creates a new PREPARE statement.
func (*PrepareStmt) SqlString ¶
func (ps *PrepareStmt) SqlString() string
SqlString returns the SQL representation of the PREPARE statement
func (*PrepareStmt) StatementType ¶
func (ps *PrepareStmt) StatementType() string
func (*PrepareStmt) String ¶
func (ps *PrepareStmt) String() string
type PublicationObjSpec ¶
type PublicationObjSpec struct {
BaseNode
PubObjType PublicationObjSpecType `json:"pubobjtype"` // type of this publication object
Name string `json:"name"` // object name
PubTable *PublicationTable `json:"pubtable"` // publication table details
}
PublicationObjSpec represents a publication object specification Ported from postgres/src/include/nodes/parsenodes.h:4151-4158
func CloneRefOfPublicationObjSpec ¶
func CloneRefOfPublicationObjSpec(n *PublicationObjSpec) *PublicationObjSpec
CloneRefOfPublicationObjSpec creates a deep clone of the input.
func NewPublicationObjSpec ¶
func NewPublicationObjSpec(objType PublicationObjSpecType) *PublicationObjSpec
NewPublicationObjSpec creates a basic PublicationObjSpec (for schema-only cases)
func NewPublicationObjSpecName ¶
func NewPublicationObjSpecName(objType PublicationObjSpecType, name string) *PublicationObjSpec
NewPublicationObjSpecName creates a PublicationObjSpec with just a name
func NewPublicationObjSpecTable ¶
func NewPublicationObjSpecTable(objType PublicationObjSpecType, pubTable *PublicationTable) *PublicationObjSpec
NewPublicationObjSpecTable creates a PublicationObjSpec with a PublicationTable
type PublicationObjSpecType ¶
type PublicationObjSpecType int
PublicationObjSpecType represents types of publication objects
const ( PUBLICATIONOBJ_TABLE PublicationObjSpecType = iota PUBLICATIONOBJ_TABLES_IN_SCHEMA PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA PUBLICATIONOBJ_CONTINUATION )
type PublicationTable ¶
type PublicationTable struct {
BaseNode
Relation *RangeVar `json:"relation"` // relation to be published
WhereClause Node `json:"whereclause"` // qualifications
Columns *NodeList `json:"columns"` // List of columns in a publication table
}
PublicationTable represents a publication table specification
func CloneRefOfPublicationTable ¶
func CloneRefOfPublicationTable(n *PublicationTable) *PublicationTable
CloneRefOfPublicationTable creates a deep clone of the input.
func NewPublicationTable ¶
func NewPublicationTable(relation *RangeVar, whereClause Node, columns *NodeList) *PublicationTable
type Query ¶
type Query struct {
BaseNode
CommandType CmdType // select|insert|update|delete|merge|utility - postgres/src/include/nodes/parsenodes.h:120
QuerySource QuerySource // Where did this query come from? - postgres/src/include/nodes/parsenodes.h:121
QueryId uint64 // Query identifier - postgres/src/include/nodes/parsenodes.h:122
CanSetTag bool // Do I set the command result tag? - postgres/src/include/nodes/parsenodes.h:123
UtilityStmt Node // Non-null if commandType == CMD_UTILITY - postgres/src/include/nodes/parsenodes.h:124
ResultRelation int // rtable index of target relation - postgres/src/include/nodes/parsenodes.h:125
// Boolean flags for query characteristics - postgres/src/include/nodes/parsenodes.h:127-140
HasAggs bool // Has aggregates in tlist or havingQual
HasWindowFuncs bool // Has window functions in tlist
HasTargetSRFs bool // Has set-returning functions in tlist
HasSubLinks bool // Has subquery SubLink
HasDistinctOn bool // distinctClause is from DISTINCT ON
HasRecursive bool // WITH RECURSIVE was specified
HasModifyingCTE bool // Has INSERT/UPDATE/DELETE/MERGE in WITH
HasForUpdate bool // FOR [KEY] UPDATE/SHARE was specified
HasRowSecurity bool // Rewriter has applied some RLS policy
IsReturn bool // Is a RETURN statement
// Query components - postgres/src/include/nodes/parsenodes.h:142-192
CteList []*CommonTableExpr // WITH list
Rtable []*RangeTblEntry // Range table entries
RtePermInfos *NodeList // Permission info for rtable entries - parsenodes.h:174
Jointree *FromExpr // Table join tree (FROM and WHERE clauses)
MergeActionList *NodeList // MERGE statement actions - parsenodes.h:178
MergeTargetRelation int // MERGE target relation index - parsenodes.h:186
MergeJoinCondition Node // JOIN condition for MERGE - parsenodes.h:189
TargetList []*TargetEntry // Target list
Override OverridingKind // OVERRIDING clause - parsenodes.h:194
OnConflict *OnConflictExpr // ON CONFLICT expression - parsenodes.h:196
ReturningList []*TargetEntry // Return-values list
GroupClause []*SortGroupClause // GROUP BY clauses
GroupDistinct bool // Is the GROUP BY clause distinct?
GroupingSets *NodeList // GROUPING SETS if present
HavingQual Node // Qualifications applied to groups
WindowClause []*WindowClause // WINDOW clauses
DistinctClause []*SortGroupClause // DISTINCT clauses
SortClause []*SortGroupClause // ORDER BY clauses
LimitOffset Node // Number of result tuples to skip
LimitCount Node // Number of result tuples to return
LimitOption LimitOption // Limit type option - parsenodes.h:215
RowMarks []*RowMarkClause // Row mark clauses
SetOperations Node // Set operation tree - parsenodes.h:219
ConstraintDeps []Oid // Constraint dependencies - parsenodes.h:226
WithCheckOptions *NodeList // WITH CHECK OPTIONS - parsenodes.h:228
StmtLocation int // Start location - postgres/src/include/nodes/parsenodes.h:239
StmtLen int // Length in bytes - postgres/src/include/nodes/parsenodes.h:240
}
Query is the fundamental query structure that all parsed queries transform into. Ported from postgres/src/include/nodes/parsenodes.h:117
func CloneRefOfQuery ¶
CloneRefOfQuery creates a deep clone of the input.
func (*Query) StatementType ¶
type QuerySource ¶
type QuerySource int
QuerySource represents possible sources of a Query - ported from postgres/src/include/nodes/parsenodes.h:34
const ( QSRC_ORIGINAL QuerySource = iota // Original parse tree (explicit query) QSRC_PARSER // Added by parse analysis (now unused) QSRC_INSTEAD_RULE // Added by unconditional INSTEAD rule QSRC_QUAL_INSTEAD_RULE // Added by conditional INSTEAD rule QSRC_NON_INSTEAD_RULE // Added by non-INSTEAD rule )
type RTEKind ¶
type RTEKind int
RTEKind represents the type of a Range Table Entry. Ported from postgres/src/include/nodes/parsenodes.h:1022-1033
const ( RTE_RELATION RTEKind = iota // ordinary relation reference RTE_SUBQUERY // subquery in FROM RTE_JOIN // join RTE_FUNCTION // function in FROM RTE_TABLEFUNC // TableFunc(.., column list) RTE_VALUES // VALUES (<exprlist>), (<exprlist>), ... RTE_CTE // common table expr (WITH list element) RTE_NAMEDTUPLESTORE // tuplestore, e.g. for AFTER triggers RTE_RESULT // RTE represents an empty FROM clause )
type RTEPermissionInfo ¶
type RTEPermissionInfo struct {
BaseNode
Relid Oid // relation OID
Inh bool // separately check inheritance children?
RequiredPerms AclMode // bitmask of required access permissions
CheckAsUser Oid // if valid, check access as this role
SelectedCols []int // columns needing SELECT permission (simplified from Bitmapset)
InsertedCols []int // columns needing INSERT permission (simplified from Bitmapset)
UpdatedCols []int // columns needing UPDATE permission (simplified from Bitmapset)
}
RTEPermissionInfo represents per-relation information for permission checking. Added to the Query node by the parser when adding the corresponding RTE to the query range table. Ported from postgres/src/include/nodes/parsenodes.h:1286-1297
func CloneRefOfRTEPermissionInfo ¶
func CloneRefOfRTEPermissionInfo(n *RTEPermissionInfo) *RTEPermissionInfo
CloneRefOfRTEPermissionInfo creates a deep clone of the input.
func NewRTEPermissionInfo ¶
func NewRTEPermissionInfo(relid Oid, inh bool, requiredPerms AclMode, checkAsUser Oid) *RTEPermissionInfo
NewRTEPermissionInfo creates a new RTEPermissionInfo node.
func (*RTEPermissionInfo) StatementType ¶
func (r *RTEPermissionInfo) StatementType() string
func (*RTEPermissionInfo) String ¶
func (r *RTEPermissionInfo) String() string
type RangeFunction ¶
type RangeFunction struct {
BaseNode
Lateral bool // does it have LATERAL prefix?
Ordinality bool // does it have WITH ORDINALITY suffix?
IsRowsFrom bool // is result of ROWS FROM() syntax?
Functions *NodeList // list of per-function information (each item is a NodeList with function + column definitions)
Alias *Alias // table alias & optional column aliases
ColDefList *NodeList // list of ColumnDef nodes to describe result of function returning RECORD
}
RangeFunction represents a function call appearing in a FROM clause. Supports ROWS FROM() syntax and WITH ORDINALITY. Ported from postgres/src/include/nodes/parsenodes.h:637-647
func CloneRefOfRangeFunction ¶
func CloneRefOfRangeFunction(n *RangeFunction) *RangeFunction
CloneRefOfRangeFunction creates a deep clone of the input.
func NewRangeFunction ¶
func NewRangeFunction(lateral, ordinality, isRowsFrom bool, functions *NodeList, alias *Alias, colDefList *NodeList) *RangeFunction
NewRangeFunction creates a new RangeFunction node.
func (*RangeFunction) SqlString ¶
func (r *RangeFunction) SqlString() string
SqlString returns the SQL representation of the RangeFunction.
func (*RangeFunction) StatementType ¶
func (r *RangeFunction) StatementType() string
func (*RangeFunction) String ¶
func (r *RangeFunction) String() string
type RangeSubselect ¶
type RangeSubselect struct {
BaseNode
Lateral bool // does it have LATERAL prefix?
Subquery Node // the untransformed sub-select clause
Alias *Alias // table alias & optional column aliases
}
RangeSubselect represents a subquery in FROM clause. Ported from postgres/src/include/nodes/parsenodes.h:615-621
func CloneRefOfRangeSubselect ¶
func CloneRefOfRangeSubselect(n *RangeSubselect) *RangeSubselect
CloneRefOfRangeSubselect creates a deep clone of the input.
func NewRangeSubselect ¶
func NewRangeSubselect(lateral bool, subquery Node, alias *Alias) *RangeSubselect
NewRangeSubselect creates a new RangeSubselect node.
func (*RangeSubselect) SqlString ¶
func (r *RangeSubselect) SqlString() string
SqlString returns the SQL representation of the RangeSubselect.
func (*RangeSubselect) StatementType ¶
func (r *RangeSubselect) StatementType() string
func (*RangeSubselect) String ¶
func (r *RangeSubselect) String() string
type RangeTableFunc ¶
type RangeTableFunc struct {
BaseNode
Lateral bool // does it have LATERAL prefix?
DocExpr Node // document expression
RowExpr Node // row generator expression
Namespaces *NodeList // list of namespaces as ResTarget
Columns *NodeList // list of RangeTableFuncCol
Alias *Alias // table alias & optional column aliases
}
RangeTableFunc represents raw form of "table functions" such as XMLTABLE. Note: JSON_TABLE uses JsonTable node, not RangeTableFunc. Ported from postgres/src/include/nodes/parsenodes.h:655-665
func CloneRefOfRangeTableFunc ¶
func CloneRefOfRangeTableFunc(n *RangeTableFunc) *RangeTableFunc
CloneRefOfRangeTableFunc creates a deep clone of the input.
func NewRangeTableFunc ¶
func NewRangeTableFunc(lateral bool, docExpr, rowExpr Node, namespaces, columns *NodeList, alias *Alias, location int) *RangeTableFunc
NewRangeTableFunc creates a new RangeTableFunc node.
func (*RangeTableFunc) SqlString ¶
func (r *RangeTableFunc) SqlString() string
SqlString returns the SQL representation of the RangeTableFunc (XMLTABLE).
func (*RangeTableFunc) StatementType ¶
func (r *RangeTableFunc) StatementType() string
func (*RangeTableFunc) String ¶
func (r *RangeTableFunc) String() string
type RangeTableFuncCol ¶
type RangeTableFuncCol struct {
BaseNode
ColName string // name of generated column
TypeName *TypeName // type of generated column
ForOrdinality bool // does it have FOR ORDINALITY?
IsNotNull bool // does it have NOT NULL?
ColExpr Node // column filter expression
ColDefExpr Node // column default value expression
}
RangeTableFuncCol represents one column in a RangeTableFunc->columns. If ForOrdinality is true (FOR ORDINALITY), then the column is an int4 column and the rest of the fields are ignored. Ported from postgres/src/include/nodes/parsenodes.h:673-683
func CloneRefOfRangeTableFuncCol ¶
func CloneRefOfRangeTableFuncCol(n *RangeTableFuncCol) *RangeTableFuncCol
CloneRefOfRangeTableFuncCol creates a deep clone of the input.
func NewRangeTableFuncCol ¶
func NewRangeTableFuncCol(colName string, typeName *TypeName, forOrdinality, isNotNull bool, colExpr, colDefExpr Node, location int) *RangeTableFuncCol
NewRangeTableFuncCol creates a new RangeTableFuncCol node.
func (*RangeTableFuncCol) SqlString ¶
func (r *RangeTableFuncCol) SqlString() string
SqlString returns the SQL representation of the RangeTableFuncCol.
func (*RangeTableFuncCol) StatementType ¶
func (r *RangeTableFuncCol) StatementType() string
func (*RangeTableFuncCol) String ¶
func (r *RangeTableFuncCol) String() string
type RangeTableSample ¶
type RangeTableSample struct {
BaseNode
Relation Node // relation to be sampled
Method *NodeList // sampling method name (possibly qualified)
Args *NodeList // argument(s) for sampling method
Repeatable Node // REPEATABLE expression, or NULL if none
}
RangeTableSample represents TABLESAMPLE appearing in a raw FROM clause. This node represents: <relation> TABLESAMPLE <method> (<params>) REPEATABLE (<num>) Ported from postgres/src/include/nodes/parsenodes.h:695-703
func CloneRefOfRangeTableSample ¶
func CloneRefOfRangeTableSample(n *RangeTableSample) *RangeTableSample
CloneRefOfRangeTableSample creates a deep clone of the input.
func NewRangeTableSample ¶
func NewRangeTableSample(relation Node, method, args *NodeList, repeatable Node, location int) *RangeTableSample
NewRangeTableSample creates a new RangeTableSample node.
func (*RangeTableSample) SqlString ¶
func (r *RangeTableSample) SqlString() string
SqlString returns the SQL representation of RangeTableSample
func (*RangeTableSample) StatementType ¶
func (r *RangeTableSample) StatementType() string
func (*RangeTableSample) String ¶
func (r *RangeTableSample) String() string
type RangeTblEntry ¶
type RangeTblEntry struct {
BaseNode
// Fields valid in all RTEs
Alias *Alias // user-written alias clause, if any
Eref *Alias // expanded reference names
RteKind RTEKind // see RTEKind enum above
Lateral bool // was LATERAL specified?
InFromCl bool // present in FROM clause?
// Fields valid for a plain relation RTE (RTE_RELATION)
Relid Oid // OID of the relation
Inh bool // inheritance requested?
RelKind byte // relation kind (see pg_class.relkind)
RelLockMode int // lock level that query requires on the rel
PermInfoIndex int // index of RTEPermissionInfo entry, or 0
TableSample *TableSampleClause // sampling info, or NULL
// Fields valid for a subquery RTE (RTE_SUBQUERY)
Subquery *Query // the sub-query
SecurityBarrier bool // is from security_barrier view?
// Fields valid for a join RTE (RTE_JOIN)
JoinType JoinType // type of join
JoinMergedCols int // number of merged (JOIN USING) columns
JoinAliasVars *NodeList // list of alias-var expansions
JoinLeftCols []int // left-side input column numbers
JoinRightCols []int // right-side input column numbers
JoinUsingAlias *Alias // alias clause attached directly to JOIN/USING
// Fields valid for a function RTE (RTE_FUNCTION)
Functions []*RangeTblFunction // list of RangeTblFunction nodes
FuncOrdinality bool // is this called WITH ORDINALITY?
// Fields valid for a TableFunc RTE (RTE_TABLEFUNC)
TableFunc *TableFunc // table function specification
// Fields valid for a values RTE (RTE_VALUES)
ValuesLists []*NodeList // list of expression lists
// Fields valid for a CTE RTE (RTE_CTE)
CteName string // name of the WITH list item
CteLevelsUp Index // number of query levels up
SelfReference bool // is this a recursive self-reference?
// Fields valid for CTE, VALUES, ENR, and TableFunc RTEs
ColTypes []Oid // OID list of column type OIDs
ColTypMods []int // integer list of column typmods
ColCollations []Oid // OID list of column collation OIDs
// Fields valid for ENR RTEs (RTE_NAMEDTUPLESTORE)
EnrName string // name of ephemeral named relation
EnrTuples Cardinality // estimated or actual from caller
// Security-related fields
SecurityQuals *NodeList // security barrier quals to apply, if any
}
RangeTblEntry represents a range table entry which describes a table or subquery in the FROM clause. This is a complex structure that supports multiple types of table sources. Ported from postgres/src/include/nodes/parsenodes.h:1038-1251
func CloneRefOfRangeTblEntry ¶
func CloneRefOfRangeTblEntry(n *RangeTblEntry) *RangeTblEntry
CloneRefOfRangeTblEntry creates a deep clone of the input.
func CloneSliceOfRefOfRangeTblEntry ¶
func CloneSliceOfRefOfRangeTblEntry(n []*RangeTblEntry) []*RangeTblEntry
CloneSliceOfRefOfRangeTblEntry creates a deep clone of the input.
func NewRangeTblEntry ¶
func NewRangeTblEntry(rteKind RTEKind, alias *Alias) *RangeTblEntry
NewRangeTblEntry creates a new RangeTblEntry node.
func (*RangeTblEntry) StatementType ¶
func (r *RangeTblEntry) StatementType() string
func (*RangeTblEntry) String ¶
func (r *RangeTblEntry) String() string
type RangeTblFunction ¶
type RangeTblFunction struct {
BaseNode
FuncExpr Node // expression tree for func call
FuncColCount int // number of columns it contributes to RTE
FuncColNames []string // column names (list of String)
FuncColTypes []Oid // OID list of column type OIDs
FuncColTypMods []int // integer list of column typmods
FuncColCollations []Oid // OID list of column collation OIDs
FuncParams []int // PARAM_EXEC Param IDs affecting this func (set during planning)
}
RangeTblFunction represents RangeTblEntry subsidiary data for one function in a FUNCTION RTE. Used when a function had a column definition list for an otherwise-unspecified RECORD result. Ported from postgres/src/include/nodes/parsenodes.h:1317-1337
func CloneRefOfRangeTblFunction ¶
func CloneRefOfRangeTblFunction(n *RangeTblFunction) *RangeTblFunction
CloneRefOfRangeTblFunction creates a deep clone of the input.
func CloneSliceOfRefOfRangeTblFunction ¶
func CloneSliceOfRefOfRangeTblFunction(n []*RangeTblFunction) []*RangeTblFunction
CloneSliceOfRefOfRangeTblFunction creates a deep clone of the input.
func NewRangeTblFunction ¶
func NewRangeTblFunction(funcExpr Node, funcColCount int) *RangeTblFunction
NewRangeTblFunction creates a new RangeTblFunction node.
func (*RangeTblFunction) StatementType ¶
func (r *RangeTblFunction) StatementType() string
func (*RangeTblFunction) String ¶
func (r *RangeTblFunction) String() string
type RangeTblRef ¶
RangeTblRef represents a range table reference from primnodes.h. This is a simple reference to an entry in the range table by index. Ported from postgres/src/include/nodes/primnodes.h:2243-2247
func CloneRefOfRangeTblRef ¶
func CloneRefOfRangeTblRef(n *RangeTblRef) *RangeTblRef
CloneRefOfRangeTblRef creates a deep clone of the input.
func NewRangeTblRef ¶
func NewRangeTblRef(rtIndex int) *RangeTblRef
NewRangeTblRef creates a new RangeTblRef node.
func (*RangeTblRef) ExpressionType ¶
func (r *RangeTblRef) ExpressionType() string
func (*RangeTblRef) String ¶
func (r *RangeTblRef) String() string
type RangeVar ¶
type RangeVar struct {
BaseNode
CatalogName string // Database name, or empty - postgres/src/include/nodes/primnodes.h:76
SchemaName string // Schema name, or empty - postgres/src/include/nodes/primnodes.h:79
RelName string // Relation/sequence name - postgres/src/include/nodes/primnodes.h:82
Inh bool // Expand relation by inheritance? - postgres/src/include/nodes/primnodes.h:85
RelPersistence rune // Persistence type - postgres/src/include/nodes/primnodes.h:87
Alias *Alias // Table alias & optional column aliases - postgres/src/include/nodes/primnodes.h:90
}
RangeVar represents a table/relation reference. Ported from postgres/src/include/nodes/primnodes.h:71
func CloneRefOfRangeVar ¶
CloneRefOfRangeVar creates a deep clone of the input.
func NewRangeVar ¶
NewRangeVar creates a new RangeVar node.
func (*RangeVar) StatementType ¶
type RawStmt ¶
type RawStmt struct {
BaseNode
Stmt Stmt // The parsed statement tree
StmtLocation int // Start location of stmt in original query string
StmtLen int // Length of stmt in original query string
}
RawStmt represents a raw statement wrapper that contains the original query text and location information before semantic analysis. Ported from postgres/src/include/nodes/parsenodes.h:2017-2024
func CloneRefOfRawStmt ¶
CloneRefOfRawStmt creates a deep clone of the input.
func NewRawStmt ¶
NewRawStmt creates a new RawStmt node.
func (*RawStmt) StatementType ¶
type ReadReplicationSlotCmd ¶
ReadReplicationSlotCmd - READ_REPLICATION_SLOT command. Ported from postgres/src/include/nodes/replnodes.h:106-110
func CloneRefOfReadReplicationSlotCmd ¶
func CloneRefOfReadReplicationSlotCmd(n *ReadReplicationSlotCmd) *ReadReplicationSlotCmd
CloneRefOfReadReplicationSlotCmd creates a deep clone of the input.
func NewReadReplicationSlotCmd ¶
func NewReadReplicationSlotCmd(slot string) *ReadReplicationSlotCmd
func (*ReadReplicationSlotCmd) SqlString ¶
func (n *ReadReplicationSlotCmd) SqlString() string
func (*ReadReplicationSlotCmd) StatementType ¶
func (n *ReadReplicationSlotCmd) StatementType() string
type ReassignOwnedStmt ¶
type ReassignOwnedStmt struct {
BaseNode
Roles *NodeList // list of RoleSpec - postgres/src/include/nodes/parsenodes.h:4087
Newrole *RoleSpec // new owner - postgres/src/include/nodes/parsenodes.h:4088
}
ReassignOwnedStmt represents a REASSIGN OWNED statement. Ported from postgres/src/include/nodes/parsenodes.h:4084
func CloneRefOfReassignOwnedStmt ¶
func CloneRefOfReassignOwnedStmt(n *ReassignOwnedStmt) *ReassignOwnedStmt
CloneRefOfReassignOwnedStmt creates a deep clone of the input.
func NewReassignOwnedStmt ¶
func NewReassignOwnedStmt(roles *NodeList, newrole *RoleSpec) *ReassignOwnedStmt
NewReassignOwnedStmt creates a new ReassignOwnedStmt node.
func (*ReassignOwnedStmt) SqlString ¶
func (r *ReassignOwnedStmt) SqlString() string
SqlString returns the SQL representation of ReassignOwnedStmt
func (*ReassignOwnedStmt) StatementType ¶
func (r *ReassignOwnedStmt) StatementType() string
func (*ReassignOwnedStmt) String ¶
func (r *ReassignOwnedStmt) String() string
type RefreshMatViewStmt ¶
type RefreshMatViewStmt struct {
BaseNode
Concurrent bool // allow concurrent access?
SkipData bool // true for WITH NO DATA
Relation *RangeVar // relation to refresh
}
RefreshMatViewStmt represents a REFRESH MATERIALIZED VIEW statement Ported from postgres/src/include/nodes/parsenodes.h:3617-3622
func CloneRefOfRefreshMatViewStmt ¶
func CloneRefOfRefreshMatViewStmt(n *RefreshMatViewStmt) *RefreshMatViewStmt
CloneRefOfRefreshMatViewStmt creates a deep clone of the input.
func NewRefreshMatViewStmt ¶
func NewRefreshMatViewStmt(concurrent, skipData bool, relation *RangeVar) *RefreshMatViewStmt
NewRefreshMatViewStmt creates a new RefreshMatViewStmt node
func (*RefreshMatViewStmt) Location ¶
func (rmvs *RefreshMatViewStmt) Location() int
Location returns the statement's source location (dummy implementation)
func (*RefreshMatViewStmt) NodeTag ¶
func (rmvs *RefreshMatViewStmt) NodeTag() NodeTag
NodeTag returns the node's type tag
func (*RefreshMatViewStmt) SetLocation ¶
func (rmvs *RefreshMatViewStmt) SetLocation(int)
SetLocation is a no-op; this node does not track source location yet.
func (*RefreshMatViewStmt) SqlString ¶
func (rmvs *RefreshMatViewStmt) SqlString() string
SqlString returns SQL representation of the REFRESH MATERIALIZED VIEW statement
func (*RefreshMatViewStmt) StatementType ¶
func (rmvs *RefreshMatViewStmt) StatementType() string
StatementType returns the statement type for this node
func (*RefreshMatViewStmt) String ¶
func (rmvs *RefreshMatViewStmt) String() string
String returns string representation of RefreshMatViewStmt
type ReindexObjectType ¶
type ReindexObjectType int
ReindexObjectType represents the type of object to reindex. Ported from postgres/src/include/nodes/parsenodes.h:3965-3972
const ( REINDEX_OBJECT_INDEX ReindexObjectType = iota // REINDEX INDEX REINDEX_OBJECT_TABLE // REINDEX TABLE REINDEX_OBJECT_SCHEMA // REINDEX SCHEMA REINDEX_OBJECT_SYSTEM // REINDEX SYSTEM REINDEX_OBJECT_DATABASE // REINDEX DATABASE )
func (ReindexObjectType) String ¶
func (r ReindexObjectType) String() string
type ReindexStmt ¶
type ReindexStmt struct {
BaseNode
Kind ReindexObjectType // Object type to reindex - postgres/src/include/nodes/parsenodes.h:3977
Relation *RangeVar // Table or index to reindex - postgres/src/include/nodes/parsenodes.h:3978
Name string // Name of database to reindex - postgres/src/include/nodes/parsenodes.h:3979
Params *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:3980
}
ReindexStmt represents a REINDEX statement. Ported from postgres/src/include/nodes/parsenodes.h:3974
func CloneRefOfReindexStmt ¶
func CloneRefOfReindexStmt(n *ReindexStmt) *ReindexStmt
CloneRefOfReindexStmt creates a deep clone of the input.
func NewReindexDatabaseStmt ¶
func NewReindexDatabaseStmt(name string) *ReindexStmt
NewReindexDatabaseStmt creates a new REINDEX DATABASE statement.
func NewReindexIndexStmt ¶
func NewReindexIndexStmt(relation *RangeVar) *ReindexStmt
NewReindexIndexStmt creates a new REINDEX INDEX statement.
func NewReindexStmt ¶
func NewReindexStmt(kind ReindexObjectType, relation *RangeVar, name string, params *NodeList) *ReindexStmt
NewReindexStmt creates a new REINDEX statement.
func NewReindexTableStmt ¶
func NewReindexTableStmt(relation *RangeVar) *ReindexStmt
NewReindexTableStmt creates a new REINDEX TABLE statement.
func (*ReindexStmt) SqlString ¶
func (rs *ReindexStmt) SqlString() string
func (*ReindexStmt) StatementType ¶
func (rs *ReindexStmt) StatementType() string
func (*ReindexStmt) String ¶
func (rs *ReindexStmt) String() string
type RelabelType ¶
type RelabelType struct {
BaseExpr
Arg Expression // Input expression - primnodes.h:1184
Resulttype Oid // Output type OID - primnodes.h:1185
Resulttypmod int32 // Output typmod (usually -1) - primnodes.h:1187
Resultcollid Oid // OID of collation, or InvalidOid if none - primnodes.h:1189
Relabelformat CoercionForm // How to display this node - primnodes.h:1191
}
RelabelType represents type casting/relabeling operations. This is the most common type coercion mechanism in PostgreSQL, used when the representation doesn't change but the type label does. Ported from postgres/src/include/nodes/primnodes.h:1181
func CloneRefOfRelabelType ¶
func CloneRefOfRelabelType(n *RelabelType) *RelabelType
CloneRefOfRelabelType creates a deep clone of the input.
func NewExplicitRelabelType ¶
func NewExplicitRelabelType(arg Expression, resulttype Oid) *RelabelType
NewExplicitRelabelType creates a new RelabelType for explicit casts.
func NewImplicitRelabelType ¶
func NewImplicitRelabelType(arg Expression, resulttype Oid) *RelabelType
NewImplicitRelabelType creates a new RelabelType for implicit casts.
func NewRelabelType ¶
func NewRelabelType(arg Expression, resulttype Oid, resulttypmod int32, relabelformat CoercionForm) *RelabelType
NewRelabelType creates a new RelabelType node.
func (*RelabelType) ExpressionType ¶
func (rt *RelabelType) ExpressionType() string
func (*RelabelType) String ¶
func (rt *RelabelType) String() string
type RenameStmt ¶
type RenameStmt struct {
BaseNode
RenameType ObjectType `json:"renameType"` // OBJECT_TABLE, OBJECT_COLUMN, etc
RelationType ObjectType `json:"relationType"` // If column name, associated relation type
Relation *RangeVar `json:"relation"` // In case it's a table
Object Node `json:"object"` // In case it's some other object
Subname string `json:"subname"` // Name of contained object (column, rule, trigger, etc)
Newname string `json:"newname"` // The new name
Behavior DropBehavior `json:"behavior"` // RESTRICT or CASCADE behavior
MissingOk bool `json:"missingOk"` // Skip error if missing?
}
RenameStmt represents ALTER ... RENAME TO statements Ported from postgres/src/include/nodes/parsenodes.h:3525-3537
func CloneRefOfRenameStmt ¶
func CloneRefOfRenameStmt(n *RenameStmt) *RenameStmt
CloneRefOfRenameStmt creates a deep clone of the input.
func NewRenameStmt ¶
func NewRenameStmt(renameType ObjectType, newname string) *RenameStmt
NewRenameStmt creates a new RenameStmt node
func (*RenameStmt) SqlString ¶
func (n *RenameStmt) SqlString() string
func (*RenameStmt) StatementType ¶
func (n *RenameStmt) StatementType() string
func (*RenameStmt) String ¶
func (n *RenameStmt) String() string
type ReplicaIdentityStmt ¶
type ReplicaIdentityStmt struct {
BaseNode
IdentityType rune // replica identity type ('d', 'n', 'f', 'i')
Name string // index name for REPLICA_IDENTITY_INDEX, or empty
}
ReplicaIdentityStmt represents a REPLICA IDENTITY statement. Ported from postgres/src/include/nodes/parsenodes.h
func CloneRefOfReplicaIdentityStmt ¶
func CloneRefOfReplicaIdentityStmt(n *ReplicaIdentityStmt) *ReplicaIdentityStmt
CloneRefOfReplicaIdentityStmt creates a deep clone of the input.
func NewReplicaIdentityStmt ¶
func NewReplicaIdentityStmt(identityType rune, name string) *ReplicaIdentityStmt
NewReplicaIdentityStmt creates a new ReplicaIdentityStmt node.
func (*ReplicaIdentityStmt) SqlString ¶
func (r *ReplicaIdentityStmt) SqlString() string
func (*ReplicaIdentityStmt) StatementType ¶
func (r *ReplicaIdentityStmt) StatementType() string
func (*ReplicaIdentityStmt) String ¶
func (r *ReplicaIdentityStmt) String() string
type ReplicationKind ¶
type ReplicationKind int
ReplicationKind - ported from postgres/src/include/nodes/replnodes.h:20-24
const ( ReplicationKindPhysical ReplicationKind = iota // replnodes.h:22 ReplicationKindLogical // replnodes.h:23 )
type ResTarget ¶
type ResTarget struct {
BaseNode
Name string // Column name or empty - postgres/src/include/nodes/parsenodes.h:518
Indirection *NodeList // Subscripts, field names, and '*', or nil - postgres/src/include/nodes/parsenodes.h:519
Val Node // Value expression to compute or assign - postgres/src/include/nodes/parsenodes.h:520
}
ResTarget represents a target item in a SELECT list or UPDATE SET clause. Ported from postgres/src/include/nodes/parsenodes.h:514
func CloneRefOfResTarget ¶
CloneRefOfResTarget creates a deep clone of the input.
func CloneSliceOfRefOfResTarget ¶
CloneSliceOfRefOfResTarget creates a deep clone of the input.
func NewResTarget ¶
NewResTarget creates a new ResTarget node.
func NewResTargetWithIndirection ¶
NewResTargetWithIndirection creates a new ResTarget node with indirection (for column references with array subscripts).
func (*ResTarget) ColumnNameWithIndirection ¶
ColumnNameWithIndirection returns the column name with indirection (array subscripts, field access, etc.) This is used for INSERT column lists where we need "column[index]" format
func (*ResTarget) ExpressionType ¶
func (*ResTarget) SetClauseString ¶
SetClauseString returns the SQL representation for SET clauses (UPDATE, ON CONFLICT DO UPDATE) Format: "column[index] = value" instead of "value AS column"
type ReturnStmt ¶
ReturnStmt represents a RETURN statement in stored procedures/functions Ported from postgres/src/include/nodes/parsenodes.h:2210-2214
func CloneRefOfReturnStmt ¶
func CloneRefOfReturnStmt(n *ReturnStmt) *ReturnStmt
CloneRefOfReturnStmt creates a deep clone of the input.
func NewReturnStmt ¶
func NewReturnStmt(returnVal Node) *ReturnStmt
NewReturnStmt creates a new ReturnStmt node
func (*ReturnStmt) SqlString ¶
func (n *ReturnStmt) SqlString() string
SqlString returns the SQL representation of ReturnStmt
func (*ReturnStmt) StatementType ¶
func (n *ReturnStmt) StatementType() string
StatementType returns the statement type for this node
func (*ReturnStmt) String ¶
func (n *ReturnStmt) String() string
type RoleSpec ¶
type RoleSpec struct {
BaseNode
Roletype RoleSpecType // Type of this rolespec - postgres/src/include/nodes/parsenodes.h:403
Rolename string // filled only for ROLESPEC_CSTRING - postgres/src/include/nodes/parsenodes.h:404
}
RoleSpec represents a role specification. Ported from postgres/src/include/nodes/parsenodes.h:401
func CloneRefOfRoleSpec ¶
CloneRefOfRoleSpec creates a deep clone of the input.
func NewRoleSpec ¶
func NewRoleSpec(roletype RoleSpecType, rolename string) *RoleSpec
NewRoleSpec creates a new RoleSpec node.
type RoleSpecType ¶
type RoleSpecType int
RoleSpecType represents types of role specifications - ported from postgres/src/include/nodes/parsenodes.h:383-389
const ( ROLESPEC_CSTRING RoleSpecType = iota // role name is stored as a C string ROLESPEC_CURRENT_ROLE // role spec is CURRENT_ROLE ROLESPEC_CURRENT_USER // role spec is CURRENT_USER ROLESPEC_SESSION_USER // role spec is SESSION_USER ROLESPEC_PUBLIC // role name is "public" )
func (RoleSpecType) String ¶
func (r RoleSpecType) String() string
type RoleStatementType ¶
type RoleStatementType int
RoleStatementType represents the type of role statement. Ported from postgres/src/include/nodes/parsenodes.h:3074-3079
const ( ROLESTMT_ROLE RoleStatementType = iota // CREATE/ALTER/DROP ROLE ROLESTMT_USER // CREATE/ALTER/DROP USER ROLESTMT_GROUP // CREATE/ALTER/DROP GROUP )
func (RoleStatementType) String ¶
func (r RoleStatementType) String() string
type RootNode ¶
type RootNode struct {
Node
}
RootNode is the root node of the AST when rewriting. It is the first element of the tree.
func CloneRefOfRootNode ¶
CloneRefOfRootNode creates a deep clone of the input.
func CloneRootNode ¶
CloneRootNode creates a deep clone of the input.
type RowCompareExpr ¶
type RowCompareExpr struct {
BaseExpr
Rctype RowCompareType // LT LE GE or GT, never EQ or NE
Opnos []Oid // OID list of pairwise comparison ops
Opfamilies []Oid // OID list of containing operator families
InputCollids []Oid // OID list of collations for comparisons
Largs []Expression // The left-hand input arguments
Rargs []Expression // The right-hand input arguments
}
RowCompareExpr represents a row comparison expression Ported from postgres/src/include/nodes/primnodes.h:1463-1474
func CloneRefOfRowCompareExpr ¶
func CloneRefOfRowCompareExpr(n *RowCompareExpr) *RowCompareExpr
CloneRefOfRowCompareExpr creates a deep clone of the input.
func NewRowCompareExpr ¶
func NewRowCompareExpr(rctype RowCompareType, opnos, opfamilies, inputCollids []Oid, largs, rargs []Expression, location int) *RowCompareExpr
NewRowCompareExpr creates a new RowCompareExpr node.
func (*RowCompareExpr) ExpressionType ¶
func (r *RowCompareExpr) ExpressionType() string
func (*RowCompareExpr) String ¶
func (r *RowCompareExpr) String() string
type RowCompareType ¶
type RowCompareType int
RowCompareType represents row comparison types Ported from postgres/src/include/nodes/primnodes.h:1445-1452
const ( ROWCOMPARE_LT RowCompareType = 1 // BTLessStrategyNumber ROWCOMPARE_LE RowCompareType = 2 // BTLessEqualStrategyNumber ROWCOMPARE_EQ RowCompareType = 3 // BTEqualStrategyNumber ROWCOMPARE_GE RowCompareType = 4 // BTGreaterEqualStrategyNumber ROWCOMPARE_GT RowCompareType = 5 // BTGreaterStrategyNumber ROWCOMPARE_NE RowCompareType = 6 // no such btree strategy )
type RowExpr ¶
type RowExpr struct {
BaseExpr
Args *NodeList // Row field expressions - postgres/src/include/nodes/primnodes.h:1411
RowTypeid Oid // Composite type OID - postgres/src/include/nodes/primnodes.h:1412
RowFormat CoercionForm // Display format - postgres/src/include/nodes/primnodes.h:1413
Colnames *NodeList // Field names (RECORD type only) - postgres/src/include/nodes/primnodes.h:1414
}
RowExpr represents a ROW() constructor expression. Ported from postgres/src/include/nodes/primnodes.h:1408
func CloneRefOfRowExpr ¶
CloneRefOfRowExpr creates a deep clone of the input.
func NewRowConstructor ¶
NewRowConstructor creates a ROW(...) constructor.
func NewRowExpr ¶
NewRowExpr creates a new RowExpr node.
func (*RowExpr) ExpressionType ¶
type RowMarkClause ¶
type RowMarkClause struct {
BaseNode
Rti Index // Range table index of target relation - parsenodes.h:1579
Strength LockClauseStrength // Lock clause strength - parsenodes.h:1580
WaitPolicy LockWaitPolicy // NOWAIT and SKIP LOCKED - parsenodes.h:1581
PushedDown bool // Pushed down from higher query level? - parsenodes.h:1582
}
RowMarkClause represents FOR UPDATE/SHARE clauses. This supports row-level locking which is essential for concurrency control. Ported from postgres/src/include/nodes/parsenodes.h:1576
func CloneRefOfRowMarkClause ¶
func CloneRefOfRowMarkClause(n *RowMarkClause) *RowMarkClause
CloneRefOfRowMarkClause creates a deep clone of the input.
func CloneSliceOfRefOfRowMarkClause ¶
func CloneSliceOfRefOfRowMarkClause(n []*RowMarkClause) []*RowMarkClause
CloneSliceOfRefOfRowMarkClause creates a deep clone of the input.
func NewRowMarkClause ¶
func NewRowMarkClause(rti Index, strength LockClauseStrength) *RowMarkClause
NewRowMarkClause creates a new RowMarkClause node.
func NewRowMarkClauseWithPolicy ¶
func NewRowMarkClauseWithPolicy(rti Index, strength LockClauseStrength, waitPolicy LockWaitPolicy) *RowMarkClause
NewRowMarkClauseWithPolicy creates a new RowMarkClause with wait policy.
func (*RowMarkClause) String ¶
func (rmc *RowMarkClause) String() string
type RowMarkType ¶
type RowMarkType int
RowMarkType represents the type of row marking for SELECT FOR UPDATE/SHARE. Ported from postgres/src/include/nodes/plannodes.h:1327
const ( ROW_MARK_EXCLUSIVE RowMarkType = iota // FOR UPDATE - plannodes.h:1329 ROW_MARK_NOKEYEXCLUSIVE // FOR NO KEY UPDATE - plannodes.h:1330 ROW_MARK_SHARE // FOR SHARE - plannodes.h:1331 ROW_MARK_KEYSHARE // FOR KEY SHARE - plannodes.h:1332 ROW_MARK_REFERENCE // FOR REFERENCE (MySQL compat) - plannodes.h:1333 ROW_MARK_COPY // FOR COPY (internal) - plannodes.h:1334 )
type RuleStmt ¶
type RuleStmt struct {
BaseNode
Relation *RangeVar `json:"relation"` // Relation the rule is for
Rulename string `json:"rulename"` // Name of the rule
WhereClause Node `json:"whereClause"` // Qualifications
Event CmdType `json:"event"` // SELECT, INSERT, etc
Instead bool `json:"instead"` // Is a 'do instead'?
Actions *NodeList `json:"actions"` // The action statements
Replace bool `json:"replace"` // OR REPLACE
}
RuleStmt represents CREATE RULE statements Ported from postgres/src/include/nodes/parsenodes.h:3606-3616
func CloneRefOfRuleStmt ¶
CloneRefOfRuleStmt creates a deep clone of the input.
func NewRuleStmt ¶
NewRuleStmt creates a new RuleStmt node
func (*RuleStmt) StatementType ¶
type SQLValueFunction ¶
type SQLValueFunction struct {
BaseExpr
Op SQLValueFunctionOp // Which function this is
Type Oid // Result type
TypeMod int // Result typmod
}
SQLValueFunction represents parameterless functions with special grammar Ported from postgres/src/include/nodes/primnodes.h:1553-1563
func CloneRefOfSQLValueFunction ¶
func CloneRefOfSQLValueFunction(n *SQLValueFunction) *SQLValueFunction
CloneRefOfSQLValueFunction creates a deep clone of the input.
func NewSQLValueFunction ¶
func NewSQLValueFunction(op SQLValueFunctionOp, typ Oid, typeMod, location int) *SQLValueFunction
NewSQLValueFunction creates a new SQLValueFunction node.
func (*SQLValueFunction) ExpressionType ¶
func (s *SQLValueFunction) ExpressionType() string
func (*SQLValueFunction) SqlString ¶
func (s *SQLValueFunction) SqlString() string
SqlString returns the SQL representation of SQLValueFunction
func (*SQLValueFunction) String ¶
func (s *SQLValueFunction) String() string
type SQLValueFunctionOp ¶
type SQLValueFunctionOp int
SQLValueFunctionOp represents SQL value function operation types Ported from postgres/src/include/nodes/primnodes.h:1522-1541
const ( SVFOP_CURRENT_DATE SQLValueFunctionOp = iota SVFOP_CURRENT_TIME SVFOP_CURRENT_TIME_N SVFOP_CURRENT_TIMESTAMP SVFOP_CURRENT_TIMESTAMP_N SVFOP_LOCALTIME SVFOP_LOCALTIME_N SVFOP_LOCALTIMESTAMP SVFOP_LOCALTIMESTAMP_N SVFOP_CURRENT_ROLE SVFOP_CURRENT_USER SVFOP_USER SVFOP_SESSION_USER SVFOP_CURRENT_CATALOG SVFOP_CURRENT_SCHEMA )
type ScalarArrayOpExpr ¶
type ScalarArrayOpExpr struct {
BaseExpr
Opno Oid // pg_operator OID - postgres/src/include/nodes/primnodes.h:896
Opfuncid Oid // Comparison function OID - postgres/src/include/nodes/primnodes.h:897
Hashfuncid Oid // Hash function OID (optimization) - postgres/src/include/nodes/primnodes.h:898
Negfuncid Oid // Negation function OID - postgres/src/include/nodes/primnodes.h:899
UseOr bool // True for ANY, false for ALL - postgres/src/include/nodes/primnodes.h:900
Inputcollid Oid // Input collation - postgres/src/include/nodes/primnodes.h:901
Args *NodeList // Scalar and array operands - postgres/src/include/nodes/primnodes.h:902
}
ScalarArrayOpExpr represents a scalar op ANY/ALL (array) expression. Ported from postgres/src/include/nodes/primnodes.h:893
func CloneRefOfScalarArrayOpExpr ¶
func CloneRefOfScalarArrayOpExpr(n *ScalarArrayOpExpr) *ScalarArrayOpExpr
CloneRefOfScalarArrayOpExpr creates a deep clone of the input.
func NewAllExpr ¶
func NewAllExpr(opno Oid, scalar Node, array Node) *ScalarArrayOpExpr
NewAllExpr creates a scalar = ALL(array) expression.
func NewAnyExpr ¶
func NewAnyExpr(opno Oid, scalar Node, array Node) *ScalarArrayOpExpr
NewAnyExpr creates a scalar = ANY(array) expression.
func NewInExpr ¶
func NewInExpr(scalar Node, array Node) *ScalarArrayOpExpr
NewInExpr creates a scalar IN (array) expression using = ANY.
func NewNotInExpr ¶
func NewNotInExpr(scalar Node, array Node) *ScalarArrayOpExpr
NewNotInExpr creates a scalar NOT IN (array) expression using <> ALL.
func NewScalarArrayOpExpr ¶
func NewScalarArrayOpExpr(opno Oid, useOr bool, scalar Node, array Node) *ScalarArrayOpExpr
NewScalarArrayOpExpr creates a new ScalarArrayOpExpr node.
func (*ScalarArrayOpExpr) ExpressionType ¶
func (s *ScalarArrayOpExpr) ExpressionType() string
func (*ScalarArrayOpExpr) String ¶
func (s *ScalarArrayOpExpr) String() string
type SecLabelStmt ¶
type SecLabelStmt struct {
BaseNode
Objtype ObjectType `json:"objtype"` // Object's type
Object Node `json:"object"` // Qualified name of the object
Provider string `json:"provider"` // Label provider (or NULL)
Label string `json:"label"` // New security label to be assigned
}
SecLabelStmt represents SECURITY LABEL statements Ported from postgres/src/include/nodes/parsenodes.h:3267-3274
func CloneRefOfSecLabelStmt ¶
func CloneRefOfSecLabelStmt(n *SecLabelStmt) *SecLabelStmt
CloneRefOfSecLabelStmt creates a deep clone of the input.
func NewSecLabelStmt ¶
func NewSecLabelStmt(objtype ObjectType, object Node, provider string, label string) *SecLabelStmt
NewSecLabelStmt creates a new SecLabelStmt node
func (*SecLabelStmt) SqlString ¶
func (n *SecLabelStmt) SqlString() string
func (*SecLabelStmt) StatementType ¶
func (n *SecLabelStmt) StatementType() string
func (*SecLabelStmt) String ¶
func (n *SecLabelStmt) String() string
type SelectStmt ¶
type SelectStmt struct {
BaseNode
// Fields used in "leaf" SelectStmts - postgres/src/include/nodes/parsenodes.h:2120-2130
DistinctClause *NodeList // NULL, list of DISTINCT ON exprs, or special marker for ALL
IntoClause *IntoClause // Target for SELECT INTO
TargetList *NodeList // Target list
FromClause *NodeList // FROM clause
WhereClause Node // WHERE qualification
GroupClause *NodeList // GROUP BY clauses
GroupDistinct bool // Is this GROUP BY DISTINCT?
HavingClause Node // HAVING conditional-expression
WindowClause *NodeList // WINDOW window_name AS (...), ...
ValuesLists *NodeList // Untransformed list of expression lists
// Fields used in both "leaf" and upper-level SelectStmts - postgres/src/include/nodes/parsenodes.h:2132-2137
SortClause *NodeList // Sort clause
LimitOffset Node // Number of result tuples to skip
LimitCount Node // Number of result tuples to return
LimitOption LimitOption // Limit type option
LockingClause *NodeList // FOR UPDATE clauses
WithClause *WithClause // WITH clause
// Fields used only in upper-level SelectStmts - postgres/src/include/nodes/parsenodes.h:2139-2143
Op SetOperation // Type of set operation
All bool // ALL specified?
Larg *SelectStmt // Left child
Rarg *SelectStmt // Right child
}
SelectStmt represents a raw SELECT statement before analysis. Ported from postgres/src/include/nodes/parsenodes.h:2116
func CloneRefOfSelectStmt ¶
func CloneRefOfSelectStmt(n *SelectStmt) *SelectStmt
CloneRefOfSelectStmt creates a deep clone of the input.
func (*SelectStmt) LeafIntoClause ¶
func (s *SelectStmt) LeafIntoClause() *IntoClause
LeafIntoClause returns the statement's SELECT INTO target, drilling to the leftmost leaf of a set operation. The grammar attaches INTO to the leaf SELECT, never the set-op node (`SELECT 1 INTO t UNION SELECT 2` carries the IntoClause on Larg), mirroring PostgreSQL's transformOptionalSelectInto which performs the same leftmost walk. Returns nil when no INTO is present.
func (*SelectStmt) SqlString ¶
func (s *SelectStmt) SqlString() string
SqlString returns the SQL representation of the SelectStmt
func (*SelectStmt) StatementType ¶
func (s *SelectStmt) StatementType() string
func (*SelectStmt) String ¶
func (s *SelectStmt) String() string
type SetOperation ¶
type SetOperation int
Placeholder structs for other query execution nodes implemented in query_execution_nodes.go IntoClause placeholder removed - now implemented in expressions.go SetOperation represents the type of set operation Ported from postgres/src/include/nodes/parsenodes.h:2108-2114
const ( SETOP_NONE SetOperation = iota // No set operation SETOP_UNION // UNION SETOP_INTERSECT // INTERSECT SETOP_EXCEPT // EXCEPT )
func (SetOperation) String ¶
func (s SetOperation) String() string
type SetOperationStmt ¶
type SetOperationStmt struct {
BaseNode
Op SetOperation `json:"op"` // Type of set operation
All bool `json:"all"` // ALL specified?
Larg Node `json:"larg"` // Left child
Rarg Node `json:"rarg"` // Right child
ColTypes []Oid `json:"colTypes"` // OID list of output column type OIDs
ColTypmods []int32 `json:"colTypmods"` // Integer list of output column typmods
ColCollations []Oid `json:"colCollations"` // OID list of output column collation OIDs
GroupClauses []*SortGroupClause `json:"groupClauses"` // List of SortGroupClauses
}
SetOperationStmt represents set operations like UNION, INTERSECT, EXCEPT Ported from postgres/src/include/nodes/parsenodes.h:2185-2204
func CloneRefOfSetOperationStmt ¶
func CloneRefOfSetOperationStmt(n *SetOperationStmt) *SetOperationStmt
CloneRefOfSetOperationStmt creates a deep clone of the input.
func NewSetOperationStmt ¶
func NewSetOperationStmt(op SetOperation, all bool, larg Node, rarg Node) *SetOperationStmt
NewSetOperationStmt creates a new SetOperationStmt node
func (*SetOperationStmt) String ¶
func (n *SetOperationStmt) String() string
type SetQuantifier ¶
type SetQuantifier int
SetQuantifier represents set quantifier options for GROUP BY and SELECT DISTINCT. Ported from postgres/src/include/nodes/parsenodes.h:61
const ( SET_QUANTIFIER_DEFAULT SetQuantifier = iota // No quantifier specified SET_QUANTIFIER_ALL // ALL quantifier SET_QUANTIFIER_DISTINCT // DISTINCT quantifier )
type SetToDefault ¶
type SetToDefault struct {
BaseExpr
TypeId Oid // Type for substituted value - primnodes.h:2071
TypeMod int32 // Typemod for substituted value - primnodes.h:2072
Collation Oid // Collation for the substituted value - primnodes.h:2073
}
SetToDefault represents a DEFAULT expression. This is used in INSERT and UPDATE statements to indicate use of the default value. Ported from postgres/src/include/nodes/primnodes.h:2068
func CloneRefOfSetToDefault ¶
func CloneRefOfSetToDefault(n *SetToDefault) *SetToDefault
CloneRefOfSetToDefault creates a deep clone of the input.
func NewSetToDefault ¶
func NewSetToDefault(typeId Oid, typeMod int32, collation Oid) *SetToDefault
NewSetToDefault creates a new SetToDefault node.
func (*SetToDefault) ExpressionType ¶
func (std *SetToDefault) ExpressionType() string
func (*SetToDefault) SqlString ¶
func (std *SetToDefault) SqlString() string
SqlString returns the SQL representation of SetToDefault
func (*SetToDefault) String ¶
func (std *SetToDefault) String() string
type ShowConnectionsStmt ¶
ShowConnectionsStmt represents `SHOW CONNECTIONS` or `SHOW CONNECTION name`.
func CloneRefOfShowConnectionsStmt ¶
func CloneRefOfShowConnectionsStmt(n *ShowConnectionsStmt) *ShowConnectionsStmt
CloneRefOfShowConnectionsStmt creates a deep clone of the input.
func NewShowConnectionsStmt ¶
func NewShowConnectionsStmt(name string) *ShowConnectionsStmt
func (*ShowConnectionsStmt) SqlString ¶
func (n *ShowConnectionsStmt) SqlString() string
func (*ShowConnectionsStmt) StatementType ¶
func (n *ShowConnectionsStmt) StatementType() string
func (*ShowConnectionsStmt) String ¶
func (n *ShowConnectionsStmt) String() string
type SinglePartitionSpec ¶
type SinglePartitionSpec struct {
BaseNode
}
SinglePartitionSpec represents a single partition specification. Ported from postgres/src/include/nodes/parsenodes.h:945-952
func CloneRefOfSinglePartitionSpec ¶
func CloneRefOfSinglePartitionSpec(n *SinglePartitionSpec) *SinglePartitionSpec
CloneRefOfSinglePartitionSpec creates a deep clone of the input.
func NewSinglePartitionSpec ¶
func NewSinglePartitionSpec(location int) *SinglePartitionSpec
NewSinglePartitionSpec creates a new SinglePartitionSpec node.
func (*SinglePartitionSpec) StatementType ¶
func (s *SinglePartitionSpec) StatementType() string
func (*SinglePartitionSpec) String ¶
func (s *SinglePartitionSpec) String() string
type SortBy ¶
type SortBy struct {
BaseNode
Node Node // Expression to sort on
SortbyDir SortByDir // ASC/DESC/USING/DEFAULT
SortbyNulls SortByNulls // NULLS FIRST/LAST
UseOp *NodeList // Name of operator to use for comparison
}
SortBy represents a sort specification in ORDER BY clauses. Ported from postgres/src/include/nodes/parsenodes.h:543-560
func CloneRefOfSortBy ¶
CloneRefOfSortBy creates a deep clone of the input.
func NewSortBy ¶
func NewSortBy(node Node, dir SortByDir, nulls SortByNulls, location int) *SortBy
NewSortBy creates a new complete SortBy node.
func (*SortBy) StatementType ¶
type SortByDir ¶
type SortByDir int
SortByDir represents sort direction - ported from postgres/src/include/nodes/parsenodes.h:57-62
type SortByNulls ¶
type SortByNulls int
SortByNulls represents null ordering - ported from postgres/src/include/nodes/parsenodes.h:64-69
const ( SORTBY_NULLS_DEFAULT SortByNulls = iota SORTBY_NULLS_FIRST SORTBY_NULLS_LAST )
func (SortByNulls) String ¶
func (s SortByNulls) String() string
type SortGroupClause ¶
type SortGroupClause struct {
BaseNode
TleSortGroupRef Index // Reference into targetlist - parsenodes.h:1439
Eqop Oid // The equality operator ('=' op) - parsenodes.h:1440
Sortop Oid // The ordering operator ('<' op), or InvalidOid - parsenodes.h:1441
NullsFirst bool // Do NULLs come before normal values? - parsenodes.h:1442
Hashable bool // Can eqop be implemented by hashing? - parsenodes.h:1444
}
SortGroupClause represents ORDER BY and GROUP BY clauses. This structure is used for both ORDER BY and GROUP BY operations and is fundamental to SQL query processing. Ported from postgres/src/include/nodes/parsenodes.h:1436
func CloneRefOfSortGroupClause ¶
func CloneRefOfSortGroupClause(n *SortGroupClause) *SortGroupClause
CloneRefOfSortGroupClause creates a deep clone of the input.
func CloneSliceOfRefOfSortGroupClause ¶
func CloneSliceOfRefOfSortGroupClause(n []*SortGroupClause) []*SortGroupClause
CloneSliceOfRefOfSortGroupClause creates a deep clone of the input.
func NewSortGroupClause ¶
func NewSortGroupClause(tleSortGroupRef Index, eqop, sortop Oid) *SortGroupClause
NewSortGroupClause creates a new SortGroupClause node.
func NewSortGroupClauseNullsFirst ¶
func NewSortGroupClauseNullsFirst(tleSortGroupRef Index, eqop, sortop Oid) *SortGroupClause
NewSortGroupClauseNullsFirst creates a new SortGroupClause with NULLS FIRST.
func (*SortGroupClause) String ¶
func (sgc *SortGroupClause) String() string
type StartReplicationCmd ¶
type StartReplicationCmd struct {
BaseNode
Kind ReplicationKind // replnodes.h:94
SlotName string // replnodes.h:95
Timeline TimeLineID // replnodes.h:96
StartPoint XLogRecPtr // replnodes.h:97
Options []*DefElem // replnodes.h:98
}
StartReplicationCmd - START_REPLICATION command. Ported from postgres/src/include/nodes/replnodes.h:91-99
func CloneRefOfStartReplicationCmd ¶
func CloneRefOfStartReplicationCmd(n *StartReplicationCmd) *StartReplicationCmd
CloneRefOfStartReplicationCmd creates a deep clone of the input.
func NewStartReplicationCmd ¶
func NewStartReplicationCmd(kind ReplicationKind, slot string, timeline TimeLineID, start XLogRecPtr, options []*DefElem) *StartReplicationCmd
func (*StartReplicationCmd) SqlString ¶
func (n *StartReplicationCmd) SqlString() string
func (*StartReplicationCmd) StatementType ¶
func (n *StartReplicationCmd) StatementType() string
type StatsElem ¶
type StatsElem struct {
BaseNode
Name string // Name of attribute to compute stats for - parsenodes.h:3405
Expr Node // Or expression to compute stats for - parsenodes.h:3406
}
StatsElem represents statistics element specifications. This is used for extended statistics in PostgreSQL. Ported from postgres/src/include/nodes/parsenodes.h:3403
func CloneRefOfStatsElem ¶
CloneRefOfStatsElem creates a deep clone of the input.
func NewStatsElem ¶
NewStatsElem creates a new StatsElem node.
func NewStatsElemExpr ¶
NewStatsElemExpr creates a new StatsElem with expression.
type Stmt ¶
Stmt represents the base interface for all SQL statements. All top-level SQL constructs implement this interface. Ported from postgres statement node concept
func SubstituteParameters ¶
func SubstituteParameters(stmt Stmt, params [][]byte, paramFormats []int16, paramTypes []uint32) (Stmt, error)
SubstituteParameters walks through the AST and replaces all ParamRef nodes with A_Const nodes containing the actual parameter values. This function creates a modified copy of the AST with parameters substituted.
Parameters:
- stmt: The AST statement to process
- params: The parameter values as byte arrays (nil for NULL)
- paramFormats: Format codes for each parameter (0=text, 1=binary)
- paramTypes: PostgreSQL type OIDs for each parameter
Returns the modified statement with parameters substituted, or an error if parameter parsing fails.
type String ¶
String represents a string literal value node. Ported from postgres/src/include/nodes/value.h:63-69
func CloneRefOfString ¶
CloneRefOfString creates a deep clone of the input.
func NewString ¶
NewString creates a new string literal node. Ported from postgres/src/include/nodes/value.h:87 (makeString)
func (*String) ExpressionType ¶
type SubLink ¶
type SubLink struct {
BaseExpr
SubLinkType SubLinkType // Type of sublink - postgres/src/include/nodes/primnodes.h:1575
SubLinkId int // ID (1..n); 0 if not MULTIEXPR - postgres/src/include/nodes/primnodes.h:1576
Testexpr Node // Outer-query test for ALL/ANY/ROWCOMPARE - postgres/src/include/nodes/primnodes.h:1577
OperName *NodeList // Originally specified operator name - postgres/src/include/nodes/primnodes.h:1579
Subselect Node // Subselect as Query* or raw parsetree - postgres/src/include/nodes/primnodes.h:1581
}
SubLink represents a sublink expression (subquery). Ported from postgres/src/include/nodes/primnodes.h:1008
func CloneRefOfSubLink ¶
CloneRefOfSubLink creates a deep clone of the input.
func NewArraySublink ¶
NewArraySublink creates an ARRAY(subquery) expression.
func NewExistsSublink ¶
NewExistsSublink creates an EXISTS(subquery) expression.
func NewExprSublink ¶
NewExprSublink creates a scalar subquery expression.
func NewInSublink ¶
NewInSublink creates an expr IN (subquery) expression.
func NewNotInSublink ¶
NewNotInSublink creates an expr NOT IN (subquery) expression.
func NewSubLink ¶
func NewSubLink(subLinkType SubLinkType, subselect Node) *SubLink
NewSubLink creates a new SubLink node.
func (*SubLink) ExpressionType ¶
type SubLinkType ¶
type SubLinkType int
SubLinkType represents types of sublinks - ported from postgres/src/include/nodes/primnodes.h:1556-1565
const ( EXISTS_SUBLINK SubLinkType = iota // EXISTS(subquery) ALL_SUBLINK // expr op ALL(subquery) ANY_SUBLINK // expr op ANY(subquery) ROWCOMPARE_SUBLINK // (expr list) op (subquery) EXPR_SUBLINK // expr(subquery) MULTIEXPR_SUBLINK // multiple expressions ARRAY_SUBLINK // ARRAY(subquery) CTE_SUBLINK // for SubPlans only )
func GetSubLinkType ¶
func GetSubLinkType(expr Node) SubLinkType
GetSubLinkType returns the type of a SubLink.
func (SubLinkType) String ¶
func (s SubLinkType) String() string
type SubPlan ¶
type SubPlan struct {
BaseExpr
SubLinkType SubLinkType // Type of sublink - primnodes.h:1065
Testexpr Expression // OpExpr or RowCompareExpr expression tree - primnodes.h:1067
ParamIds []int // IDs of Params embedded in the above - primnodes.h:1068
PlanId int // Index (from 1) in PlannedStmt.subplans - primnodes.h:1070
PlanName string // A name assigned during planning - primnodes.h:1072
FirstColType Oid // Type of first column of subplan result - primnodes.h:1074
FirstColTypmod int32 // Typmod of first column of subplan result - primnodes.h:1075
FirstColCollation Oid // Collation of first column of subplan result - primnodes.h:1076
UseHashTable bool // Use hashtable if TRUE, otherwise nested-loop - primnodes.h:1079
UnknownEqFalse bool // True if the comparison can never return NULL - primnodes.h:1081
ParallelSafe bool // Is subplan parallel-safe? - primnodes.h:1084
SetParam []int // initplan subqueries have to set these Params for parent plan - primnodes.h:1087
ParParam []int // indices of input Params from parent plan - primnodes.h:1088
Args []Expression // exprs to pass as parParam values - primnodes.h:1089
StartupCost float64 // one-time setup cost - primnodes.h:1090
PerCallCost float64 // cost for each subplan evaluation - primnodes.h:1091
}
SubPlan represents the execution-level representation of a subquery. This is the internal representation used during query execution, after the SubLink has been processed by the planner. Ported from postgres/src/include/nodes/primnodes.h:1059
func CloneRefOfSubPlan ¶
CloneRefOfSubPlan creates a deep clone of the input.
func NewSubPlan ¶
func NewSubPlan(subLinkType SubLinkType, planId int, planName string) *SubPlan
NewSubPlan creates a new SubPlan node.
func (*SubPlan) ExpressionType ¶
type SubscriptingRef ¶
type SubscriptingRef struct {
BaseExpr
Refcontainertype Oid // Type OID of container (array or jsonb) - primnodes.h:682
Refelemtype Oid // The container type's pg_type.typelem - primnodes.h:683
Refrestype Oid // Type OID of the SubscriptingRef's result - primnodes.h:684
Reftypmod int32 // Typmod of the result - primnodes.h:685
Refcollid Oid // Collation of result, or InvalidOid if none - primnodes.h:686
Refupperindexpr []Expression // Expressions for upper index bounds - primnodes.h:687
Reflowerindexpr []Expression // Expressions for lower index bounds - primnodes.h:688
Refexpr Expression // Expression for the container value - primnodes.h:689
Refassgnexpr Expression // Expression for new value in assignment - primnodes.h:690
}
SubscriptingRef represents array/JSON subscripting operations. This handles both array indexing (arr[1]) and JSON key access (json['key']). Ported from postgres/src/include/nodes/primnodes.h:679
func CloneRefOfSubscriptingRef ¶
func CloneRefOfSubscriptingRef(n *SubscriptingRef) *SubscriptingRef
CloneRefOfSubscriptingRef creates a deep clone of the input.
func NewArrayAssignment ¶
func NewArrayAssignment(arraytype, elemtype Oid, arrayexpr, indexexpr, assignexpr Expression) *SubscriptingRef
NewArrayAssignment creates a SubscriptingRef for array assignment (arr[index] = value).
func NewArraySlice ¶
func NewArraySlice(arraytype, elemtype Oid, arrayexpr, lowerexpr, upperexpr Expression) *SubscriptingRef
NewArraySlice creates a SubscriptingRef for array slicing (arr[lower:upper]).
func NewArraySubscript ¶
func NewArraySubscript(arraytype, elemtype Oid, arrayexpr, indexexpr Expression) *SubscriptingRef
NewArraySubscript creates a SubscriptingRef for array indexing (arr[index]).
func NewSubscriptingRef ¶
func NewSubscriptingRef(containertype, elemtype, restype Oid, refexpr Expression, upperindex []Expression) *SubscriptingRef
NewSubscriptingRef creates a new SubscriptingRef node.
func (*SubscriptingRef) ExpressionType ¶
func (sr *SubscriptingRef) ExpressionType() string
func (*SubscriptingRef) String ¶
func (sr *SubscriptingRef) String() string
type TableFunc ¶
type TableFunc struct {
BaseNode
Functype TableFuncType // XMLTABLE or JSON_TABLE
NsUris []Expression // List of namespace URI expressions
NsNames []string // List of namespace names or NULL
Docexpr Expression // Input document expression
Rowexpr Expression // Row filter expression
Colnames []string // Column names (list of String)
Coltypes []Oid // OID list of column type OIDs
Coltypmods []int // Integer list of column typmods
Colcollations []Oid // OID list of column collation OIDs
Colexprs []Expression // List of column filter expressions
Coldefexprs []Expression // List of column default expressions
Colvalexprs []Expression // JSON_TABLE: list of column value expressions
Passingvalexprs []Expression // JSON_TABLE: list of PASSING argument expressions
Notnulls []bool // Nullability flag for each output column
Plan Node // JSON_TABLE plan
Ordinalitycol int // Counts from 0; -1 if none specified
}
TableFunc represents a table function such as XMLTABLE and JSON_TABLE Ported from postgres/src/include/nodes/primnodes.h:109-146
func CloneRefOfTableFunc ¶
CloneRefOfTableFunc creates a deep clone of the input.
func NewTableFunc ¶
func NewTableFunc(functype TableFuncType, nsUris []Expression, nsNames []string, docexpr, rowexpr Expression, colnames []string, coltypes []Oid, coltypmods []int, colcollations []Oid, colexprs, coldefexprs, colvalexprs, passingvalexprs []Expression, notnulls []bool, plan Node, ordinalitycol, location int) *TableFunc
NewTableFunc creates a new TableFunc node.
func (*TableFunc) StatementType ¶
type TableFuncType ¶
type TableFuncType int
TableFuncType represents table function types Ported from postgres/src/include/nodes/primnodes.h:98-101
const ( TFT_XMLTABLE TableFuncType = iota TFT_JSON_TABLE )
type TableLikeClause ¶
type TableLikeClause struct {
BaseNode
Relation *RangeVar // Table to copy from - parsenodes.h:752
Options TableLikeOption // OR of TableLikeOption flags - parsenodes.h:753
}
TableLikeClause represents LIKE clauses in CREATE TABLE. This allows table inheritance and copying of structure. Ported from postgres/src/include/nodes/parsenodes.h:751
func CloneRefOfTableLikeClause ¶
func CloneRefOfTableLikeClause(n *TableLikeClause) *TableLikeClause
CloneRefOfTableLikeClause creates a deep clone of the input.
func NewTableLikeAll ¶
func NewTableLikeAll(relation *RangeVar) *TableLikeClause
NewTableLikeAll creates a LIKE clause including all options.
func NewTableLikeClause ¶
func NewTableLikeClause(relation *RangeVar, options TableLikeOption) *TableLikeClause
NewTableLikeClause creates a new TableLikeClause node.
func (*TableLikeClause) SqlString ¶
func (tlc *TableLikeClause) SqlString() string
SqlString generates the SQL representation of the TableLikeClause
func (*TableLikeClause) String ¶
func (tlc *TableLikeClause) String() string
type TableLikeOption ¶
type TableLikeOption int
TableLikeOption represents options for LIKE clauses. Ported from postgres/src/include/nodes/parsenodes.h:755-763
const ( CREATE_TABLE_LIKE_COMMENTS TableLikeOption = 1 << 0 // INCLUDING COMMENTS - parsenodes.h:756 CREATE_TABLE_LIKE_COMPRESSION TableLikeOption = 1 << 1 // INCLUDING COMPRESSION - parsenodes.h:757 CREATE_TABLE_LIKE_CONSTRAINTS TableLikeOption = 1 << 2 // INCLUDING CONSTRAINTS - parsenodes.h:758 CREATE_TABLE_LIKE_DEFAULTS TableLikeOption = 1 << 3 // INCLUDING DEFAULTS - parsenodes.h:759 CREATE_TABLE_LIKE_GENERATED TableLikeOption = 1 << 4 // INCLUDING GENERATED - parsenodes.h:760 CREATE_TABLE_LIKE_IDENTITY TableLikeOption = 1 << 5 // INCLUDING IDENTITY - parsenodes.h:761 CREATE_TABLE_LIKE_INDEXES TableLikeOption = 1 << 6 // INCLUDING INDEXES - parsenodes.h:762 CREATE_TABLE_LIKE_STATISTICS TableLikeOption = 1 << 7 // INCLUDING STATISTICS - parsenodes.h:763 CREATE_TABLE_LIKE_STORAGE TableLikeOption = 1 << 8 // INCLUDING STORAGE - parsenodes.h:764 CREATE_TABLE_LIKE_ALL TableLikeOption = 1 << 9 // INCLUDING ALL - parsenodes.h:765 )
type TableSampleClause ¶
type TableSampleClause struct {
BaseNode
Tsmhandler Oid // OID of the tablesample handler function
Args *NodeList // List of tablesample arguments
Repeatable Expr // REPEATABLE expression, or NULL
}
TableSampleClause represents a TABLESAMPLE clause. Ported from postgres/src/include/nodes/parsenodes.h:1344-1367
func CloneRefOfTableSampleClause ¶
func CloneRefOfTableSampleClause(n *TableSampleClause) *TableSampleClause
CloneRefOfTableSampleClause creates a deep clone of the input.
func NewTableSampleClause ¶
func NewTableSampleClause(tsmhandler Oid, args *NodeList, repeatable Expr, location int) *TableSampleClause
NewTableSampleClause creates a new TableSampleClause node.
func (*TableSampleClause) StatementType ¶
func (t *TableSampleClause) StatementType() string
func (*TableSampleClause) String ¶
func (t *TableSampleClause) String() string
type TargetEntry ¶
type TargetEntry struct {
BaseExpr
Expr Expression // The expression to compute - primnodes.h:2190
Resno AttrNumber // Attribute number (>= 1) - primnodes.h:2192
Resname string // Name of the column (could be NULL) - primnodes.h:2194
Ressortgroupref Index // Nonzero if referenced by ORDER BY/GROUP BY/HAVING - primnodes.h:2196
Resorigtbl Oid // OID of column's source table - primnodes.h:2198
Resorigcol AttrNumber // Column's number in source table - primnodes.h:2200
Resjunk bool // Set to true to eliminate the attribute from final target list - primnodes.h:2202
}
TargetEntry represents a target list entry in a query (SELECT clause item). This is critical for query execution as it represents individual columns or expressions in the target list of a query. Ported from postgres/src/include/nodes/primnodes.h:2186
func CloneRefOfTargetEntry ¶
func CloneRefOfTargetEntry(n *TargetEntry) *TargetEntry
CloneRefOfTargetEntry creates a deep clone of the input.
func CloneSliceOfRefOfTargetEntry ¶
func CloneSliceOfRefOfTargetEntry(n []*TargetEntry) []*TargetEntry
CloneSliceOfRefOfTargetEntry creates a deep clone of the input.
func NewJunkTargetEntry ¶
func NewJunkTargetEntry(expr Expression, resno AttrNumber) *TargetEntry
NewJunkTargetEntry creates a new junk TargetEntry (for internal use).
func NewTargetEntry ¶
func NewTargetEntry(expr Expression, resno AttrNumber, resname string) *TargetEntry
NewTargetEntry creates a new TargetEntry node.
func (*TargetEntry) ExpressionType ¶
func (te *TargetEntry) ExpressionType() string
func (*TargetEntry) String ¶
func (te *TargetEntry) String() string
type TimeLineID ¶
type TimeLineID uint32
TimeLineID - timeline identifier. Ported from postgres/src/include/access/xlogdefs.h:59
type TransactionStmt ¶
type TransactionStmt struct {
BaseNode
Kind TransactionStmtKind // Kind of transaction statement - postgres/src/include/nodes/parsenodes.h:3670
Options *NodeList // List of DefElem nodes for BEGIN/START - postgres/src/include/nodes/parsenodes.h:3671
SavepointName string // Savepoint name for SAVEPOINT/RELEASE/ROLLBACK TO - postgres/src/include/nodes/parsenodes.h:3672
Gid string // String identifier for two-phase commit - postgres/src/include/nodes/parsenodes.h:3673
Chain bool // AND CHAIN option - postgres/src/include/nodes/parsenodes.h:3674
}
TransactionStmt represents a transaction control statement. Ported from postgres/src/include/nodes/parsenodes.h:3667
func CloneRefOfTransactionStmt ¶
func CloneRefOfTransactionStmt(n *TransactionStmt) *TransactionStmt
CloneRefOfTransactionStmt creates a deep clone of the input.
func NewBeginStmt ¶
func NewBeginStmt() *TransactionStmt
NewBeginStmt creates a new BEGIN statement.
func NewCommitStmt ¶
func NewCommitStmt() *TransactionStmt
NewCommitStmt creates a new COMMIT statement.
func NewReleaseStmt ¶
func NewReleaseStmt(name string) *TransactionStmt
NewReleaseStmt creates a new RELEASE statement.
func NewRollbackStmt ¶
func NewRollbackStmt() *TransactionStmt
NewRollbackStmt creates a new ROLLBACK statement.
func NewRollbackToStmt ¶
func NewRollbackToStmt(name string) *TransactionStmt
NewRollbackToStmt creates a new ROLLBACK TO statement.
func NewSavepointStmt ¶
func NewSavepointStmt(name string) *TransactionStmt
NewSavepointStmt creates a new SAVEPOINT statement.
func NewTransactionStmt ¶
func NewTransactionStmt(kind TransactionStmtKind) *TransactionStmt
NewTransactionStmt creates a new TransactionStmt node.
func (*TransactionStmt) SqlString ¶
func (ts *TransactionStmt) SqlString() string
func (*TransactionStmt) StatementType ¶
func (ts *TransactionStmt) StatementType() string
func (*TransactionStmt) String ¶
func (ts *TransactionStmt) String() string
type TransactionStmtKind ¶
type TransactionStmtKind int
TransactionStmtKind represents the type of transaction statement. Ported from postgres/src/include/nodes/parsenodes.h:3653
const ( TRANS_STMT_BEGIN TransactionStmtKind = iota // BEGIN/START TRANS_STMT_START // START (alias for BEGIN) TRANS_STMT_COMMIT // COMMIT TRANS_STMT_ROLLBACK // ROLLBACK TRANS_STMT_SAVEPOINT // SAVEPOINT TRANS_STMT_RELEASE // RELEASE TRANS_STMT_ROLLBACK_TO // ROLLBACK TO TRANS_STMT_PREPARE // PREPARE TRANSACTION TRANS_STMT_COMMIT_PREPARED // COMMIT PREPARED TRANS_STMT_ROLLBACK_PREPARED // ROLLBACK PREPARED )
func (TransactionStmtKind) String ¶
func (t TransactionStmtKind) String() string
type TriggerFires ¶
type TriggerFires int
Event trigger constants
const ( TRIGGER_FIRES_ON_ORIGIN TriggerFires = iota TRIGGER_FIRES_ON_REPLICA TRIGGER_FIRES_ALWAYS TRIGGER_DISABLED )
type TriggerTransition ¶
type TriggerTransition struct {
BaseNode
Name string // Transition table name - parsenodes.h:1739
IsNew bool // Is this NEW table? (or OLD table?) - parsenodes.h:1740
IsTable bool // Is this a table? (or row?) - parsenodes.h:1741
}
TriggerTransition represents trigger transition tables. Ported from postgres/src/include/nodes/parsenodes.h:1737
func CloneRefOfTriggerTransition ¶
func CloneRefOfTriggerTransition(n *TriggerTransition) *TriggerTransition
CloneRefOfTriggerTransition creates a deep clone of the input.
type TruncateStmt ¶
type TruncateStmt struct {
BaseNode
Relations *NodeList `json:"relations"` // Relations (RangeVars) to be truncated
RestartSeqs bool `json:"restartSeqs"` // Restart owned sequences?
Behavior DropBehavior `json:"behavior"` // RESTRICT or CASCADE behavior
}
TruncateStmt represents TRUNCATE TABLE statements Ported from postgres/src/include/nodes/parsenodes.h:3240-3246
func CloneRefOfTruncateStmt ¶
func CloneRefOfTruncateStmt(n *TruncateStmt) *TruncateStmt
CloneRefOfTruncateStmt creates a deep clone of the input.
func NewTruncateStmt ¶
func NewTruncateStmt(relations *NodeList) *TruncateStmt
NewTruncateStmt creates a new TruncateStmt node
func (*TruncateStmt) SqlString ¶
func (n *TruncateStmt) SqlString() string
SqlString returns the SQL representation of the TRUNCATE statement
func (*TruncateStmt) StatementType ¶
func (n *TruncateStmt) StatementType() string
StatementType implements the Stmt interface
func (*TruncateStmt) String ¶
func (n *TruncateStmt) String() string
type TypeCast ¶
type TypeCast struct {
BaseNode
Arg Node // The expression being cast
TypeName *TypeName // The target type
}
TypeCast represents a type cast expression (CAST(expr AS type) or expr::type). Ported from postgres/src/include/nodes/parsenodes.h:370-380
func CloneRefOfTypeCast ¶
CloneRefOfTypeCast creates a deep clone of the input.
func NewTypeCast ¶
NewTypeCast creates a new TypeCast node.
func (*TypeCast) ExpressionType ¶
type TypeName ¶
type TypeName struct {
BaseNode
Names *NodeList // qualified name (list of String)
TypeOid Oid // type's OID (filled in by transformTypeName)
Setof bool // is a set?
PctType bool // %TYPE specified?
Typmods *NodeList // type modifier expression(s)
Typemod int32 // prespecified type modifier
ArrayBounds *NodeList // array bounds
}
TypeName represents a type name specification. This is a placeholder implementation - full TypeName from parsenodes.h will be implemented later
func CloneRefOfTypeName ¶
CloneRefOfTypeName creates a deep clone of the input.
func NewTypeName ¶
NewTypeName creates a new TypeName node.
func OidToTypeName ¶
OidToTypeName returns a TypeName that deparses to a SQL cast target for the given built-in type OID (scalars, plus the array and range types Oid.String recognizes), or nil if the OID is unrecognized — including user-defined types. Callers substitute the argument without a cast in that case.
The returned TypeName carries no type modifier, matching PostgreSQL's EXECUTE: it coerces each argument to the base parameter type with a typmod of -1 (see commands/prepare.c EvaluateParams), so a base-type-name cast is exact.
func TableFuncTypeName ¶
TableFuncTypeName creates a TypeName representing a RECORD type for RETURNS TABLE. This matches PostgreSQL's TableFuncTypeName function.
type UnlistenStmt ¶
type UnlistenStmt struct {
BaseNode
Conditionname string // Condition name to stop listening for, or "*" for all - postgres/src/include/nodes/parsenodes.h:3650
}
UnlistenStmt represents an UNLISTEN statement. Ported from postgres/src/include/nodes/parsenodes.h:3643
func CloneRefOfUnlistenStmt ¶
func CloneRefOfUnlistenStmt(n *UnlistenStmt) *UnlistenStmt
CloneRefOfUnlistenStmt creates a deep clone of the input.
func NewUnlistenAllStmt ¶
func NewUnlistenAllStmt() *UnlistenStmt
NewUnlistenAllStmt creates a new UNLISTEN * statement.
func NewUnlistenStmt ¶
func NewUnlistenStmt(conditionname string) *UnlistenStmt
NewUnlistenStmt creates a new UNLISTEN statement.
func (*UnlistenStmt) SqlString ¶
func (us *UnlistenStmt) SqlString() string
SqlString returns the SQL representation of the UNLISTEN statement
func (*UnlistenStmt) StatementType ¶
func (us *UnlistenStmt) StatementType() string
func (*UnlistenStmt) String ¶
func (us *UnlistenStmt) String() string
type UpdateStmt ¶
type UpdateStmt struct {
BaseNode
Relation *RangeVar // Relation to update - postgres/src/include/nodes/parsenodes.h:2072
TargetList *NodeList // Target list (of ResTarget) - postgres/src/include/nodes/parsenodes.h:2073
WhereClause Node // Qualifications - postgres/src/include/nodes/parsenodes.h:2074
FromClause *NodeList // Optional from clause for more tables - postgres/src/include/nodes/parsenodes.h:2075
ReturningList *NodeList // List of expressions to return - postgres/src/include/nodes/parsenodes.h:2076
WithClause *WithClause // WITH clause - postgres/src/include/nodes/parsenodes.h:2077
}
UpdateStmt represents an UPDATE statement. Ported from postgres/src/include/nodes/parsenodes.h:2069
func CloneRefOfUpdateStmt ¶
func CloneRefOfUpdateStmt(n *UpdateStmt) *UpdateStmt
CloneRefOfUpdateStmt creates a deep clone of the input.
func NewUpdateStmt ¶
func NewUpdateStmt(relation *RangeVar) *UpdateStmt
NewUpdateStmt creates a new UpdateStmt node.
func (*UpdateStmt) SqlString ¶
func (u *UpdateStmt) SqlString() string
SqlString returns the SQL representation of the UpdateStmt
func (*UpdateStmt) StatementType ¶
func (u *UpdateStmt) StatementType() string
func (*UpdateStmt) String ¶
func (u *UpdateStmt) String() string
type VacuumRelation ¶
type VacuumRelation struct {
BaseNode
Relation *RangeVar // Relation to vacuum - postgres/src/include/nodes/parsenodes.h:3848
Oid Oid // OID of relation, for RangeVar-less VacuumStmt - postgres/src/include/nodes/parsenodes.h:3849
VaCols *NodeList // List of column names, or NIL for all - postgres/src/include/nodes/parsenodes.h:3850
}
VacuumRelation represents a relation in a VACUUM statement. Ported from postgres/src/include/nodes/parsenodes.h:3845-3851
func CloneRefOfVacuumRelation ¶
func CloneRefOfVacuumRelation(n *VacuumRelation) *VacuumRelation
CloneRefOfVacuumRelation creates a deep clone of the input.
func NewVacuumRelation ¶
func NewVacuumRelation(relation *RangeVar, vaCols *NodeList) *VacuumRelation
NewVacuumRelation creates a new VacuumRelation node.
func (*VacuumRelation) String ¶
func (vr *VacuumRelation) String() string
type VacuumStmt ¶
type VacuumStmt struct {
BaseNode
Options *NodeList // List of DefElem nodes - postgres/src/include/nodes/parsenodes.h:3840
Rels *NodeList // List of VacuumRelation, or NIL for all - postgres/src/include/nodes/parsenodes.h:3841
IsVacuumcmd bool // True for VACUUM, false for ANALYZE - postgres/src/include/nodes/parsenodes.h:3842
}
VacuumStmt represents a VACUUM or ANALYZE statement. Ported from postgres/src/include/nodes/parsenodes.h:3837
func CloneRefOfVacuumStmt ¶
func CloneRefOfVacuumStmt(n *VacuumStmt) *VacuumStmt
CloneRefOfVacuumStmt creates a deep clone of the input.
func NewAnalyzeStmt ¶
func NewAnalyzeStmt(options *NodeList, rels *NodeList) *VacuumStmt
NewAnalyzeStmt creates a new ANALYZE statement.
func NewVacuumStmt ¶
func NewVacuumStmt(options *NodeList, rels *NodeList) *VacuumStmt
NewVacuumStmt creates a new VACUUM statement.
func (*VacuumStmt) SqlString ¶
func (vs *VacuumStmt) SqlString() string
SqlString returns the SQL representation of the VACUUM/ANALYZE statement
func (*VacuumStmt) StatementType ¶
func (vs *VacuumStmt) StatementType() string
func (*VacuumStmt) String ¶
func (vs *VacuumStmt) String() string
type Value ¶
type Value interface {
Expression
IsValue() bool
}
Value is a generic interface for all value types. This provides a common interface for all literal values.
type Var ¶
type Var struct {
BaseExpr
Varno int // Relation index in range table - postgres/src/include/nodes/primnodes.h:249
Varattno AttrNumber // Attribute number (0 = whole-row) - postgres/src/include/nodes/primnodes.h:250
Vartype Oid // pg_type OID - postgres/src/include/nodes/primnodes.h:251
Vartypmod int32 // Type modifier - postgres/src/include/nodes/primnodes.h:252
Varcollid Oid // Collation OID - postgres/src/include/nodes/primnodes.h:253
// TODO: varnullingrels *Bitmapset not yet ported - postgres/src/include/nodes/primnodes.h:274
Varlevelsup Index // Subquery nesting level - postgres/src/include/nodes/primnodes.h:265
Varnosyn Index // Syntactic relation index - postgres/src/include/nodes/primnodes.h:276
Varattnosyn AttrNumber // Syntactic attribute number - postgres/src/include/nodes/primnodes.h:277
}
Var represents a reference to a table column. Ported from postgres/src/include/nodes/primnodes.h:247
func CloneRefOfVar ¶
CloneRefOfVar creates a deep clone of the input.
func NewVar ¶
func NewVar(varno int, varattno AttrNumber, vartype Oid) *Var
NewVar creates a new Var node.
func (*Var) ExpressionType ¶
type VariableSetKind ¶
type VariableSetKind int
VariableSetKind represents the kind of variable setting operation. Ported from postgres/src/include/nodes/parsenodes.h:2608-2616
const ( VAR_SET_VALUE VariableSetKind = iota // SET variable = value VAR_SET_DEFAULT // SET variable TO DEFAULT VAR_SET_CURRENT // SET variable FROM CURRENT VAR_SET_MULTI // SET TRANSACTION CHARACTERISTICS VAR_RESET // RESET variable VAR_RESET_ALL // RESET ALL )
func (VariableSetKind) String ¶
func (v VariableSetKind) String() string
type VariableSetStmt ¶
type VariableSetStmt struct {
BaseNode
Kind VariableSetKind // What kind of SET command - postgres/src/include/nodes/parsenodes.h:2621
Name string // Variable name - postgres/src/include/nodes/parsenodes.h:2622
Args *NodeList // List of A_Const nodes - postgres/src/include/nodes/parsenodes.h:2623
IsLocal bool // SET LOCAL? - postgres/src/include/nodes/parsenodes.h:2624
}
VariableSetStmt represents a SET/RESET statement. Ported from postgres/src/include/nodes/parsenodes.h:2618
func CloneRefOfVariableSetStmt ¶
func CloneRefOfVariableSetStmt(n *VariableSetStmt) *VariableSetStmt
CloneRefOfVariableSetStmt creates a deep clone of the input.
func NewResetStmt ¶
func NewResetStmt(name string) *VariableSetStmt
NewResetStmt creates a new RESET statement.
func NewSetStmt ¶
func NewSetStmt(name string, args *NodeList) *VariableSetStmt
NewSetStmt creates a new SET variable statement.
func NewVariableSetStmt ¶
func NewVariableSetStmt(kind VariableSetKind, name string, args *NodeList, isLocal bool) *VariableSetStmt
NewVariableSetStmt creates a new SET statement.
func (*VariableSetStmt) SqlString ¶
func (v *VariableSetStmt) SqlString() string
SqlString returns the SQL representation of the SET statement
func (*VariableSetStmt) StatementType ¶
func (vss *VariableSetStmt) StatementType() string
func (*VariableSetStmt) String ¶
func (vss *VariableSetStmt) String() string
type VariableShowStmt ¶
type VariableShowStmt struct {
BaseNode
Name string // Variable name, or "all" - postgres/src/include/nodes/parsenodes.h:2634
}
VariableShowStmt represents a SHOW statement. Ported from postgres/src/include/nodes/parsenodes.h:2631
func CloneRefOfVariableShowStmt ¶
func CloneRefOfVariableShowStmt(n *VariableShowStmt) *VariableShowStmt
CloneRefOfVariableShowStmt creates a deep clone of the input.
func NewVariableShowStmt ¶
func NewVariableShowStmt(name string) *VariableShowStmt
NewVariableShowStmt creates a new SHOW statement.
func (*VariableShowStmt) SqlString ¶
func (vss *VariableShowStmt) SqlString() string
SqlString returns the SQL representation of the SHOW statement
func (*VariableShowStmt) StatementType ¶
func (vss *VariableShowStmt) StatementType() string
func (*VariableShowStmt) String ¶
func (vss *VariableShowStmt) String() string
type ViewCheckOption ¶
type ViewCheckOption int
ViewCheckOption represents WITH CHECK OPTION - ported from postgres/src/include/nodes/parsenodes.h:3773-3777
const ( NO_CHECK_OPTION ViewCheckOption = iota LOCAL_CHECK_OPTION CASCADED_CHECK_OPTION )
func (ViewCheckOption) String ¶
func (v ViewCheckOption) String() string
type ViewStmt ¶
type ViewStmt struct {
BaseNode
View *RangeVar // the view to be created - postgres/src/include/nodes/parsenodes.h:3742
Aliases *NodeList // target column names - postgres/src/include/nodes/parsenodes.h:3743
Query Node // the SELECT query (as a raw parse tree) - postgres/src/include/nodes/parsenodes.h:3744
Replace bool // replace an existing view? - postgres/src/include/nodes/parsenodes.h:3745
Options *NodeList // options from WITH clause - postgres/src/include/nodes/parsenodes.h:3746
WithCheckOption ViewCheckOption // WITH CHECK OPTION - postgres/src/include/nodes/parsenodes.h:3747
}
ViewStmt represents a CREATE VIEW statement. Ported from postgres/src/include/nodes/parsenodes.h:3740
func CloneRefOfViewStmt ¶
CloneRefOfViewStmt creates a deep clone of the input.
func NewViewStmt ¶
NewViewStmt creates a new ViewStmt node.
func (*ViewStmt) StatementType ¶
type WCOKind ¶
type WCOKind int
WCOKind represents the type of WITH CHECK OPTION Ported from postgres/src/include/nodes/parsenodes.h:1358-1366
const ( WCO_VIEW_CHECK WCOKind = iota // WCO on an auto-updatable view WCO_RLS_INSERT_CHECK // RLS INSERT WITH CHECK policy WCO_RLS_UPDATE_CHECK // RLS UPDATE WITH CHECK policy WCO_RLS_CONFLICT_CHECK // RLS ON CONFLICT DO UPDATE USING policy WCO_RLS_MERGE_UPDATE_CHECK // RLS MERGE UPDATE USING policy WCO_RLS_MERGE_DELETE_CHECK // RLS MERGE DELETE USING policy )
type WindowClause ¶
type WindowClause struct {
BaseNode
Name string // Window name (NULL in an OVER clause) - parsenodes.h:1540
Refname string // Referenced window name, if any - parsenodes.h:1542
PartitionClause *NodeList // PARTITION BY expression list - parsenodes.h:1543
OrderClause *NodeList // ORDER BY (list of SortBy) - parsenodes.h:1545
FrameOptions int // Frame_clause options, see WindowDef - parsenodes.h:1546
StartOffset Node // Expression for starting bound, if any - parsenodes.h:1547
EndOffset Node // Expression for ending bound, if any - parsenodes.h:1548
StartInRangeFunc Oid // In_range function for startOffset - parsenodes.h:1550
EndInRangeFunc Oid // In_range function for endOffset - parsenodes.h:1552
InRangeColl Oid // Collation for in_range tests - parsenodes.h:1554
InRangeAsc bool // True if ASC in the ORDER BY clause - parsenodes.h:1556
InRangeNullsFirst bool // True if NULLS FIRST in ORDER BY clause - parsenodes.h:1557
WinRef Index // winref assigned by windowClausesProcessor - parsenodes.h:1559
CopiedOrder bool // Did we copy orderClause from refname? - parsenodes.h:1560
}
WindowClause represents a window function clause. Window functions are essential for analytical queries and are becoming increasingly common in modern SQL usage. Ported from postgres/src/include/nodes/parsenodes.h:1536
func CloneRefOfWindowClause ¶
func CloneRefOfWindowClause(n *WindowClause) *WindowClause
CloneRefOfWindowClause creates a deep clone of the input.
func CloneSliceOfRefOfWindowClause ¶
func CloneSliceOfRefOfWindowClause(n []*WindowClause) []*WindowClause
CloneSliceOfRefOfWindowClause creates a deep clone of the input.
func NewOrderedWindowClause ¶
func NewOrderedWindowClause(name string, orderClause *NodeList) *WindowClause
NewOrderedWindowClause creates a new WindowClause with ORDER BY.
func NewPartitionedWindowClause ¶
func NewPartitionedWindowClause(name string, partitionClause *NodeList) *WindowClause
NewPartitionedWindowClause creates a new WindowClause with PARTITION BY.
func NewWindowClause ¶
func NewWindowClause(name string) *WindowClause
NewWindowClause creates a new WindowClause node.
func (*WindowClause) String ¶
func (wc *WindowClause) String() string
type WindowDef ¶
type WindowDef struct {
BaseNode
Name string // Window name (NULL for inline windows)
Refname string // Referenced window name, if any
PartitionClause *NodeList // PARTITION BY expression list
OrderClause *NodeList // ORDER BY (list of SortBy)
FrameOptions int // Frame_option flags
StartOffset Node // Expression for start offset
EndOffset Node // Expression for end offset
}
WindowDef represents a window definition in a WINDOW clause. Ported from postgres/src/include/nodes/parsenodes.h:561-583
func CloneRefOfWindowDef ¶
CloneRefOfWindowDef creates a deep clone of the input.
func NewWindowDef ¶
NewWindowDef creates a new WindowDef node.
func (*WindowDef) SqlStringForContext ¶
func (*WindowDef) StatementType ¶
type WindowFunc ¶
type WindowFunc struct {
BaseExpr
Winfnoid Oid // pg_proc OID of the function - postgres/src/include/nodes/primnodes.h:593
Wintype Oid // Result type OID - postgres/src/include/nodes/primnodes.h:595
Wincollid Oid // Result collation - postgres/src/include/nodes/primnodes.h:597
Inputcollid Oid // Input collation - postgres/src/include/nodes/primnodes.h:599
Args *NodeList // Arguments to window function - postgres/src/include/nodes/primnodes.h:601
Aggfilter Node // FILTER expression - postgres/src/include/nodes/primnodes.h:603
RunCondition *NodeList // List of run conditions - postgres/src/include/nodes/primnodes.h:605
Winref Index // Index of associated WindowClause - postgres/src/include/nodes/primnodes.h:607
Winstar bool // True if argument list was '*' - postgres/src/include/nodes/primnodes.h:609
Winagg bool // Is function a simple aggregate? - postgres/src/include/nodes/primnodes.h:611
}
WindowFunc represents a window function call expression. Ported from postgres/src/include/nodes/primnodes.h:563
func CloneRefOfWindowFunc ¶
func CloneRefOfWindowFunc(n *WindowFunc) *WindowFunc
CloneRefOfWindowFunc creates a deep clone of the input.
func NewDenseRank ¶
func NewDenseRank() *WindowFunc
NewDenseRank creates a DENSE_RANK() window function.
func NewRowNumber ¶
func NewRowNumber() *WindowFunc
NewRowNumber creates a ROW_NUMBER() window function.
func NewWindowFunc ¶
func NewWindowFunc(winfnoid Oid, wintype Oid, args *NodeList, winref Index) *WindowFunc
NewWindowFunc creates a new WindowFunc node.
func (*WindowFunc) ExpressionType ¶
func (w *WindowFunc) ExpressionType() string
func (*WindowFunc) String ¶
func (w *WindowFunc) String() string
type WindowFuncRunCondition ¶
type WindowFuncRunCondition struct {
BaseExpr
Opno Oid // PG_OPERATOR OID of the operator
InputCollid Oid // OID of collation that operator should use
WfuncLeft bool // True if WindowFunc belongs on the left
Arg Expression // The argument expression
}
WindowFuncRunCondition represents a window function run condition Ported from postgres/src/include/nodes/primnodes.h:596-609
func CloneRefOfWindowFuncRunCondition ¶
func CloneRefOfWindowFuncRunCondition(n *WindowFuncRunCondition) *WindowFuncRunCondition
CloneRefOfWindowFuncRunCondition creates a deep clone of the input.
func NewWindowFuncRunCondition ¶
func NewWindowFuncRunCondition(opno, inputCollid Oid, wfuncLeft bool, arg Expression, location int) *WindowFuncRunCondition
NewWindowFuncRunCondition creates a new WindowFuncRunCondition node.
func (*WindowFuncRunCondition) ExpressionType ¶
func (w *WindowFuncRunCondition) ExpressionType() string
func (*WindowFuncRunCondition) String ¶
func (w *WindowFuncRunCondition) String() string
type WithCheckOption ¶
type WithCheckOption struct {
BaseNode
Kind WCOKind `json:"kind"` // Kind of WCO
Relname string `json:"relname"` // Name of relation that specified the WCO
Polname string `json:"polname"` // Name of RLS policy being checked
Qual Node `json:"qual"` // Constraint qual to check
Cascaded bool `json:"cascaded"` // True for a cascaded WCO on a view
}
WithCheckOption represents WITH CHECK OPTION for views and RLS policies Ported from postgres/src/include/nodes/parsenodes.h:1368-1376
func CloneRefOfWithCheckOption ¶
func CloneRefOfWithCheckOption(n *WithCheckOption) *WithCheckOption
CloneRefOfWithCheckOption creates a deep clone of the input.
func NewWithCheckOption ¶
func NewWithCheckOption(kind WCOKind, cascaded bool) *WithCheckOption
NewWithCheckOption creates a new WithCheckOption node
func (*WithCheckOption) String ¶
func (n *WithCheckOption) String() string
type WithClause ¶
type WithClause struct {
BaseNode
Ctes *NodeList // List of CommonTableExpr nodes
Recursive bool // TRUE for WITH RECURSIVE
}
WithClause represents a complete WITH clause (Common Table Expression clause). Ported from postgres/src/include/nodes/parsenodes.h:1592-1605
func CloneRefOfWithClause ¶
func CloneRefOfWithClause(n *WithClause) *WithClause
CloneRefOfWithClause creates a deep clone of the input.
func NewWithClause ¶
func NewWithClause(ctes *NodeList, recursive bool, location int) *WithClause
NewWithClause creates a new WithClause node.
func (*WithClause) ExpressionType ¶
func (w *WithClause) ExpressionType() string
func (*WithClause) IsExpr ¶
func (w *WithClause) IsExpr() bool
func (*WithClause) SqlString ¶
func (w *WithClause) SqlString() string
SqlString returns the SQL representation of the WithClause
func (*WithClause) String ¶
func (w *WithClause) String() string
type XLogRecPtr ¶
type XLogRecPtr uint64
XLogRecPtr - WAL record pointer. Ported from postgres/src/include/access/xlogdefs.h:21
type XmlExpr ¶
type XmlExpr struct {
BaseExpr
Op XmlExprOp // XML function ID
Name string // Name in xml(NAME foo ...) syntaxes
NamedArgs *NodeList // Non-XML expressions for xml_attributes
ArgNames *NodeList // Parallel list of String values
Args *NodeList // List of expressions
Xmloption XmlOptionType // DOCUMENT or CONTENT
Indent bool // INDENT option for XMLSERIALIZE
Type Oid // Target type for XMLSERIALIZE
TypeMod int // Target typmod for XMLSERIALIZE
}
XmlExpr represents various SQL/XML functions requiring special grammar Ported from postgres/src/include/nodes/primnodes.h:1596-1618
func CloneRefOfXmlExpr ¶
CloneRefOfXmlExpr creates a deep clone of the input.
func NewXmlExpr ¶
func NewXmlExpr(op XmlExprOp, name string, namedArgs, argNames, args *NodeList, xmloption XmlOptionType, indent bool, typ Oid, typeMod, location int) *XmlExpr
NewXmlExpr creates a new XmlExpr node.
func (*XmlExpr) ExpressionType ¶
type XmlExprOp ¶
type XmlExprOp int
XmlExprOp represents XML expression operation types Ported from postgres/src/include/nodes/primnodes.h:1577-1586
const ( IS_XMLCONCAT XmlExprOp = iota // XMLCONCAT(args) IS_XMLELEMENT // XMLELEMENT(name, xml_attributes, args) IS_XMLFOREST // XMLFOREST(xml_attributes) IS_XMLPARSE // XMLPARSE(text, is_doc, preserve_ws) IS_XMLPI // XMLPI(name [, args]) IS_XMLROOT // XMLROOT(xml, version, standalone) IS_XMLSERIALIZE // XMLSERIALIZE(is_document, xmlval, indent) IS_DOCUMENT // xmlval IS DOCUMENT )
type XmlOptionType ¶
type XmlOptionType int
XmlOptionType represents XML option types. Ported from postgres/src/include/nodes/parsenodes.h:76-80
const ( XMLOPTION_DOCUMENT XmlOptionType = iota XMLOPTION_CONTENT )
type XmlSerialize ¶
type XmlSerialize struct {
BaseNode
XmlOptionType XmlOptionType // DOCUMENT or CONTENT
Expr Node // Expression to serialize
TypeName *TypeName // Target type
Indent bool // INDENT option
}
XmlSerialize represents an XML serialization expression. Ported from postgres/src/include/nodes/parsenodes.h:842-859
func CloneRefOfXmlSerialize ¶
func CloneRefOfXmlSerialize(n *XmlSerialize) *XmlSerialize
CloneRefOfXmlSerialize creates a deep clone of the input.
func NewXmlSerialize ¶
func NewXmlSerialize(xmlOptionType XmlOptionType, expr Node, typeName *TypeName, indent bool, location int) *XmlSerialize
NewXmlSerialize creates a new XmlSerialize node.
func (*XmlSerialize) ExpressionType ¶
func (x *XmlSerialize) ExpressionType() string
func (*XmlSerialize) IsExpr ¶
func (x *XmlSerialize) IsExpr() bool
func (*XmlSerialize) SqlString ¶
func (x *XmlSerialize) SqlString() string
SqlString returns the SQL representation of XmlSerialize
func (*XmlSerialize) String ¶
func (x *XmlSerialize) String() string
type XmlStandaloneType ¶
type XmlStandaloneType int
XmlStandaloneType represents XML standalone options for XMLROOT
const ( XML_STANDALONE_YES XmlStandaloneType = iota XML_STANDALONE_NO XML_STANDALONE_NO_VALUE XML_STANDALONE_OMITTED )
Source Files
¶
- administrative_statements.go
- advanced_statements.go
- alter_misc_statements.go
- ast_clone.go
- ast_rewrite.go
- ddl_additional_statements.go
- ddl_creation_statements.go
- ddl_statements.go
- expressions.go
- generate.go
- helper.go
- interval_constants.go
- json_parse_nodes.go
- keywords.go
- migration_statements.go
- nodes.go
- normalizer.go
- oids.go
- oids_generated.go
- parameters.go
- parse_infrastructure.go
- query_execution_nodes.go
- range_table_nodes.go
- replication.go
- replication_slot.go
- rewriter_api.go
- sharding.go
- sql_utils.go
- statements.go
- type_coercion_nodes.go
- utility_statements.go