ast

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FrameOptionNonDefault              = 0x00001
	FrameOptionRange                   = 0x00002
	FrameOptionRows                    = 0x00004
	FrameOptionGroups                  = 0x00008
	FrameOptionBetween                 = 0x00010
	FrameOptionStartUnboundedPreceding = 0x00020
	FrameOptionEndUnboundedPreceding   = 0x00040
	FrameOptionStartUnboundedFollowing = 0x00080
	FrameOptionEndUnboundedFollowing   = 0x00100
	FrameOptionStartCurrentRow         = 0x00200
	FrameOptionEndCurrentRow           = 0x00400
	FrameOptionStartOffset             = 0x00800
	FrameOptionEndOffset               = 0x01000
	FrameOptionExcludeCurrentRow       = 0x02000
	FrameOptionExcludeGroup            = 0x04000
	FrameOptionExcludeTies             = 0x08000
)

Frame option constants (from PostgreSQL's parsenodes.h)

Variables

This section is empty.

Functions

func Format

func Format(n Node, d format.Dialect) string

Format renders the node as SQL on a single line.

func Pretty

func Pretty(n Node, d format.Dialect, width int) string

Pretty renders the node as SQL, breaking lines so the output fits within width columns where the statement's structure allows it. A negative width renders everything on a single line.

func PrettyWithComments

func PrettyWithComments(n Node, d format.Dialect, width int, ct *CommentTable) string

PrettyWithComments renders the node as SQL like Pretty, emitting the comments a prior AttachComments call anchored to its nodes and keeping the line breaks the author wrote at the boundaries the printer models. Each comment prints at the boundary before its anchor, a trailing comment continues the line of the code it followed, and every comment in the table is printed — anything left when the statement ends trails it.

Types

type A_ArrayExpr

type A_ArrayExpr struct {
	Tag NodeTag[A_ArrayExpr] `json:"tag"`

	Elements *List `json:"elements,omitempty"`
	Location int   `json:"location"`
}

func (*A_ArrayExpr) Format

func (n *A_ArrayExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*A_ArrayExpr) Pos

func (n *A_ArrayExpr) Pos() int

type A_Const

type A_Const struct {
	Tag NodeTag[A_Const] `json:"tag"`

	Val      Node `json:"val,omitempty"`
	Location int  `json:"location"`
}

func (*A_Const) Format

func (n *A_Const) Format(buf *TrackedBuffer, d format.Dialect)

func (*A_Const) Pos

func (n *A_Const) Pos() int

type A_Expr

type A_Expr struct {
	Tag NodeTag[A_Expr] `json:"tag"`

	Kind A_Expr_Kind `json:"kind"`
	// Name is the operator, as a list of String nodes: PostgreSQL's
	// operator space is open (user-defined and schema-qualified operators),
	// so the shared tree keeps pg_query's shape rather than an enum. Each
	// engine's converter writes the operator as its parser saw it — for an
	// engine that accepts more than one spelling of the same operator
	// (SQLite's != for <>, == for =), that is the author's spelling, which
	// is how the printer preserves it.
	Name     *List `json:"name,omitempty"`
	Lexpr    Node  `json:"lexpr,omitempty"`
	Rexpr    Node  `json:"rexpr,omitempty"`
	Location int   `json:"location"`
}

func (*A_Expr) Format

func (n *A_Expr) Format(buf *TrackedBuffer, d format.Dialect)

func (*A_Expr) Pos

func (n *A_Expr) Pos() int

type A_Expr_Kind

type A_Expr_Kind uint
const (
	A_Expr_Kind_OP              A_Expr_Kind = 1
	A_Expr_Kind_OP_ANY          A_Expr_Kind = 2
	A_Expr_Kind_OP_ALL          A_Expr_Kind = 3
	A_Expr_Kind_DISTINCT        A_Expr_Kind = 4
	A_Expr_Kind_NOT_DISTINCT    A_Expr_Kind = 5
	A_Expr_Kind_NULLIF          A_Expr_Kind = 6
	A_Expr_Kind_IN              A_Expr_Kind = 7
	A_Expr_Kind_LIKE            A_Expr_Kind = 8
	A_Expr_Kind_ILIKE           A_Expr_Kind = 9
	A_Expr_Kind_SIMILAR         A_Expr_Kind = 10
	A_Expr_Kind_BETWEEN         A_Expr_Kind = 11
	A_Expr_Kind_NOT_BETWEEN     A_Expr_Kind = 12
	A_Expr_Kind_BETWEEN_SYM     A_Expr_Kind = 13
	A_Expr_Kind_NOT_BETWEEN_SYM A_Expr_Kind = 14
)

func (*A_Expr_Kind) Pos

func (n *A_Expr_Kind) Pos() int

type A_Indices

type A_Indices struct {
	Tag NodeTag[A_Indices] `json:"tag"`

	IsSlice bool `json:"is_slice"`
	Lidx    Node `json:"lidx,omitempty"`
	Uidx    Node `json:"uidx,omitempty"`
}

func (*A_Indices) Format

func (n *A_Indices) Format(buf *TrackedBuffer, d format.Dialect)

func (*A_Indices) Pos

func (n *A_Indices) Pos() int

type A_Indirection

type A_Indirection struct {
	Tag NodeTag[A_Indirection] `json:"tag"`

	Arg         Node  `json:"arg,omitempty"`
	Indirection *List `json:"indirection,omitempty"`
}

func (*A_Indirection) Pos

func (n *A_Indirection) Pos() int

type A_Star

type A_Star struct {
	Tag NodeTag[A_Star] `json:"tag"`
}

func (*A_Star) Format

func (n *A_Star) Format(buf *TrackedBuffer, d format.Dialect)

func (*A_Star) Pos

func (n *A_Star) Pos() int

type AccessPriv

type AccessPriv struct {
	Tag NodeTag[AccessPriv] `json:"tag"`

	PrivName *string `json:"priv_name,omitempty"`
	Cols     *List   `json:"cols,omitempty"`
}

func (*AccessPriv) Pos

func (n *AccessPriv) Pos() int

type AclMode

type AclMode uint32

func (*AclMode) Pos

func (n *AclMode) Pos() int

type AggSplit

type AggSplit uint

func (*AggSplit) Pos

func (n *AggSplit) Pos() int

type AggStrategy

type AggStrategy uint

func (*AggStrategy) Pos

func (n *AggStrategy) Pos() int

type Aggref

type Aggref struct {
	Tag NodeTag[Aggref] `json:"tag"`

	Xpr           Node     `json:"xpr,omitempty"`
	Aggfnoid      Oid      `json:"aggfnoid"`
	Aggtype       Oid      `json:"aggtype"`
	Aggcollid     Oid      `json:"aggcollid"`
	Inputcollid   Oid      `json:"inputcollid"`
	Aggargtypes   *List    `json:"aggargtypes,omitempty"`
	Aggdirectargs *List    `json:"aggdirectargs,omitempty"`
	Args          *List    `json:"args,omitempty"`
	Aggorder      *List    `json:"aggorder,omitempty"`
	Aggdistinct   *List    `json:"aggdistinct,omitempty"`
	Aggfilter     Node     `json:"aggfilter,omitempty"`
	Aggstar       bool     `json:"aggstar"`
	Aggvariadic   bool     `json:"aggvariadic"`
	Aggkind       byte     `json:"aggkind"`
	Agglevelsup   Index    `json:"agglevelsup"`
	Aggsplit      AggSplit `json:"aggsplit"`
	Location      int      `json:"location"`
}

func (*Aggref) Pos

func (n *Aggref) Pos() int

type Alias

type Alias struct {
	Tag NodeTag[Alias] `json:"tag"`

	Aliasname *string `json:"aliasname,omitempty"`
	Colnames  *List   `json:"colnames,omitempty"`
}

func (*Alias) Format

func (n *Alias) Format(buf *TrackedBuffer, d format.Dialect)

func (*Alias) Pos

func (n *Alias) Pos() int

type AlterCollationStmt

type AlterCollationStmt struct {
	Tag NodeTag[AlterCollationStmt] `json:"tag"`

	Collname *List `json:"collname,omitempty"`
}

func (*AlterCollationStmt) Pos

func (n *AlterCollationStmt) Pos() int

type AlterDatabaseSetStmt

type AlterDatabaseSetStmt struct {
	Tag NodeTag[AlterDatabaseSetStmt] `json:"tag"`

	Dbname  *string          `json:"dbname,omitempty"`
	Setstmt *VariableSetStmt `json:"setstmt,omitempty"`
}

func (*AlterDatabaseSetStmt) Pos

func (n *AlterDatabaseSetStmt) Pos() int

type AlterDatabaseStmt

type AlterDatabaseStmt struct {
	Tag NodeTag[AlterDatabaseStmt] `json:"tag"`

	Dbname  *string `json:"dbname,omitempty"`
	Options *List   `json:"options,omitempty"`
}

func (*AlterDatabaseStmt) Pos

func (n *AlterDatabaseStmt) Pos() int

type AlterDefaultPrivilegesStmt

type AlterDefaultPrivilegesStmt struct {
	Tag NodeTag[AlterDefaultPrivilegesStmt] `json:"tag"`

	Options *List      `json:"options,omitempty"`
	Action  *GrantStmt `json:"action,omitempty"`
}

func (*AlterDefaultPrivilegesStmt) Pos

type AlterDomainStmt

type AlterDomainStmt struct {
	Tag NodeTag[AlterDomainStmt] `json:"tag"`

	Subtype   byte         `json:"subtype"`
	TypeName  *List        `json:"type_name,omitempty"`
	Name      *string      `json:"name,omitempty"`
	Def       Node         `json:"def,omitempty"`
	Behavior  DropBehavior `json:"behavior"`
	MissingOk bool         `json:"missing_ok"`
}

func (*AlterDomainStmt) Pos

func (n *AlterDomainStmt) Pos() int

type AlterEnumStmt

type AlterEnumStmt struct {
	Tag NodeTag[AlterEnumStmt] `json:"tag"`

	TypeName           *List   `json:"type_name,omitempty"`
	OldVal             *string `json:"old_val,omitempty"`
	NewVal             *string `json:"new_val,omitempty"`
	NewValNeighbor     *string `json:"new_val_neighbor,omitempty"`
	NewValIsAfter      bool    `json:"new_val_is_after"`
	SkipIfNewValExists bool    `json:"skip_if_new_val_exists"`
}

func (*AlterEnumStmt) Pos

func (n *AlterEnumStmt) Pos() int

type AlterEventTrigStmt

type AlterEventTrigStmt struct {
	Tag NodeTag[AlterEventTrigStmt] `json:"tag"`

	Trigname  *string `json:"trigname,omitempty"`
	Tgenabled byte    `json:"tgenabled"`
}

func (*AlterEventTrigStmt) Pos

func (n *AlterEventTrigStmt) Pos() int

type AlterExtensionContentsStmt

type AlterExtensionContentsStmt struct {
	Tag NodeTag[AlterExtensionContentsStmt] `json:"tag"`

	Extname *string    `json:"extname,omitempty"`
	Action  int        `json:"action"`
	Objtype ObjectType `json:"objtype"`
	Object  Node       `json:"object,omitempty"`
}

func (*AlterExtensionContentsStmt) Pos

type AlterExtensionStmt

type AlterExtensionStmt struct {
	Tag NodeTag[AlterExtensionStmt] `json:"tag"`

	Extname *string `json:"extname,omitempty"`
	Options *List   `json:"options,omitempty"`
}

func (*AlterExtensionStmt) Pos

func (n *AlterExtensionStmt) Pos() int

type AlterFdwStmt

type AlterFdwStmt struct {
	Tag NodeTag[AlterFdwStmt] `json:"tag"`

	Fdwname     *string `json:"fdwname,omitempty"`
	FuncOptions *List   `json:"func_options,omitempty"`
	Options     *List   `json:"options,omitempty"`
}

func (*AlterFdwStmt) Pos

func (n *AlterFdwStmt) Pos() int

type AlterForeignServerStmt

type AlterForeignServerStmt struct {
	Tag NodeTag[AlterForeignServerStmt] `json:"tag"`

	Servername *string `json:"servername,omitempty"`
	Version    *string `json:"version,omitempty"`
	Options    *List   `json:"options,omitempty"`
	HasVersion bool    `json:"has_version"`
}

func (*AlterForeignServerStmt) Pos

func (n *AlterForeignServerStmt) Pos() int

type AlterFunctionStmt

type AlterFunctionStmt struct {
	Tag NodeTag[AlterFunctionStmt] `json:"tag"`

	Func    *ObjectWithArgs `json:"func,omitempty"`
	Actions *List           `json:"actions,omitempty"`
}

func (*AlterFunctionStmt) Pos

func (n *AlterFunctionStmt) Pos() int

type AlterObjectDependsStmt

type AlterObjectDependsStmt struct {
	Tag NodeTag[AlterObjectDependsStmt] `json:"tag"`

	ObjectType ObjectType `json:"object_type"`
	Relation   *RangeVar  `json:"relation,omitempty"`
	Object     Node       `json:"object,omitempty"`
	Extname    Node       `json:"extname,omitempty"`
}

func (*AlterObjectDependsStmt) Pos

func (n *AlterObjectDependsStmt) Pos() int

type AlterObjectSchemaStmt

type AlterObjectSchemaStmt struct {
	Tag NodeTag[AlterObjectSchemaStmt] `json:"tag"`

	ObjectType ObjectType `json:"object_type"`
	Relation   *RangeVar  `json:"relation,omitempty"`
	Object     Node       `json:"object,omitempty"`
	Newschema  *string    `json:"newschema,omitempty"`
	MissingOk  bool       `json:"missing_ok"`
}

func (*AlterObjectSchemaStmt) Pos

func (n *AlterObjectSchemaStmt) Pos() int

type AlterOpFamilyStmt

type AlterOpFamilyStmt struct {
	Tag NodeTag[AlterOpFamilyStmt] `json:"tag"`

	Opfamilyname *List   `json:"opfamilyname,omitempty"`
	Amname       *string `json:"amname,omitempty"`
	IsDrop       bool    `json:"is_drop"`
	Items        *List   `json:"items,omitempty"`
}

func (*AlterOpFamilyStmt) Pos

func (n *AlterOpFamilyStmt) Pos() int

type AlterOperatorStmt

type AlterOperatorStmt struct {
	Tag NodeTag[AlterOperatorStmt] `json:"tag"`

	Opername *ObjectWithArgs `json:"opername,omitempty"`
	Options  *List           `json:"options,omitempty"`
}

func (*AlterOperatorStmt) Pos

func (n *AlterOperatorStmt) Pos() int

type AlterOwnerStmt

type AlterOwnerStmt struct {
	Tag NodeTag[AlterOwnerStmt] `json:"tag"`

	ObjectType ObjectType `json:"object_type"`
	Relation   *RangeVar  `json:"relation,omitempty"`
	Object     Node       `json:"object,omitempty"`
	Newowner   *RoleSpec  `json:"newowner,omitempty"`
}

func (*AlterOwnerStmt) Pos

func (n *AlterOwnerStmt) Pos() int

type AlterPolicyStmt

type AlterPolicyStmt struct {
	Tag NodeTag[AlterPolicyStmt] `json:"tag"`

	PolicyName *string   `json:"policy_name,omitempty"`
	Table      *RangeVar `json:"table,omitempty"`
	Roles      *List     `json:"roles,omitempty"`
	Qual       Node      `json:"qual,omitempty"`
	WithCheck  Node      `json:"with_check,omitempty"`
}

func (*AlterPolicyStmt) Pos

func (n *AlterPolicyStmt) Pos() int

type AlterPublicationStmt

type AlterPublicationStmt struct {
	Tag NodeTag[AlterPublicationStmt] `json:"tag"`

	Pubname      *string       `json:"pubname,omitempty"`
	Options      *List         `json:"options,omitempty"`
	Tables       *List         `json:"tables,omitempty"`
	ForAllTables bool          `json:"for_all_tables"`
	TableAction  DefElemAction `json:"table_action"`
}

func (*AlterPublicationStmt) Pos

func (n *AlterPublicationStmt) Pos() int

type AlterRoleSetStmt

type AlterRoleSetStmt struct {
	Tag NodeTag[AlterRoleSetStmt] `json:"tag"`

	Role     *RoleSpec        `json:"role,omitempty"`
	Database *string          `json:"database,omitempty"`
	Setstmt  *VariableSetStmt `json:"setstmt,omitempty"`
}

func (*AlterRoleSetStmt) Pos

func (n *AlterRoleSetStmt) Pos() int

type AlterRoleStmt

type AlterRoleStmt struct {
	Tag NodeTag[AlterRoleStmt] `json:"tag"`

	Role    *RoleSpec `json:"role,omitempty"`
	Options *List     `json:"options,omitempty"`
	Action  int       `json:"action"`
}

func (*AlterRoleStmt) Pos

func (n *AlterRoleStmt) Pos() int

type AlterSeqStmt

type AlterSeqStmt struct {
	Tag NodeTag[AlterSeqStmt] `json:"tag"`

	Sequence    *RangeVar `json:"sequence,omitempty"`
	Options     *List     `json:"options,omitempty"`
	ForIdentity bool      `json:"for_identity"`
	MissingOk   bool      `json:"missing_ok"`
}

func (*AlterSeqStmt) Pos

func (n *AlterSeqStmt) Pos() int

type AlterSubscriptionStmt

type AlterSubscriptionStmt struct {
	Tag NodeTag[AlterSubscriptionStmt] `json:"tag"`

	Kind        AlterSubscriptionType `json:"kind"`
	Subname     *string               `json:"subname,omitempty"`
	Conninfo    *string               `json:"conninfo,omitempty"`
	Publication *List                 `json:"publication,omitempty"`
	Options     *List                 `json:"options,omitempty"`
}

func (*AlterSubscriptionStmt) Pos

func (n *AlterSubscriptionStmt) Pos() int

type AlterSubscriptionType

type AlterSubscriptionType uint

func (*AlterSubscriptionType) Pos

func (n *AlterSubscriptionType) Pos() int

type AlterSystemStmt

type AlterSystemStmt struct {
	Tag NodeTag[AlterSystemStmt] `json:"tag"`

	Setstmt *VariableSetStmt `json:"setstmt,omitempty"`
}

func (*AlterSystemStmt) Pos

func (n *AlterSystemStmt) Pos() int

type AlterTSConfigType

type AlterTSConfigType uint

func (*AlterTSConfigType) Pos

func (n *AlterTSConfigType) Pos() int

type AlterTSConfigurationStmt

type AlterTSConfigurationStmt struct {
	Tag NodeTag[AlterTSConfigurationStmt] `json:"tag"`

	Kind      AlterTSConfigType `json:"kind"`
	Cfgname   *List             `json:"cfgname,omitempty"`
	Tokentype *List             `json:"tokentype,omitempty"`
	Dicts     *List             `json:"dicts,omitempty"`
	Override  bool              `json:"override"`
	Replace   bool              `json:"replace"`
	MissingOk bool              `json:"missing_ok"`
}

func (*AlterTSConfigurationStmt) Pos

func (n *AlterTSConfigurationStmt) Pos() int

type AlterTSDictionaryStmt

type AlterTSDictionaryStmt struct {
	Tag NodeTag[AlterTSDictionaryStmt] `json:"tag"`

	Dictname *List `json:"dictname,omitempty"`
	Options  *List `json:"options,omitempty"`
}

func (*AlterTSDictionaryStmt) Pos

func (n *AlterTSDictionaryStmt) Pos() int

type AlterTableCmd

type AlterTableCmd struct {
	Tag NodeTag[AlterTableCmd] `json:"tag"`

	Subtype   AlterTableType `json:"subtype"`
	Name      *string        `json:"name,omitempty"`
	Def       *ColumnDef     `json:"def,omitempty"`
	Newowner  *RoleSpec      `json:"newowner,omitempty"`
	Behavior  DropBehavior   `json:"behavior"`
	MissingOk bool           `json:"missing_ok"`
}

func (*AlterTableCmd) Format

func (n *AlterTableCmd) Format(buf *TrackedBuffer, d format.Dialect)

func (*AlterTableCmd) Pos

func (n *AlterTableCmd) Pos() int

type AlterTableMoveAllStmt

type AlterTableMoveAllStmt struct {
	Tag NodeTag[AlterTableMoveAllStmt] `json:"tag"`

	OrigTablespacename *string    `json:"orig_tablespacename,omitempty"`
	Objtype            ObjectType `json:"objtype"`
	Roles              *List      `json:"roles,omitempty"`
	NewTablespacename  *string    `json:"new_tablespacename,omitempty"`
	Nowait             bool       `json:"nowait"`
}

func (*AlterTableMoveAllStmt) Pos

func (n *AlterTableMoveAllStmt) Pos() int

type AlterTableSetSchemaStmt

type AlterTableSetSchemaStmt struct {
	Tag NodeTag[AlterTableSetSchemaStmt] `json:"tag"`

	Table     *TableName `json:"table,omitempty"`
	NewSchema *string    `json:"new_schema,omitempty"`
	MissingOk bool       `json:"missing_ok"`
}

func (*AlterTableSetSchemaStmt) Pos

func (n *AlterTableSetSchemaStmt) Pos() int

type AlterTableSpaceOptionsStmt

type AlterTableSpaceOptionsStmt struct {
	Tag NodeTag[AlterTableSpaceOptionsStmt] `json:"tag"`

	Tablespacename *string `json:"tablespacename,omitempty"`
	Options        *List   `json:"options,omitempty"`
	IsReset        bool    `json:"is_reset"`
}

func (*AlterTableSpaceOptionsStmt) Pos

type AlterTableStmt

type AlterTableStmt struct {
	Tag NodeTag[AlterTableStmt] `json:"tag"`

	// TODO: Only TableName or Relation should be defined
	Relation  *RangeVar  `json:"relation,omitempty"`
	Table     *TableName `json:"table,omitempty"`
	Cmds      *List      `json:"cmds,omitempty"`
	MissingOk bool       `json:"missing_ok"`
	Relkind   ObjectType `json:"relkind"`
	// Incomplete marks a statement whose source carried syntax this node
	// does not model, such as column constraints beyond plain NOT NULL and
	// PRIMARY KEY on an added column. No faithful rendering exists for it.
	Incomplete bool `json:"incomplete"`
}

func (*AlterTableStmt) Format

func (n *AlterTableStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*AlterTableStmt) Pos

func (n *AlterTableStmt) Pos() int

type AlterTableType

type AlterTableType int
const (
	AT_AddColumn AlterTableType = iota
	AT_AlterColumnType
	AT_DropColumn
	AT_DropNotNull
	AT_SetNotNull
)

func (AlterTableType) String

func (t AlterTableType) String() string

type AlterTableType_PG

type AlterTableType_PG uint

func (*AlterTableType_PG) Pos

func (n *AlterTableType_PG) Pos() int

type AlterTypeAddValueStmt

type AlterTypeAddValueStmt struct {
	Tag NodeTag[AlterTypeAddValueStmt] `json:"tag"`

	Type               *TypeName `json:"type,omitempty"`
	NewValue           *string   `json:"new_value,omitempty"`
	NewValHasNeighbor  bool      `json:"new_val_has_neighbor"`
	NewValNeighbor     *string   `json:"new_val_neighbor,omitempty"`
	NewValIsAfter      bool      `json:"new_val_is_after"`
	SkipIfNewValExists bool      `json:"skip_if_new_val_exists"`
}

func (*AlterTypeAddValueStmt) Pos

func (n *AlterTypeAddValueStmt) Pos() int

type AlterTypeRenameValueStmt

type AlterTypeRenameValueStmt struct {
	Tag NodeTag[AlterTypeRenameValueStmt] `json:"tag"`

	Type     *TypeName `json:"type,omitempty"`
	OldValue *string   `json:"old_value,omitempty"`
	NewValue *string   `json:"new_value,omitempty"`
}

func (*AlterTypeRenameValueStmt) Pos

func (n *AlterTypeRenameValueStmt) Pos() int

type AlterTypeSetSchemaStmt

type AlterTypeSetSchemaStmt struct {
	Tag NodeTag[AlterTypeSetSchemaStmt] `json:"tag"`

	Type      *TypeName `json:"type,omitempty"`
	NewSchema *string   `json:"new_schema,omitempty"`
}

func (*AlterTypeSetSchemaStmt) Pos

func (n *AlterTypeSetSchemaStmt) Pos() int

type AlterUserMappingStmt

type AlterUserMappingStmt struct {
	Tag NodeTag[AlterUserMappingStmt] `json:"tag"`

	User       *RoleSpec `json:"user,omitempty"`
	Servername *string   `json:"servername,omitempty"`
	Options    *List     `json:"options,omitempty"`
}

func (*AlterUserMappingStmt) Pos

func (n *AlterUserMappingStmt) Pos() int

type AlternativeSubPlan

type AlternativeSubPlan struct {
	Tag NodeTag[AlternativeSubPlan] `json:"tag"`

	Xpr      Node  `json:"xpr,omitempty"`
	Subplans *List `json:"subplans,omitempty"`
}

func (*AlternativeSubPlan) Pos

func (n *AlternativeSubPlan) Pos() int

type ArrayCoerceExpr

type ArrayCoerceExpr struct {
	Tag NodeTag[ArrayCoerceExpr] `json:"tag"`

	Xpr          Node         `json:"xpr,omitempty"`
	Arg          Node         `json:"arg,omitempty"`
	Elemfuncid   Oid          `json:"elemfuncid"`
	Resulttype   Oid          `json:"resulttype"`
	Resulttypmod int32        `json:"resulttypmod"`
	Resultcollid Oid          `json:"resultcollid"`
	IsExplicit   bool         `json:"is_explicit"`
	Coerceformat CoercionForm `json:"coerceformat"`
	Location     int          `json:"location"`
}

func (*ArrayCoerceExpr) Pos

func (n *ArrayCoerceExpr) Pos() int

type ArrayExpr

type ArrayExpr struct {
	Tag NodeTag[ArrayExpr] `json:"tag"`

	Xpr           Node  `json:"xpr,omitempty"`
	ArrayTypeid   Oid   `json:"array_typeid"`
	ArrayCollid   Oid   `json:"array_collid"`
	ElementTypeid Oid   `json:"element_typeid"`
	Elements      *List `json:"elements,omitempty"`
	Multidims     bool  `json:"multidims"`
	Location      int   `json:"location"`
}

func (*ArrayExpr) Pos

func (n *ArrayExpr) Pos() int

type ArrayRef

type ArrayRef struct {
	Tag NodeTag[ArrayRef] `json:"tag"`

	Xpr             Node  `json:"xpr,omitempty"`
	Refarraytype    Oid   `json:"refarraytype"`
	Refelemtype     Oid   `json:"refelemtype"`
	Reftypmod       int32 `json:"reftypmod"`
	Refcollid       Oid   `json:"refcollid"`
	Refupperindexpr *List `json:"refupperindexpr,omitempty"`
	Reflowerindexpr *List `json:"reflowerindexpr,omitempty"`
	Refexpr         Node  `json:"refexpr,omitempty"`
	Refassgnexpr    Node  `json:"refassgnexpr,omitempty"`
}

func (*ArrayRef) Pos

func (n *ArrayRef) Pos() int

type AttrNumber

type AttrNumber int16

func (*AttrNumber) Pos

func (n *AttrNumber) Pos() int

type BetweenExpr

type BetweenExpr struct {
	Tag NodeTag[BetweenExpr] `json:"tag"`

	// Expr is the value expression to be compared.
	Expr Node `json:"expr,omitempty"`
	// Left is the left expression in the between statement.
	Left Node `json:"left,omitempty"`
	// Right is the right expression in the between statement.
	Right Node `json:"right,omitempty"`
	// Not is true, the expression is "not between".
	Not      bool `json:"not"`
	Location int  `json:"location"`
}

func (*BetweenExpr) Format

func (n *BetweenExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*BetweenExpr) Pos

func (n *BetweenExpr) Pos() int

type BitString

type BitString struct {
	Tag NodeTag[BitString] `json:"tag"`

	Str string `json:"str"`
}

func (*BitString) Pos

func (n *BitString) Pos() int

type BlockId

type BlockId BlockIdData

func (*BlockId) Pos

func (n *BlockId) Pos() int

type BlockIdData

type BlockIdData struct {
	Tag NodeTag[BlockIdData] `json:"tag"`

	BiHi uint16 `json:"bi_hi"`
	BiLo uint16 `json:"bi_lo"`
}

func (*BlockIdData) Pos

func (n *BlockIdData) Pos() int

type BlockNumber

type BlockNumber uint32

func (*BlockNumber) Pos

func (n *BlockNumber) Pos() int

type BoolExpr

type BoolExpr struct {
	Tag NodeTag[BoolExpr] `json:"tag"`

	Xpr      Node         `json:"xpr,omitempty"`
	Boolop   BoolExprType `json:"boolop"`
	Args     *List        `json:"args,omitempty"`
	Location int          `json:"location"`
}

func (*BoolExpr) Format

func (n *BoolExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*BoolExpr) Pos

func (n *BoolExpr) Pos() int

type BoolExprType

type BoolExprType uint
const (
	BoolExprTypeAnd BoolExprType
	BoolExprTypeOr
	BoolExprTypeNot

	// Added for MySQL
	BoolExprTypeIsNull
	BoolExprTypeIsNotNull
)

https://github.com/pganalyze/libpg_query/blob/13-latest/protobuf/pg_query.proto#L2783-L2789

func (*BoolExprType) Pos

func (n *BoolExprType) Pos() int

type BoolTestType

type BoolTestType uint

func (*BoolTestType) Pos

func (n *BoolTestType) Pos() int

type Boolean

type Boolean struct {
	Tag NodeTag[Boolean] `json:"tag"`

	Boolval bool `json:"boolval"`
}

func (*Boolean) Format

func (n *Boolean) Format(buf *TrackedBuffer, d format.Dialect)

func (*Boolean) Pos

func (n *Boolean) Pos() int

type BooleanTest

type BooleanTest struct {
	Tag NodeTag[BooleanTest] `json:"tag"`

	Xpr          Node         `json:"xpr,omitempty"`
	Arg          Node         `json:"arg,omitempty"`
	Booltesttype BoolTestType `json:"booltesttype"`
	Location     int          `json:"location"`
}

func (*BooleanTest) Pos

func (n *BooleanTest) Pos() int

type CallStmt

type CallStmt struct {
	Tag NodeTag[CallStmt] `json:"tag"`

	FuncCall *FuncCall `json:"func_call,omitempty"`
}

func (*CallStmt) Format

func (n *CallStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*CallStmt) Pos

func (n *CallStmt) Pos() int

type CaseExpr

type CaseExpr struct {
	Tag NodeTag[CaseExpr] `json:"tag"`

	Xpr        Node  `json:"xpr,omitempty"`
	Casetype   Oid   `json:"casetype"`
	Casecollid Oid   `json:"casecollid"`
	Arg        Node  `json:"arg,omitempty"`
	Args       *List `json:"args,omitempty"`
	Defresult  Node  `json:"defresult,omitempty"`
	Location   int   `json:"location"`
}

func (*CaseExpr) Format

func (n *CaseExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*CaseExpr) Pos

func (n *CaseExpr) Pos() int

type CaseTestExpr

type CaseTestExpr struct {
	Tag NodeTag[CaseTestExpr] `json:"tag"`

	Xpr       Node  `json:"xpr,omitempty"`
	TypeId    Oid   `json:"type_id"`
	TypeMod   int32 `json:"type_mod"`
	Collation Oid   `json:"collation"`
}

func (*CaseTestExpr) Pos

func (n *CaseTestExpr) Pos() int

type CaseWhen

type CaseWhen struct {
	Tag NodeTag[CaseWhen] `json:"tag"`

	Xpr      Node `json:"xpr,omitempty"`
	Expr     Node `json:"expr,omitempty"`
	Result   Node `json:"result,omitempty"`
	Location int  `json:"location"`
}

func (*CaseWhen) Format

func (n *CaseWhen) Format(buf *TrackedBuffer, d format.Dialect)

func (*CaseWhen) Pos

func (n *CaseWhen) Pos() int

type CheckPointStmt

type CheckPointStmt struct {
	Tag NodeTag[CheckPointStmt] `json:"tag"`
}

func (*CheckPointStmt) Pos

func (n *CheckPointStmt) Pos() int

type ClosePortalStmt

type ClosePortalStmt struct {
	Tag NodeTag[ClosePortalStmt] `json:"tag"`

	Portalname *string `json:"portalname,omitempty"`
}

func (*ClosePortalStmt) Pos

func (n *ClosePortalStmt) Pos() int

type ClusterStmt

type ClusterStmt struct {
	Tag NodeTag[ClusterStmt] `json:"tag"`

	Relation  *RangeVar `json:"relation,omitempty"`
	Indexname *string   `json:"indexname,omitempty"`
	Verbose   bool      `json:"verbose"`
}

func (*ClusterStmt) Pos

func (n *ClusterStmt) Pos() int

type CmdType

type CmdType uint

func (*CmdType) Pos

func (n *CmdType) Pos() int

type CoalesceExpr

type CoalesceExpr struct {
	Tag NodeTag[CoalesceExpr] `json:"tag"`

	Xpr            Node  `json:"xpr,omitempty"`
	Coalescetype   Oid   `json:"coalescetype"`
	Coalescecollid Oid   `json:"coalescecollid"`
	Args           *List `json:"args,omitempty"`
	Location       int   `json:"location"`
}

func (*CoalesceExpr) Format

func (n *CoalesceExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*CoalesceExpr) Pos

func (n *CoalesceExpr) Pos() int

type CoerceToDomain

type CoerceToDomain struct {
	Tag NodeTag[CoerceToDomain] `json:"tag"`

	Xpr            Node         `json:"xpr,omitempty"`
	Arg            Node         `json:"arg,omitempty"`
	Resulttype     Oid          `json:"resulttype"`
	Resulttypmod   int32        `json:"resulttypmod"`
	Resultcollid   Oid          `json:"resultcollid"`
	Coercionformat CoercionForm `json:"coercionformat"`
	Location       int          `json:"location"`
}

func (*CoerceToDomain) Pos

func (n *CoerceToDomain) Pos() int

type CoerceToDomainValue

type CoerceToDomainValue struct {
	Tag NodeTag[CoerceToDomainValue] `json:"tag"`

	Xpr       Node  `json:"xpr,omitempty"`
	TypeId    Oid   `json:"type_id"`
	TypeMod   int32 `json:"type_mod"`
	Collation Oid   `json:"collation"`
	Location  int   `json:"location"`
}

func (*CoerceToDomainValue) Pos

func (n *CoerceToDomainValue) Pos() int

type CoerceViaIO

type CoerceViaIO struct {
	Tag NodeTag[CoerceViaIO] `json:"tag"`

	Xpr          Node         `json:"xpr,omitempty"`
	Arg          Node         `json:"arg,omitempty"`
	Resulttype   Oid          `json:"resulttype"`
	Resultcollid Oid          `json:"resultcollid"`
	Coerceformat CoercionForm `json:"coerceformat"`
	Location     int          `json:"location"`
}

func (*CoerceViaIO) Pos

func (n *CoerceViaIO) Pos() int

type CoercionContext

type CoercionContext uint

func (*CoercionContext) Pos

func (n *CoercionContext) Pos() int

type CoercionForm

type CoercionForm uint

func (*CoercionForm) Pos

func (n *CoercionForm) Pos() int

type CollateClause

type CollateClause struct {
	Tag NodeTag[CollateClause] `json:"tag"`

	Arg      Node  `json:"arg,omitempty"`
	Collname *List `json:"collname,omitempty"`
	Location int   `json:"location"`
}

func (*CollateClause) Pos

func (n *CollateClause) Pos() int

type CollateExpr

type CollateExpr struct {
	Tag NodeTag[CollateExpr] `json:"tag"`

	Xpr      Node `json:"xpr,omitempty"`
	Arg      Node `json:"arg,omitempty"`
	CollOid  Oid  `json:"coll_oid"`
	Location int  `json:"location"`
}

func (*CollateExpr) Format

func (n *CollateExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*CollateExpr) Pos

func (n *CollateExpr) Pos() int

type ColumnDef

type ColumnDef struct {
	Tag NodeTag[ColumnDef] `json:"tag"`

	Colname string `json:"colname"`
	// TypeName is the column's type for the catalog. When Typeless is set
	// the author wrote no type at all — SQLite allows it — and the column
	// prints without one, whatever TypeName carries.
	TypeName   *TypeName `json:"type_name,omitempty"`
	Typeless   bool      `json:"typeless"`
	IsNotNull  bool      `json:"is_not_null"`
	IsUnsigned bool      `json:"is_unsigned"`
	IsArray    bool      `json:"is_array"`
	ArrayDims  int       `json:"array_dims"`
	Vals       *List     `json:"vals,omitempty"`
	Length     *int      `json:"length,omitempty"`
	PrimaryKey bool      `json:"primary_key"`
	// IsHidden marks a column a relation offers by name without listing it,
	// like the column an sqlite fts5 table names after itself. The legacy
	// catalog drops hidden columns; the core catalog keeps them out of star
	// expansions and models.
	IsHidden bool `json:"is_hidden"`

	// From pg.ColumnDef
	Inhcount      int            `json:"inhcount"`
	IsLocal       bool           `json:"is_local"`
	IsFromType    bool           `json:"is_from_type"`
	IsFromParent  bool           `json:"is_from_parent"`
	Storage       byte           `json:"storage"`
	RawDefault    Node           `json:"raw_default,omitempty"`
	CookedDefault Node           `json:"cooked_default,omitempty"`
	Identity      byte           `json:"identity"`
	CollClause    *CollateClause `json:"coll_clause,omitempty"`
	CollOid       Oid            `json:"coll_oid"`
	Constraints   *List          `json:"constraints,omitempty"`
	Fdwoptions    *List          `json:"fdwoptions,omitempty"`
	Location      int            `json:"location"`
	Comment       string         `json:"comment"`
}

func (*ColumnDef) Format

func (n *ColumnDef) Format(buf *TrackedBuffer, d format.Dialect)

func (*ColumnDef) Pos

func (n *ColumnDef) Pos() int

type ColumnRef

type ColumnRef struct {
	Tag NodeTag[ColumnRef] `json:"tag"`

	Name string `json:"name"`

	// From pg.ColumnRef
	Fields   *List `json:"fields,omitempty"`
	Location int   `json:"location"`
}

func (*ColumnRef) Format

func (n *ColumnRef) Format(buf *TrackedBuffer, d format.Dialect)

func (*ColumnRef) Pos

func (n *ColumnRef) Pos() int

type CommandId

type CommandId uint32

func (*CommandId) Pos

func (n *CommandId) Pos() int

type Comment

type Comment struct {
	// Text is the comment as written, marker included ("-- x", "/* x */").
	Text  string
	Start int
	End   int
	// OwnLine reports that only blank space preceded the comment on its
	// line, so it leads the code after it rather than trailing the code
	// before it.
	OwnLine bool
}

Comment is a single SQL comment, positioned by byte offsets into the source the statement was parsed from — the same coordinates the engine parsers stamp on nodes.

func (Comment) Line

func (c Comment) Line() bool

Line reports whether the comment runs to the end of its line (-- or #), so nothing may be printed after it on the same line.

type CommentOnColumnStmt

type CommentOnColumnStmt struct {
	Tag NodeTag[CommentOnColumnStmt] `json:"tag"`

	Table   *TableName `json:"table,omitempty"`
	Col     *ColumnRef `json:"col,omitempty"`
	Comment *string    `json:"comment,omitempty"`
}

func (*CommentOnColumnStmt) Pos

func (n *CommentOnColumnStmt) Pos() int

type CommentOnSchemaStmt

type CommentOnSchemaStmt struct {
	Tag NodeTag[CommentOnSchemaStmt] `json:"tag"`

	Schema  *String `json:"schema,omitempty"`
	Comment *string `json:"comment,omitempty"`
}

func (*CommentOnSchemaStmt) Pos

func (n *CommentOnSchemaStmt) Pos() int

type CommentOnTableStmt

type CommentOnTableStmt struct {
	Tag NodeTag[CommentOnTableStmt] `json:"tag"`

	Table   *TableName `json:"table,omitempty"`
	Comment *string    `json:"comment,omitempty"`
}

func (*CommentOnTableStmt) Pos

func (n *CommentOnTableStmt) Pos() int

type CommentOnTypeStmt

type CommentOnTypeStmt struct {
	Tag NodeTag[CommentOnTypeStmt] `json:"tag"`

	Type    *TypeName `json:"type,omitempty"`
	Comment *string   `json:"comment,omitempty"`
}

func (*CommentOnTypeStmt) Pos

func (n *CommentOnTypeStmt) Pos() int

type CommentOnViewStmt

type CommentOnViewStmt struct {
	Tag NodeTag[CommentOnViewStmt] `json:"tag"`

	View    *TableName `json:"view,omitempty"`
	Comment *string    `json:"comment,omitempty"`
}

func (*CommentOnViewStmt) Pos

func (n *CommentOnViewStmt) Pos() int

type CommentStmt

type CommentStmt struct {
	Tag NodeTag[CommentStmt] `json:"tag"`

	Objtype ObjectType `json:"objtype"`
	Object  Node       `json:"object,omitempty"`
	Comment *string    `json:"comment,omitempty"`
}

func (*CommentStmt) Pos

func (n *CommentStmt) Pos() int

type CommentTable

type CommentTable struct {
	// contains filtered or unexported fields
}

CommentTable holds a statement's comments attached to its nodes. It is built once by AttachComments, before any printing (or, later, editing): each comment is classified against the statement's anchor nodes by source position and line, and from then on positions are never consulted again — the printer emits comments by node identity, which is what lets an edited or synthetic tree print its comments correctly.

func AttachComments

func AttachComments(raw *RawStmt, d format.Dialect, comments []Comment, src string) *CommentTable

AttachComments classifies a statement's interior comments against its nodes, producing the table the printer (and any future rewriting tool) works from. Placement follows gofmt's rules, decided here once from source positions and lines: a comment on the same line as the code before it trails that code; any other comment leads the first node printed after it; a comment after the last node trails the statement.

func (*CommentTable) Exhausted

func (t *CommentTable) Exhausted() bool

Exhausted reports whether every attached comment was printed.

type CommonTableExpr

type CommonTableExpr struct {
	Tag NodeTag[CommonTableExpr] `json:"tag"`

	Ctename          *string `json:"ctename,omitempty"`
	Aliascolnames    *List   `json:"aliascolnames,omitempty"`
	Ctequery         Node    `json:"ctequery,omitempty"`
	Location         int     `json:"location"`
	Cterecursive     bool    `json:"cterecursive"`
	Cterefcount      int     `json:"cterefcount"`
	Ctecolnames      *List   `json:"ctecolnames,omitempty"`
	Ctecoltypes      *List   `json:"ctecoltypes,omitempty"`
	Ctecoltypmods    *List   `json:"ctecoltypmods,omitempty"`
	Ctecolcollations *List   `json:"ctecolcollations,omitempty"`
}

func (*CommonTableExpr) Format

func (n *CommonTableExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*CommonTableExpr) Pos

func (n *CommonTableExpr) Pos() int

type CompositeTypeStmt

type CompositeTypeStmt struct {
	Tag NodeTag[CompositeTypeStmt] `json:"tag"`

	TypeName *TypeName `json:"type_name,omitempty"`
	// Coldeflist is the type's fields, each a ColumnDef.
	Coldeflist *List `json:"coldeflist,omitempty"`
}

func (*CompositeTypeStmt) Pos

func (n *CompositeTypeStmt) Pos() int

type Const

type Const struct {
	Tag NodeTag[Const] `json:"tag"`

	Xpr         Node  `json:"xpr,omitempty"`
	Consttype   Oid   `json:"consttype"`
	Consttypmod int32 `json:"consttypmod"`
	Constcollid Oid   `json:"constcollid"`
	Constlen    int   `json:"constlen"`
	Constvalue  Datum `json:"constvalue"`
	Constisnull bool  `json:"constisnull"`
	Constbyval  bool  `json:"constbyval"`
	Location    int   `json:"location"`
}

func (*Const) Pos

func (n *Const) Pos() int

type ConstrType

type ConstrType uint
const (
	ConstrTypeNull    ConstrType = 1
	ConstrTypeNotNull ConstrType = 2
)

The constraint kinds the analysis reads, numbered as PostgreSQL's parser numbers them, which is what an engine's converter records.

func (*ConstrType) Pos

func (n *ConstrType) Pos() int

type Constraint

type Constraint struct {
	Tag NodeTag[Constraint] `json:"tag"`

	Contype        ConstrType `json:"contype"`
	Conname        *string    `json:"conname,omitempty"`
	Deferrable     bool       `json:"deferrable"`
	Initdeferred   bool       `json:"initdeferred"`
	Location       int        `json:"location"`
	IsNoInherit    bool       `json:"is_no_inherit"`
	RawExpr        Node       `json:"raw_expr,omitempty"`
	CookedExpr     *string    `json:"cooked_expr,omitempty"`
	GeneratedWhen  byte       `json:"generated_when"`
	Keys           *List      `json:"keys,omitempty"`
	Exclusions     *List      `json:"exclusions,omitempty"`
	Options        *List      `json:"options,omitempty"`
	Indexname      *string    `json:"indexname,omitempty"`
	Indexspace     *string    `json:"indexspace,omitempty"`
	AccessMethod   *string    `json:"access_method,omitempty"`
	WhereClause    Node       `json:"where_clause,omitempty"`
	Pktable        *RangeVar  `json:"pktable,omitempty"`
	FkAttrs        *List      `json:"fk_attrs,omitempty"`
	PkAttrs        *List      `json:"pk_attrs,omitempty"`
	FkMatchtype    byte       `json:"fk_matchtype"`
	FkUpdAction    byte       `json:"fk_upd_action"`
	FkDelAction    byte       `json:"fk_del_action"`
	OldConpfeqop   *List      `json:"old_conpfeqop,omitempty"`
	OldPktableOid  Oid        `json:"old_pktable_oid"`
	SkipValidation bool       `json:"skip_validation"`
	InitiallyValid bool       `json:"initially_valid"`
}

func (*Constraint) Pos

func (n *Constraint) Pos() int

type ConstraintsSetStmt

type ConstraintsSetStmt struct {
	Tag NodeTag[ConstraintsSetStmt] `json:"tag"`

	Constraints *List `json:"constraints,omitempty"`
	Deferred    bool  `json:"deferred"`
}

func (*ConstraintsSetStmt) Pos

func (n *ConstraintsSetStmt) Pos() int

type ConvertRowtypeExpr

type ConvertRowtypeExpr struct {
	Tag NodeTag[ConvertRowtypeExpr] `json:"tag"`

	Xpr           Node         `json:"xpr,omitempty"`
	Arg           Node         `json:"arg,omitempty"`
	Resulttype    Oid          `json:"resulttype"`
	Convertformat CoercionForm `json:"convertformat"`
	Location      int          `json:"location"`
}

func (*ConvertRowtypeExpr) Pos

func (n *ConvertRowtypeExpr) Pos() int

type CopyStmt

type CopyStmt struct {
	Tag NodeTag[CopyStmt] `json:"tag"`

	Relation  *RangeVar `json:"relation,omitempty"`
	Query     Node      `json:"query,omitempty"`
	Attlist   *List     `json:"attlist,omitempty"`
	IsFrom    bool      `json:"is_from"`
	IsProgram bool      `json:"is_program"`
	Filename  *string   `json:"filename,omitempty"`
	Options   *List     `json:"options,omitempty"`
}

func (*CopyStmt) Pos

func (n *CopyStmt) Pos() int

type Cost

type Cost float64

func (*Cost) Pos

func (n *Cost) Pos() int

type CreateAmStmt

type CreateAmStmt struct {
	Tag NodeTag[CreateAmStmt] `json:"tag"`

	Amname      *string `json:"amname,omitempty"`
	HandlerName *List   `json:"handler_name,omitempty"`
	Amtype      byte    `json:"amtype"`
}

func (*CreateAmStmt) Pos

func (n *CreateAmStmt) Pos() int

type CreateCastStmt

type CreateCastStmt struct {
	Tag NodeTag[CreateCastStmt] `json:"tag"`

	Sourcetype *TypeName       `json:"sourcetype,omitempty"`
	Targettype *TypeName       `json:"targettype,omitempty"`
	Func       *ObjectWithArgs `json:"func,omitempty"`
	Context    CoercionContext `json:"context"`
	Inout      bool            `json:"inout"`
}

func (*CreateCastStmt) Pos

func (n *CreateCastStmt) Pos() int

type CreateConversionStmt

type CreateConversionStmt struct {
	Tag NodeTag[CreateConversionStmt] `json:"tag"`

	ConversionName  *List   `json:"conversion_name,omitempty"`
	ForEncodingName *string `json:"for_encoding_name,omitempty"`
	ToEncodingName  *string `json:"to_encoding_name,omitempty"`
	FuncName        *List   `json:"func_name,omitempty"`
	Def             bool    `json:"def"`
}

func (*CreateConversionStmt) Pos

func (n *CreateConversionStmt) Pos() int

type CreateDomainStmt

type CreateDomainStmt struct {
	Tag NodeTag[CreateDomainStmt] `json:"tag"`

	Domainname  *List          `json:"domainname,omitempty"`
	TypeName    *TypeName      `json:"type_name,omitempty"`
	CollClause  *CollateClause `json:"coll_clause,omitempty"`
	Constraints *List          `json:"constraints,omitempty"`
}

func (*CreateDomainStmt) Pos

func (n *CreateDomainStmt) Pos() int

type CreateEnumStmt

type CreateEnumStmt struct {
	Tag NodeTag[CreateEnumStmt] `json:"tag"`

	TypeName *TypeName `json:"type_name,omitempty"`
	Vals     *List     `json:"vals,omitempty"`
}

func (*CreateEnumStmt) Pos

func (n *CreateEnumStmt) Pos() int

type CreateEventTrigStmt

type CreateEventTrigStmt struct {
	Tag NodeTag[CreateEventTrigStmt] `json:"tag"`

	Trigname   *string `json:"trigname,omitempty"`
	Eventname  *string `json:"eventname,omitempty"`
	Whenclause *List   `json:"whenclause,omitempty"`
	Funcname   *List   `json:"funcname,omitempty"`
}

func (*CreateEventTrigStmt) Pos

func (n *CreateEventTrigStmt) Pos() int

type CreateExtensionStmt

type CreateExtensionStmt struct {
	Tag NodeTag[CreateExtensionStmt] `json:"tag"`

	Extname     *string `json:"extname,omitempty"`
	IfNotExists bool    `json:"if_not_exists"`
	Options     *List   `json:"options,omitempty"`
}

func (*CreateExtensionStmt) Format

func (n *CreateExtensionStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*CreateExtensionStmt) Pos

func (n *CreateExtensionStmt) Pos() int

type CreateFdwStmt

type CreateFdwStmt struct {
	Tag NodeTag[CreateFdwStmt] `json:"tag"`

	Fdwname     *string `json:"fdwname,omitempty"`
	FuncOptions *List   `json:"func_options,omitempty"`
	Options     *List   `json:"options,omitempty"`
}

func (*CreateFdwStmt) Pos

func (n *CreateFdwStmt) Pos() int

type CreateForeignServerStmt

type CreateForeignServerStmt struct {
	Tag NodeTag[CreateForeignServerStmt] `json:"tag"`

	Servername  *string `json:"servername,omitempty"`
	Servertype  *string `json:"servertype,omitempty"`
	Version     *string `json:"version,omitempty"`
	Fdwname     *string `json:"fdwname,omitempty"`
	IfNotExists bool    `json:"if_not_exists"`
	Options     *List   `json:"options,omitempty"`
}

func (*CreateForeignServerStmt) Pos

func (n *CreateForeignServerStmt) Pos() int

type CreateForeignTableStmt

type CreateForeignTableStmt struct {
	Tag NodeTag[CreateForeignTableStmt] `json:"tag"`

	Base       *CreateStmt `json:"base,omitempty"`
	Servername *string     `json:"servername,omitempty"`
	Options    *List       `json:"options,omitempty"`
}

func (*CreateForeignTableStmt) Pos

func (n *CreateForeignTableStmt) Pos() int

type CreateFunctionStmt

type CreateFunctionStmt struct {
	Tag NodeTag[CreateFunctionStmt] `json:"tag"`

	Replace    bool      `json:"replace"`
	Params     *List     `json:"params,omitempty"`
	ReturnType *TypeName `json:"return_type,omitempty"`
	Func       *FuncName `json:"func,omitempty"`
	// TODO: Understand these two fields
	Options    *List `json:"options,omitempty"`
	WithClause *List `json:"with_clause,omitempty"`
}

func (*CreateFunctionStmt) Format

func (n *CreateFunctionStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*CreateFunctionStmt) Pos

func (n *CreateFunctionStmt) Pos() int

type CreateOpClassItem

type CreateOpClassItem struct {
	Tag NodeTag[CreateOpClassItem] `json:"tag"`

	Itemtype    int             `json:"itemtype"`
	Name        *ObjectWithArgs `json:"name,omitempty"`
	Number      int             `json:"number"`
	OrderFamily *List           `json:"order_family,omitempty"`
	ClassArgs   *List           `json:"class_args,omitempty"`
	Storedtype  *TypeName       `json:"storedtype,omitempty"`
}

func (*CreateOpClassItem) Pos

func (n *CreateOpClassItem) Pos() int

type CreateOpClassStmt

type CreateOpClassStmt struct {
	Tag NodeTag[CreateOpClassStmt] `json:"tag"`

	Opclassname  *List     `json:"opclassname,omitempty"`
	Opfamilyname *List     `json:"opfamilyname,omitempty"`
	Amname       *string   `json:"amname,omitempty"`
	Datatype     *TypeName `json:"datatype,omitempty"`
	Items        *List     `json:"items,omitempty"`
	IsDefault    bool      `json:"is_default"`
}

func (*CreateOpClassStmt) Pos

func (n *CreateOpClassStmt) Pos() int

type CreateOpFamilyStmt

type CreateOpFamilyStmt struct {
	Tag NodeTag[CreateOpFamilyStmt] `json:"tag"`

	Opfamilyname *List   `json:"opfamilyname,omitempty"`
	Amname       *string `json:"amname,omitempty"`
}

func (*CreateOpFamilyStmt) Pos

func (n *CreateOpFamilyStmt) Pos() int

type CreatePLangStmt

type CreatePLangStmt struct {
	Tag NodeTag[CreatePLangStmt] `json:"tag"`

	Replace     bool    `json:"replace"`
	Plname      *string `json:"plname,omitempty"`
	Plhandler   *List   `json:"plhandler,omitempty"`
	Plinline    *List   `json:"plinline,omitempty"`
	Plvalidator *List   `json:"plvalidator,omitempty"`
	Pltrusted   bool    `json:"pltrusted"`
}

func (*CreatePLangStmt) Pos

func (n *CreatePLangStmt) Pos() int

type CreatePolicyStmt

type CreatePolicyStmt struct {
	Tag NodeTag[CreatePolicyStmt] `json:"tag"`

	PolicyName *string   `json:"policy_name,omitempty"`
	Table      *RangeVar `json:"table,omitempty"`
	CmdName    *string   `json:"cmd_name,omitempty"`
	Permissive bool      `json:"permissive"`
	Roles      *List     `json:"roles,omitempty"`
	Qual       Node      `json:"qual,omitempty"`
	WithCheck  Node      `json:"with_check,omitempty"`
}

func (*CreatePolicyStmt) Pos

func (n *CreatePolicyStmt) Pos() int

type CreatePublicationStmt

type CreatePublicationStmt struct {
	Tag NodeTag[CreatePublicationStmt] `json:"tag"`

	Pubname      *string `json:"pubname,omitempty"`
	Options      *List   `json:"options,omitempty"`
	Tables       *List   `json:"tables,omitempty"`
	ForAllTables bool    `json:"for_all_tables"`
}

func (*CreatePublicationStmt) Pos

func (n *CreatePublicationStmt) Pos() int

type CreateRangeStmt

type CreateRangeStmt struct {
	Tag NodeTag[CreateRangeStmt] `json:"tag"`

	TypeName *List `json:"type_name,omitempty"`
	Params   *List `json:"params,omitempty"`
}

func (*CreateRangeStmt) Pos

func (n *CreateRangeStmt) Pos() int

type CreateRoleStmt

type CreateRoleStmt struct {
	Tag NodeTag[CreateRoleStmt] `json:"tag"`

	StmtType RoleStmtType `json:"stmt_type"`
	Role     *string      `json:"role,omitempty"`
	Options  *List        `json:"options,omitempty"`
}

func (*CreateRoleStmt) Pos

func (n *CreateRoleStmt) Pos() int

type CreateSchemaStmt

type CreateSchemaStmt struct {
	Tag NodeTag[CreateSchemaStmt] `json:"tag"`

	Name        *string   `json:"name,omitempty"`
	SchemaElts  *List     `json:"schema_elts,omitempty"`
	Authrole    *RoleSpec `json:"authrole,omitempty"`
	IfNotExists bool      `json:"if_not_exists"`
}

func (*CreateSchemaStmt) Pos

func (n *CreateSchemaStmt) Pos() int

type CreateSeqStmt

type CreateSeqStmt struct {
	Tag NodeTag[CreateSeqStmt] `json:"tag"`

	Sequence    *RangeVar `json:"sequence,omitempty"`
	Options     *List     `json:"options,omitempty"`
	OwnerId     Oid       `json:"owner_id"`
	ForIdentity bool      `json:"for_identity"`
	IfNotExists bool      `json:"if_not_exists"`
}

func (*CreateSeqStmt) Pos

func (n *CreateSeqStmt) Pos() int

type CreateStatsStmt

type CreateStatsStmt struct {
	Tag NodeTag[CreateStatsStmt] `json:"tag"`

	Defnames    *List `json:"defnames,omitempty"`
	StatTypes   *List `json:"stat_types,omitempty"`
	Exprs       *List `json:"exprs,omitempty"`
	Relations   *List `json:"relations,omitempty"`
	IfNotExists bool  `json:"if_not_exists"`
}

func (*CreateStatsStmt) Pos

func (n *CreateStatsStmt) Pos() int

type CreateStmt

type CreateStmt struct {
	Tag NodeTag[CreateStmt] `json:"tag"`

	Relation       *RangeVar           `json:"relation,omitempty"`
	TableElts      *List               `json:"table_elts,omitempty"`
	InhRelations   *List               `json:"inh_relations,omitempty"`
	Partbound      *PartitionBoundSpec `json:"partbound,omitempty"`
	Partspec       *PartitionSpec      `json:"partspec,omitempty"`
	OfTypename     *TypeName           `json:"of_typename,omitempty"`
	Constraints    *List               `json:"constraints,omitempty"`
	Options        *List               `json:"options,omitempty"`
	Oncommit       OnCommitAction      `json:"oncommit"`
	Tablespacename *string             `json:"tablespacename,omitempty"`
	IfNotExists    bool                `json:"if_not_exists"`
}

func (*CreateStmt) Pos

func (n *CreateStmt) Pos() int

type CreateSubscriptionStmt

type CreateSubscriptionStmt struct {
	Tag NodeTag[CreateSubscriptionStmt] `json:"tag"`

	Subname     *string `json:"subname,omitempty"`
	Conninfo    *string `json:"conninfo,omitempty"`
	Publication *List   `json:"publication,omitempty"`
	Options     *List   `json:"options,omitempty"`
}

func (*CreateSubscriptionStmt) Pos

func (n *CreateSubscriptionStmt) Pos() int

type CreateTableAsStmt

type CreateTableAsStmt struct {
	Tag NodeTag[CreateTableAsStmt] `json:"tag"`

	Query        Node        `json:"query,omitempty"`
	Into         *IntoClause `json:"into,omitempty"`
	Relkind      ObjectType  `json:"relkind"`
	IsSelectInto bool        `json:"is_select_into"`
	IfNotExists  bool        `json:"if_not_exists"`
}

func (*CreateTableAsStmt) Pos

func (n *CreateTableAsStmt) Pos() int

type CreateTableSpaceStmt

type CreateTableSpaceStmt struct {
	Tag NodeTag[CreateTableSpaceStmt] `json:"tag"`

	Tablespacename *string   `json:"tablespacename,omitempty"`
	Owner          *RoleSpec `json:"owner,omitempty"`
	Location       *string   `json:"location,omitempty"`
	Options        *List     `json:"options,omitempty"`
}

func (*CreateTableSpaceStmt) Pos

func (n *CreateTableSpaceStmt) Pos() int

type CreateTableStmt

type CreateTableStmt struct {
	Tag NodeTag[CreateTableStmt] `json:"tag"`

	IfNotExists bool         `json:"if_not_exists"`
	Name        *TableName   `json:"name,omitempty"`
	Cols        []*ColumnDef `json:"cols,omitempty"`
	ReferTable  *TableName   `json:"refer_table,omitempty"`
	Comment     string       `json:"comment"`
	Inherits    []*TableName `json:"inherits,omitempty"`
	// Using names the module of a virtual table (SQLite's CREATE VIRTUAL
	// TABLE ... USING module(...)), and ModuleArgs carries the module's
	// argument list as written — its grammar belongs to the module, so the
	// arguments pass through verbatim; nil means the declaration had no
	// argument list at all. Cols still holds the columns sqlc derives from
	// the arguments for the catalog; the statement prints as its
	// declaration, not as those columns.
	Using      string   `json:"using"`
	ModuleArgs []string `json:"module_args,omitempty"`
	// ModuleArgsMultiline records that the declaration was written across
	// lines. The arguments carry no positions, so the printer cannot keep
	// the author's exact breaks and prints the canonical broken form — one
	// argument per line — instead.
	ModuleArgsMultiline bool `json:"module_args_multiline"`
	// Incomplete marks a statement whose source carried syntax this node
	// does not model — column or table constraints beyond plain NOT NULL
	// and PRIMARY KEY, table options, TEMP, or an AS SELECT body. No
	// faithful rendering exists for it.
	Incomplete bool `json:"incomplete"`
}

func (*CreateTableStmt) Format

func (n *CreateTableStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*CreateTableStmt) Pos

func (n *CreateTableStmt) Pos() int

type CreateTransformStmt

type CreateTransformStmt struct {
	Tag NodeTag[CreateTransformStmt] `json:"tag"`

	Replace  bool            `json:"replace"`
	TypeName *TypeName       `json:"type_name,omitempty"`
	Lang     *string         `json:"lang,omitempty"`
	Fromsql  *ObjectWithArgs `json:"fromsql,omitempty"`
	Tosql    *ObjectWithArgs `json:"tosql,omitempty"`
}

func (*CreateTransformStmt) Pos

func (n *CreateTransformStmt) Pos() int

type CreateTrigStmt

type CreateTrigStmt struct {
	Tag NodeTag[CreateTrigStmt] `json:"tag"`

	Trigname       *string   `json:"trigname,omitempty"`
	Relation       *RangeVar `json:"relation,omitempty"`
	Funcname       *List     `json:"funcname,omitempty"`
	Args           *List     `json:"args,omitempty"`
	Row            bool      `json:"row"`
	Timing         int16     `json:"timing"`
	Events         int16     `json:"events"`
	Columns        *List     `json:"columns,omitempty"`
	WhenClause     Node      `json:"when_clause,omitempty"`
	Isconstraint   bool      `json:"isconstraint"`
	TransitionRels *List     `json:"transition_rels,omitempty"`
	Deferrable     bool      `json:"deferrable"`
	Initdeferred   bool      `json:"initdeferred"`
	Constrrel      *RangeVar `json:"constrrel,omitempty"`
}

func (*CreateTrigStmt) Pos

func (n *CreateTrigStmt) Pos() int

type CreateUserMappingStmt

type CreateUserMappingStmt struct {
	Tag NodeTag[CreateUserMappingStmt] `json:"tag"`

	User        *RoleSpec `json:"user,omitempty"`
	Servername  *string   `json:"servername,omitempty"`
	IfNotExists bool      `json:"if_not_exists"`
	Options     *List     `json:"options,omitempty"`
}

func (*CreateUserMappingStmt) Pos

func (n *CreateUserMappingStmt) Pos() int

type CreatedbStmt

type CreatedbStmt struct {
	Tag NodeTag[CreatedbStmt] `json:"tag"`

	Dbname  *string `json:"dbname,omitempty"`
	Options *List   `json:"options,omitempty"`
}

func (*CreatedbStmt) Pos

func (n *CreatedbStmt) Pos() int

type CurrentOfExpr

type CurrentOfExpr struct {
	Tag NodeTag[CurrentOfExpr] `json:"tag"`

	Xpr         Node    `json:"xpr,omitempty"`
	Cvarno      Index   `json:"cvarno"`
	CursorName  *string `json:"cursor_name,omitempty"`
	CursorParam int     `json:"cursor_param"`
}

func (*CurrentOfExpr) Pos

func (n *CurrentOfExpr) Pos() int

type Datum

type Datum uintptr

func (*Datum) Pos

func (n *Datum) Pos() int

type DatumPtr

type DatumPtr Datum

func (*DatumPtr) Pos

func (n *DatumPtr) Pos() int

type DeallocateStmt

type DeallocateStmt struct {
	Tag NodeTag[DeallocateStmt] `json:"tag"`

	Name *string `json:"name,omitempty"`
}

func (*DeallocateStmt) Pos

func (n *DeallocateStmt) Pos() int

type DeclareCursorStmt

type DeclareCursorStmt struct {
	Tag NodeTag[DeclareCursorStmt] `json:"tag"`

	Portalname *string `json:"portalname,omitempty"`
	Options    int     `json:"options"`
	Query      Node    `json:"query,omitempty"`
}

func (*DeclareCursorStmt) Pos

func (n *DeclareCursorStmt) Pos() int

type DefElem

type DefElem struct {
	Tag NodeTag[DefElem] `json:"tag"`

	Defnamespace *string       `json:"defnamespace,omitempty"`
	Defname      *string       `json:"defname,omitempty"`
	Arg          Node          `json:"arg,omitempty"`
	Defaction    DefElemAction `json:"defaction"`
	Location     int           `json:"location"`
}

func (*DefElem) Format

func (n *DefElem) Format(buf *TrackedBuffer, d format.Dialect)

func (*DefElem) Pos

func (n *DefElem) Pos() int

type DefElemAction

type DefElemAction uint

func (*DefElemAction) Pos

func (n *DefElemAction) Pos() int

type DefineStmt

type DefineStmt struct {
	Tag NodeTag[DefineStmt] `json:"tag"`

	Kind        ObjectType `json:"kind"`
	Oldstyle    bool       `json:"oldstyle"`
	Defnames    *List      `json:"defnames,omitempty"`
	Args        *List      `json:"args,omitempty"`
	Definition  *List      `json:"definition,omitempty"`
	IfNotExists bool       `json:"if_not_exists"`
}

func (*DefineStmt) Pos

func (n *DefineStmt) Pos() int

type DeleteStmt

type DeleteStmt struct {
	Tag NodeTag[DeleteStmt] `json:"tag"`

	Relations     *List       `json:"relations,omitempty"`
	UsingClause   *List       `json:"using_clause,omitempty"`
	WhereClause   Node        `json:"where_clause,omitempty"`
	LimitCount    Node        `json:"limit_count,omitempty"`
	ReturningList *List       `json:"returning_list,omitempty"`
	WithClause    *WithClause `json:"with_clause,omitempty"`
	// MySQL multi-table DELETE support
	Targets    *List `json:"targets,omitempty"`     // Tables to delete from (e.g., jt.*, pt.*)
	FromClause Node  `json:"from_clause,omitempty"` // FROM clause with JOINs (Node to support JoinExpr)
	// PostgreSQL 18 RETURNING WITH (OLD AS ..., NEW AS ...) aliases
	ReturningOldAlias string `json:"returning_old_alias"`
	ReturningNewAlias string `json:"returning_new_alias"`
}

func (*DeleteStmt) Format

func (n *DeleteStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*DeleteStmt) Pos

func (n *DeleteStmt) Pos() int

type DiscardMode

type DiscardMode uint

func (*DiscardMode) Pos

func (n *DiscardMode) Pos() int

type DiscardStmt

type DiscardStmt struct {
	Tag NodeTag[DiscardStmt] `json:"tag"`

	Target DiscardMode `json:"target"`
}

func (*DiscardStmt) Pos

func (n *DiscardStmt) Pos() int

type DistinctExpr

type DistinctExpr OpExpr

func (*DistinctExpr) Pos

func (n *DistinctExpr) Pos() int

type DoStmt

type DoStmt struct {
	Tag NodeTag[DoStmt] `json:"tag"`

	Args *List `json:"args,omitempty"`
}

func (*DoStmt) Format

func (n *DoStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*DoStmt) Pos

func (n *DoStmt) Pos() int

type DropBehavior

type DropBehavior uint

func (*DropBehavior) Pos

func (n *DropBehavior) Pos() int

type DropFunctionStmt

type DropFunctionStmt struct {
	Tag NodeTag[DropFunctionStmt] `json:"tag"`

	Funcs     []*FuncSpec `json:"funcs,omitempty"`
	MissingOk bool        `json:"missing_ok"`
}

func (*DropFunctionStmt) Pos

func (n *DropFunctionStmt) Pos() int

type DropOwnedStmt

type DropOwnedStmt struct {
	Tag NodeTag[DropOwnedStmt] `json:"tag"`

	Roles    *List        `json:"roles,omitempty"`
	Behavior DropBehavior `json:"behavior"`
}

func (*DropOwnedStmt) Pos

func (n *DropOwnedStmt) Pos() int

type DropRoleStmt

type DropRoleStmt struct {
	Tag NodeTag[DropRoleStmt] `json:"tag"`

	Roles     *List `json:"roles,omitempty"`
	MissingOk bool  `json:"missing_ok"`
}

func (*DropRoleStmt) Pos

func (n *DropRoleStmt) Pos() int

type DropSchemaStmt

type DropSchemaStmt struct {
	Tag NodeTag[DropSchemaStmt] `json:"tag"`

	Schemas   []*String `json:"schemas,omitempty"`
	MissingOk bool      `json:"missing_ok"`
}

func (*DropSchemaStmt) Pos

func (n *DropSchemaStmt) Pos() int

type DropStmt

type DropStmt struct {
	Tag NodeTag[DropStmt] `json:"tag"`

	Objects    *List        `json:"objects,omitempty"`
	RemoveType ObjectType   `json:"remove_type"`
	Behavior   DropBehavior `json:"behavior"`
	MissingOk  bool         `json:"missing_ok"`
	Concurrent bool         `json:"concurrent"`
}

func (*DropStmt) Pos

func (n *DropStmt) Pos() int

type DropSubscriptionStmt

type DropSubscriptionStmt struct {
	Tag NodeTag[DropSubscriptionStmt] `json:"tag"`

	Subname   *string      `json:"subname,omitempty"`
	MissingOk bool         `json:"missing_ok"`
	Behavior  DropBehavior `json:"behavior"`
}

func (*DropSubscriptionStmt) Pos

func (n *DropSubscriptionStmt) Pos() int

type DropTableSpaceStmt

type DropTableSpaceStmt struct {
	Tag NodeTag[DropTableSpaceStmt] `json:"tag"`

	Tablespacename *string `json:"tablespacename,omitempty"`
	MissingOk      bool    `json:"missing_ok"`
}

func (*DropTableSpaceStmt) Pos

func (n *DropTableSpaceStmt) Pos() int

type DropTableStmt

type DropTableStmt struct {
	Tag NodeTag[DropTableStmt] `json:"tag"`

	IfExists bool         `json:"if_exists"`
	Tables   []*TableName `json:"tables,omitempty"`
}

func (*DropTableStmt) Pos

func (n *DropTableStmt) Pos() int

type DropTypeStmt

type DropTypeStmt struct {
	Tag NodeTag[DropTypeStmt] `json:"tag"`

	IfExists bool        `json:"if_exists"`
	Types    []*TypeName `json:"types,omitempty"`
}

func (*DropTypeStmt) Pos

func (n *DropTypeStmt) Pos() int

type DropUserMappingStmt

type DropUserMappingStmt struct {
	Tag NodeTag[DropUserMappingStmt] `json:"tag"`

	User       *RoleSpec `json:"user,omitempty"`
	Servername *string   `json:"servername,omitempty"`
	MissingOk  bool      `json:"missing_ok"`
}

func (*DropUserMappingStmt) Pos

func (n *DropUserMappingStmt) Pos() int

type DropdbStmt

type DropdbStmt struct {
	Tag NodeTag[DropdbStmt] `json:"tag"`

	Dbname    *string `json:"dbname,omitempty"`
	MissingOk bool    `json:"missing_ok"`
}

func (*DropdbStmt) Pos

func (n *DropdbStmt) Pos() int

type ExecuteStmt

type ExecuteStmt struct {
	Tag NodeTag[ExecuteStmt] `json:"tag"`

	Name   *string `json:"name,omitempty"`
	Params *List   `json:"params,omitempty"`
}

func (*ExecuteStmt) Pos

func (n *ExecuteStmt) Pos() int

type ExplainStmt

type ExplainStmt struct {
	Tag NodeTag[ExplainStmt] `json:"tag"`

	Query   Node  `json:"query,omitempty"`
	Options *List `json:"options,omitempty"`
}

func (*ExplainStmt) Pos

func (n *ExplainStmt) Pos() int

type Expr

type Expr struct {
	Tag NodeTag[Expr] `json:"tag"`
}

func (*Expr) Pos

func (n *Expr) Pos() int

type FetchDirection

type FetchDirection uint

func (*FetchDirection) Pos

func (n *FetchDirection) Pos() int

type FetchStmt

type FetchStmt struct {
	Tag NodeTag[FetchStmt] `json:"tag"`

	Direction  FetchDirection `json:"direction"`
	HowMany    int64          `json:"how_many"`
	Portalname *string        `json:"portalname,omitempty"`
	Ismove     bool           `json:"ismove"`
}

func (*FetchStmt) Pos

func (n *FetchStmt) Pos() int

type FieldSelect

type FieldSelect struct {
	Tag NodeTag[FieldSelect] `json:"tag"`

	Xpr          Node       `json:"xpr,omitempty"`
	Arg          Node       `json:"arg,omitempty"`
	Fieldnum     AttrNumber `json:"fieldnum"`
	Resulttype   Oid        `json:"resulttype"`
	Resulttypmod int32      `json:"resulttypmod"`
	Resultcollid Oid        `json:"resultcollid"`
}

func (*FieldSelect) Pos

func (n *FieldSelect) Pos() int

type FieldStore

type FieldStore struct {
	Tag NodeTag[FieldStore] `json:"tag"`

	Xpr        Node  `json:"xpr,omitempty"`
	Arg        Node  `json:"arg,omitempty"`
	Newvals    *List `json:"newvals,omitempty"`
	Fieldnums  *List `json:"fieldnums,omitempty"`
	Resulttype Oid   `json:"resulttype"`
}

func (*FieldStore) Pos

func (n *FieldStore) Pos() int

type File

type File struct {
	Stmts    []Statement
	Comments []Comment
}

File is a parsed query file: its statements together with the comments the parser's lexer saw. Engines whose parsers surface their trivia — the lexical channel of whitespace and comments the grammar never sees, in Roslyn's terminology — return it from ParseFile, so the formatter gets statements and comments from one lexer pass.

type Float

type Float struct {
	Tag NodeTag[Float] `json:"tag"`

	Str string `json:"str"`
}

func (*Float) Format

func (n *Float) Format(buf *TrackedBuffer, d format.Dialect)

func (*Float) Pos

func (n *Float) Pos() int

type FromExpr

type FromExpr struct {
	Tag NodeTag[FromExpr] `json:"tag"`

	Fromlist *List `json:"fromlist,omitempty"`
	Quals    Node  `json:"quals,omitempty"`
}

func (*FromExpr) Pos

func (n *FromExpr) Pos() int

type FuncCall

type FuncCall struct {
	Tag NodeTag[FuncCall] `json:"tag"`

	Func           *FuncName  `json:"func,omitempty"`
	Funcname       *List      `json:"funcname,omitempty"`
	Args           *List      `json:"args,omitempty"`
	AggOrder       *List      `json:"agg_order,omitempty"`
	AggFilter      Node       `json:"agg_filter,omitempty"`
	AggWithinGroup bool       `json:"agg_within_group"`
	AggStar        bool       `json:"agg_star"`
	AggDistinct    bool       `json:"agg_distinct"`
	FuncVariadic   bool       `json:"func_variadic"`
	Over           *WindowDef `json:"over,omitempty"`
	Separator      *string    `json:"separator,omitempty"` // MySQL GROUP_CONCAT SEPARATOR
	Location       int        `json:"location"`
}

func (*FuncCall) Format

func (n *FuncCall) Format(buf *TrackedBuffer, d format.Dialect)

func (*FuncCall) Pos

func (n *FuncCall) Pos() int

type FuncExpr

type FuncExpr struct {
	Tag NodeTag[FuncExpr] `json:"tag"`

	Xpr            Node         `json:"xpr,omitempty"`
	Funcid         Oid          `json:"funcid"`
	Funcresulttype Oid          `json:"funcresulttype"`
	Funcretset     bool         `json:"funcretset"`
	Funcvariadic   bool         `json:"funcvariadic"`
	Funcformat     CoercionForm `json:"funcformat"`
	Funccollid     Oid          `json:"funccollid"`
	Inputcollid    Oid          `json:"inputcollid"`
	Args           *List        `json:"args,omitempty"`
	Location       int          `json:"location"`
}

func (*FuncExpr) Pos

func (n *FuncExpr) Pos() int

type FuncName

type FuncName struct {
	Tag NodeTag[FuncName] `json:"tag"`

	Catalog string `json:"catalog"`
	Schema  string `json:"schema"`
	Name    string `json:"name"`
}

func (*FuncName) Format

func (n *FuncName) Format(buf *TrackedBuffer, d format.Dialect)

func (*FuncName) Pos

func (n *FuncName) Pos() int

type FuncParam

type FuncParam struct {
	Tag NodeTag[FuncParam] `json:"tag"`

	Name    *string       `json:"name,omitempty"`
	Type    *TypeName     `json:"type,omitempty"`
	DefExpr Node          `json:"def_expr,omitempty"` // Will always be &ast.TODO
	Mode    FuncParamMode `json:"mode"`
}

func (*FuncParam) Format

func (n *FuncParam) Format(buf *TrackedBuffer, d format.Dialect)

func (*FuncParam) Pos

func (n *FuncParam) Pos() int

type FuncParamMode

type FuncParamMode int
const (
	FuncParamIn FuncParamMode = iota
	FuncParamOut
	FuncParamInOut
	FuncParamVariadic
	FuncParamTable
	FuncParamDefault
)

type FuncSpec

type FuncSpec struct {
	Tag NodeTag[FuncSpec] `json:"tag"`

	Name    *FuncName   `json:"name,omitempty"`
	Args    []*TypeName `json:"args,omitempty"`
	HasArgs bool        `json:"has_args"`
}

func (*FuncSpec) Pos

func (n *FuncSpec) Pos() int

type FunctionParameter

type FunctionParameter struct {
	Tag NodeTag[FunctionParameter] `json:"tag"`

	Name    *string               `json:"name,omitempty"`
	ArgType *TypeName             `json:"arg_type,omitempty"`
	Mode    FunctionParameterMode `json:"mode"`
	Defexpr Node                  `json:"defexpr,omitempty"`
}

func (*FunctionParameter) Pos

func (n *FunctionParameter) Pos() int

type FunctionParameterMode

type FunctionParameterMode uint

func (*FunctionParameterMode) Pos

func (n *FunctionParameterMode) Pos() int

type GrantObjectType

type GrantObjectType uint

func (*GrantObjectType) Pos

func (n *GrantObjectType) Pos() int

type GrantRoleStmt

type GrantRoleStmt struct {
	Tag NodeTag[GrantRoleStmt] `json:"tag"`

	GrantedRoles *List        `json:"granted_roles,omitempty"`
	GranteeRoles *List        `json:"grantee_roles,omitempty"`
	IsGrant      bool         `json:"is_grant"`
	Grantor      *RoleSpec    `json:"grantor,omitempty"`
	Behavior     DropBehavior `json:"behavior"`
}

func (*GrantRoleStmt) Pos

func (n *GrantRoleStmt) Pos() int

type GrantStmt

type GrantStmt struct {
	Tag NodeTag[GrantStmt] `json:"tag"`

	IsGrant     bool            `json:"is_grant"`
	Targtype    GrantTargetType `json:"targtype"`
	Objtype     GrantObjectType `json:"objtype"`
	Objects     *List           `json:"objects,omitempty"`
	Privileges  *List           `json:"privileges,omitempty"`
	Grantees    *List           `json:"grantees,omitempty"`
	GrantOption bool            `json:"grant_option"`
	Behavior    DropBehavior    `json:"behavior"`
}

func (*GrantStmt) Pos

func (n *GrantStmt) Pos() int

type GrantTargetType

type GrantTargetType uint

func (*GrantTargetType) Pos

func (n *GrantTargetType) Pos() int

type GroupingFunc

type GroupingFunc struct {
	Tag NodeTag[GroupingFunc] `json:"tag"`

	Xpr         Node  `json:"xpr,omitempty"`
	Args        *List `json:"args,omitempty"`
	Refs        *List `json:"refs,omitempty"`
	Cols        *List `json:"cols,omitempty"`
	Agglevelsup Index `json:"agglevelsup"`
	Location    int   `json:"location"`
}

func (*GroupingFunc) Pos

func (n *GroupingFunc) Pos() int

type GroupingSet

type GroupingSet struct {
	Tag NodeTag[GroupingSet] `json:"tag"`

	Kind     GroupingSetKind `json:"kind"`
	Content  *List           `json:"content,omitempty"`
	Location int             `json:"location"`
}

func (*GroupingSet) Pos

func (n *GroupingSet) Pos() int

type GroupingSetKind

type GroupingSetKind uint

func (*GroupingSetKind) Pos

func (n *GroupingSetKind) Pos() int

type ImportForeignSchemaStmt

type ImportForeignSchemaStmt struct {
	Tag NodeTag[ImportForeignSchemaStmt] `json:"tag"`

	ServerName   *string                 `json:"server_name,omitempty"`
	RemoteSchema *string                 `json:"remote_schema,omitempty"`
	LocalSchema  *string                 `json:"local_schema,omitempty"`
	ListType     ImportForeignSchemaType `json:"list_type"`
	TableList    *List                   `json:"table_list,omitempty"`
	Options      *List                   `json:"options,omitempty"`
}

func (*ImportForeignSchemaStmt) Pos

func (n *ImportForeignSchemaStmt) Pos() int

type ImportForeignSchemaType

type ImportForeignSchemaType uint

func (*ImportForeignSchemaType) Pos

func (n *ImportForeignSchemaType) Pos() int

type In

type In struct {
	Tag NodeTag[In] `json:"tag"`

	// Expr is the value expression to be compared.
	Expr Node `json:"expr,omitempty"`
	// List is the list expression in compare list.
	List []Node `json:"list,omitempty"`
	// Not is true, the expression is "not in".
	Not bool `json:"not"`
	// Sel is the subquery, may be rewritten to other type of expression.
	Sel      Node `json:"sel,omitempty"`
	Location int  `json:"location"`
}

In describes a 'select foo in (bar, baz)' type statement, though there are multiple important variants handled.

func (*In) Format

func (n *In) Format(buf *TrackedBuffer, d format.Dialect)

Format formats the In expression.

func (*In) Pos

func (n *In) Pos() int

Pos returns the location.

type Index

type Index uint64

func (*Index) Pos

func (n *Index) Pos() int

type IndexElem

type IndexElem struct {
	Tag NodeTag[IndexElem] `json:"tag"`

	Name          *string     `json:"name,omitempty"`
	Expr          Node        `json:"expr,omitempty"`
	Indexcolname  *string     `json:"indexcolname,omitempty"`
	Collation     *List       `json:"collation,omitempty"`
	Opclass       *List       `json:"opclass,omitempty"`
	Ordering      SortByDir   `json:"ordering"`
	NullsOrdering SortByNulls `json:"nulls_ordering"`
}

func (*IndexElem) Format

func (n *IndexElem) Format(buf *TrackedBuffer, d format.Dialect)

func (*IndexElem) Pos

func (n *IndexElem) Pos() int

type IndexStmt

type IndexStmt struct {
	Tag NodeTag[IndexStmt] `json:"tag"`

	Idxname        *string   `json:"idxname,omitempty"`
	Relation       *RangeVar `json:"relation,omitempty"`
	AccessMethod   *string   `json:"access_method,omitempty"`
	TableSpace     *string   `json:"table_space,omitempty"`
	IndexParams    *List     `json:"index_params,omitempty"`
	Options        *List     `json:"options,omitempty"`
	WhereClause    Node      `json:"where_clause,omitempty"`
	ExcludeOpNames *List     `json:"exclude_op_names,omitempty"`
	Idxcomment     *string   `json:"idxcomment,omitempty"`
	IndexOid       Oid       `json:"index_oid"`
	Unique         bool      `json:"unique"`
	Primary        bool      `json:"primary"`
	Isconstraint   bool      `json:"isconstraint"`
	Deferrable     bool      `json:"deferrable"`
	Initdeferred   bool      `json:"initdeferred"`
	Transformed    bool      `json:"transformed"`
	Concurrent     bool      `json:"concurrent"`
	IfNotExists    bool      `json:"if_not_exists"`
}

func (*IndexStmt) Pos

func (n *IndexStmt) Pos() int

type InferClause

type InferClause struct {
	Tag NodeTag[InferClause] `json:"tag"`

	IndexElems  *List   `json:"index_elems,omitempty"`
	WhereClause Node    `json:"where_clause,omitempty"`
	Conname     *string `json:"conname,omitempty"`
	Location    int     `json:"location"`
}

func (*InferClause) Format

func (n *InferClause) Format(buf *TrackedBuffer, d format.Dialect)

func (*InferClause) Pos

func (n *InferClause) Pos() int

type InferenceElem

type InferenceElem struct {
	Tag NodeTag[InferenceElem] `json:"tag"`

	Xpr          Node `json:"xpr,omitempty"`
	Expr         Node `json:"expr,omitempty"`
	Infercollid  Oid  `json:"infercollid"`
	Inferopclass Oid  `json:"inferopclass"`
}

func (*InferenceElem) Pos

func (n *InferenceElem) Pos() int

type InlineCodeBlock

type InlineCodeBlock struct {
	Tag NodeTag[InlineCodeBlock] `json:"tag"`

	SourceText    *string `json:"source_text,omitempty"`
	LangOid       Oid     `json:"lang_oid"`
	LangIsTrusted bool    `json:"lang_is_trusted"`
}

func (*InlineCodeBlock) Pos

func (n *InlineCodeBlock) Pos() int

type InsertStmt

type InsertStmt struct {
	Tag NodeTag[InsertStmt] `json:"tag"`

	Relation             *RangeVar             `json:"relation,omitempty"`
	Cols                 *List                 `json:"cols,omitempty"`
	SelectStmt           Node                  `json:"select_stmt,omitempty"`
	OnConflictClause     *OnConflictClause     `json:"on_conflict_clause,omitempty"`
	OnDuplicateKeyUpdate *OnDuplicateKeyUpdate `json:"on_duplicate_key_update,omitempty"` // MySQL-specific
	ReturningList        *List                 `json:"returning_list,omitempty"`
	WithClause           *WithClause           `json:"with_clause,omitempty"`
	Override             OverridingKind        `json:"override"`
	DefaultValues        bool                  `json:"default_values"` // SQLite-specific: INSERT INTO ... DEFAULT VALUES
	// PostgreSQL 18 RETURNING WITH (OLD AS ..., NEW AS ...) aliases
	ReturningOldAlias string `json:"returning_old_alias"`
	ReturningNewAlias string `json:"returning_new_alias"`
}

func (*InsertStmt) Format

func (n *InsertStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*InsertStmt) Pos

func (n *InsertStmt) Pos() int

type Integer

type Integer struct {
	Tag NodeTag[Integer] `json:"tag"`

	Ival int64 `json:"ival"`
}

func (*Integer) Format

func (n *Integer) Format(buf *TrackedBuffer, d format.Dialect)

func (*Integer) Pos

func (n *Integer) Pos() int

type IntervalExpr

type IntervalExpr struct {
	Tag NodeTag[IntervalExpr] `json:"tag"`

	Value    Node   `json:"value,omitempty"`
	Unit     string `json:"unit"`
	Location int    `json:"location"`
}

IntervalExpr represents a MySQL INTERVAL expression like "INTERVAL 1 DAY"

func (*IntervalExpr) Format

func (n *IntervalExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*IntervalExpr) Pos

func (n *IntervalExpr) Pos() int

type IntoClause

type IntoClause struct {
	Tag NodeTag[IntoClause] `json:"tag"`

	Rel            *RangeVar      `json:"rel,omitempty"`
	ColNames       *List          `json:"col_names,omitempty"`
	Options        *List          `json:"options,omitempty"`
	OnCommit       OnCommitAction `json:"on_commit"`
	TableSpaceName *string        `json:"table_space_name,omitempty"`
	ViewQuery      Node           `json:"view_query,omitempty"`
	SkipData       bool           `json:"skip_data"`
}

func (*IntoClause) Pos

func (n *IntoClause) Pos() int

type JoinExpr

type JoinExpr struct {
	Tag NodeTag[JoinExpr] `json:"tag"`

	Jointype    JoinType `json:"jointype"`
	IsNatural   bool     `json:"is_natural"`
	Larg        Node     `json:"larg,omitempty"`
	Rarg        Node     `json:"rarg,omitempty"`
	UsingClause *List    `json:"using_clause,omitempty"`
	Quals       Node     `json:"quals,omitempty"`
	Alias       *Alias   `json:"alias,omitempty"`
	Rtindex     int      `json:"rtindex"`
}

func (*JoinExpr) Format

func (n *JoinExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*JoinExpr) Pos

func (n *JoinExpr) Pos() int

type JoinType

type JoinType uint
const (
	JoinTypeInner JoinType
	JoinTypeLeft
	JoinTypeFull
	JoinTypeRight
	JoinTypeSemi
	JoinTypeAnti
	JoinTypeUniqueOuter
	JoinTypeUniqueInner
	// Beyond the libpg_query set: joins SQLite spells (and treats)
	// distinctly. Both behave as inner joins, but CROSS JOIN carries a
	// planner hint — SQLite will not reorder the pair — and a
	// comma-separated FROM item is its own syntax, so neither may be
	// rewritten into the other.
	JoinTypeCross
	JoinTypeComma
)

JoinType is the reported type of the join Enum copies https://github.com/pganalyze/libpg_query/blob/13-latest/protobuf/pg_query.proto#L2890-L2901

func (*JoinType) Pos

func (n *JoinType) Pos() int

type List

type List struct {
	Tag NodeTag[List] `json:"tag"`

	Items []Node `json:"items,omitempty"`
}

func (*List) Format

func (n *List) Format(buf *TrackedBuffer, d format.Dialect)

func (*List) Pos

func (n *List) Pos() int

type ListenStmt

type ListenStmt struct {
	Tag NodeTag[ListenStmt] `json:"tag"`

	Conditionname *string `json:"conditionname,omitempty"`
}

func (*ListenStmt) Format

func (n *ListenStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*ListenStmt) Pos

func (n *ListenStmt) Pos() int

type LoadStmt

type LoadStmt struct {
	Tag NodeTag[LoadStmt] `json:"tag"`

	Filename *string `json:"filename,omitempty"`
}

func (*LoadStmt) Pos

func (n *LoadStmt) Pos() int

type LocalTransactionId

type LocalTransactionId uint32

func (*LocalTransactionId) Pos

func (n *LocalTransactionId) Pos() int

type LockClauseStrength

type LockClauseStrength uint
const (
	LockClauseStrengthUndefined      LockClauseStrength = 0
	LockClauseStrengthNone           LockClauseStrength = 1
	LockClauseStrengthForKeyShare    LockClauseStrength = 2
	LockClauseStrengthForShare       LockClauseStrength = 3
	LockClauseStrengthForNoKeyUpdate LockClauseStrength = 4
	LockClauseStrengthForUpdate      LockClauseStrength = 5
)

LockClauseStrength values (matching pg_query_go)

func (*LockClauseStrength) Pos

func (n *LockClauseStrength) Pos() int

type LockStmt

type LockStmt struct {
	Tag NodeTag[LockStmt] `json:"tag"`

	Relations *List `json:"relations,omitempty"`
	Mode      int   `json:"mode"`
	Nowait    bool  `json:"nowait"`
}

func (*LockStmt) Pos

func (n *LockStmt) Pos() int

type LockWaitPolicy

type LockWaitPolicy uint
const (
	LockWaitPolicyBlock LockWaitPolicy = 1
	LockWaitPolicySkip  LockWaitPolicy = 2
	LockWaitPolicyError LockWaitPolicy = 3
)

LockWaitPolicy values

func (*LockWaitPolicy) Pos

func (n *LockWaitPolicy) Pos() int

type LockingClause

type LockingClause struct {
	Tag NodeTag[LockingClause] `json:"tag"`

	LockedRels *List              `json:"locked_rels,omitempty"`
	Strength   LockClauseStrength `json:"strength"`
	WaitPolicy LockWaitPolicy     `json:"wait_policy"`
}

func (*LockingClause) Format

func (n *LockingClause) Format(buf *TrackedBuffer, d format.Dialect)

func (*LockingClause) Pos

func (n *LockingClause) Pos() int

type MinMaxExpr

type MinMaxExpr struct {
	Tag NodeTag[MinMaxExpr] `json:"tag"`

	Xpr          Node     `json:"xpr,omitempty"`
	Minmaxtype   Oid      `json:"minmaxtype"`
	Minmaxcollid Oid      `json:"minmaxcollid"`
	Inputcollid  Oid      `json:"inputcollid"`
	Op           MinMaxOp `json:"op"`
	Args         *List    `json:"args,omitempty"`
	Location     int      `json:"location"`
}

func (*MinMaxExpr) Pos

func (n *MinMaxExpr) Pos() int

type MinMaxOp

type MinMaxOp uint

func (*MinMaxOp) Pos

func (n *MinMaxOp) Pos() int

type MultiAssignRef

type MultiAssignRef struct {
	Tag NodeTag[MultiAssignRef] `json:"tag"`

	Source   Node `json:"source,omitempty"`
	Colno    int  `json:"colno"`
	Ncolumns int  `json:"ncolumns"`
}

func (*MultiAssignRef) Format

func (n *MultiAssignRef) Format(buf *TrackedBuffer, d format.Dialect)

func (*MultiAssignRef) Pos

func (n *MultiAssignRef) Pos() int

type MultiXactId

type MultiXactId TransactionId

func (*MultiXactId) Pos

func (n *MultiXactId) Pos() int

type MultiXactOffset

type MultiXactOffset uint32

func (*MultiXactOffset) Pos

func (n *MultiXactOffset) Pos() int

type NamedArgExpr

type NamedArgExpr struct {
	Tag NodeTag[NamedArgExpr] `json:"tag"`

	Xpr       Node    `json:"xpr,omitempty"`
	Arg       Node    `json:"arg,omitempty"`
	Name      *string `json:"name,omitempty"`
	Argnumber int     `json:"argnumber"`
	Location  int     `json:"location"`
}

func (*NamedArgExpr) Format

func (n *NamedArgExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*NamedArgExpr) Pos

func (n *NamedArgExpr) Pos() int

type NextValueExpr

type NextValueExpr struct {
	Tag NodeTag[NextValueExpr] `json:"tag"`

	Xpr    Node `json:"xpr,omitempty"`
	Seqid  Oid  `json:"seqid"`
	TypeId Oid  `json:"type_id"`
}

func (*NextValueExpr) Pos

func (n *NextValueExpr) Pos() int

type Node

type Node interface {
	Pos() int
}

type NodeTag

type NodeTag[T any] struct{}

NodeTag names its containing node type in JSON.

Node is an interface, so the JSON encoding of an AST would otherwise carry no record of which node a given object is. Nodes with no fields of their own (A_Star, Null, TODO) would all encode as "{}", and an empty List would be indistinguishable from them. Every node struct instead declares

Tag NodeTag[T] `json:"tag"`

as its first field, with T the node's own type. The field is zero-sized and its zero value is valid, so constructing nodes as struct literals is unaffected; encoding/json calls MarshalJSON on the field, and the type parameter carries the node's identity to it at compile time.

func (NodeTag[T]) MarshalJSON

func (NodeTag[T]) MarshalJSON() ([]byte, error)

func (*NodeTag[T]) UnmarshalJSON

func (*NodeTag[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts only the containing node's own name, so a document decoded into the wrong node type is an error rather than a silently misfielded tree.

type NotifyStmt

type NotifyStmt struct {
	Tag NodeTag[NotifyStmt] `json:"tag"`

	Conditionname *string `json:"conditionname,omitempty"`
	Payload       *string `json:"payload,omitempty"`
}

func (*NotifyStmt) Format

func (n *NotifyStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*NotifyStmt) Pos

func (n *NotifyStmt) Pos() int

type Null

type Null struct {
	Tag NodeTag[Null] `json:"tag"`
}

func (*Null) Format

func (n *Null) Format(buf *TrackedBuffer, d format.Dialect)

func (*Null) Pos

func (n *Null) Pos() int

type NullIfExpr

type NullIfExpr OpExpr

func (*NullIfExpr) Format

func (n *NullIfExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*NullIfExpr) Pos

func (n *NullIfExpr) Pos() int

type NullTest

type NullTest struct {
	Tag NodeTag[NullTest] `json:"tag"`

	Xpr          Node         `json:"xpr,omitempty"`
	Arg          Node         `json:"arg,omitempty"`
	Nulltesttype NullTestType `json:"nulltesttype"`
	Argisrow     bool         `json:"argisrow"`
	Location     int          `json:"location"`
}

func (*NullTest) Format

func (n *NullTest) Format(buf *TrackedBuffer, d format.Dialect)

func (*NullTest) Pos

func (n *NullTest) Pos() int

type NullTestType

type NullTestType uint
const (
	NullTestTypeIsNull    NullTestType = 1
	NullTestTypeIsNotNull NullTestType = 2
)

NullTestType values

func (*NullTestType) Pos

func (n *NullTestType) Pos() int

type ObjectType

type ObjectType uint

func (*ObjectType) Pos

func (n *ObjectType) Pos() int

type ObjectWithArgs

type ObjectWithArgs struct {
	Tag NodeTag[ObjectWithArgs] `json:"tag"`

	Objname         *List `json:"objname,omitempty"`
	Objargs         *List `json:"objargs,omitempty"`
	ArgsUnspecified bool  `json:"args_unspecified"`
}

func (*ObjectWithArgs) Pos

func (n *ObjectWithArgs) Pos() int

type Offset

type Offset int64

func (*Offset) Pos

func (n *Offset) Pos() int

type Oid

type Oid uint64

func (*Oid) Pos

func (n *Oid) Pos() int

type OnCommitAction

type OnCommitAction uint

func (*OnCommitAction) Pos

func (n *OnCommitAction) Pos() int

type OnConflictAction

type OnConflictAction uint
const (
	OnConflictActionUndefined OnConflictAction = 0
	OnConflictActionNone      OnConflictAction = 1
	OnConflictActionNothing   OnConflictAction = 2
	OnConflictActionUpdate    OnConflictAction = 3
)

OnConflictAction values matching pg_query_go

func (*OnConflictAction) Pos

func (n *OnConflictAction) Pos() int

type OnConflictClause

type OnConflictClause struct {
	Tag NodeTag[OnConflictClause] `json:"tag"`

	Action      OnConflictAction `json:"action"`
	Infer       *InferClause     `json:"infer,omitempty"`
	TargetList  *List            `json:"target_list,omitempty"`
	WhereClause Node             `json:"where_clause,omitempty"`
	Location    int              `json:"location"`
}

func (*OnConflictClause) Format

func (n *OnConflictClause) Format(buf *TrackedBuffer, d format.Dialect)

func (*OnConflictClause) Pos

func (n *OnConflictClause) Pos() int

type OnConflictExpr

type OnConflictExpr struct {
	Tag NodeTag[OnConflictExpr] `json:"tag"`

	Action          OnConflictAction `json:"action"`
	ArbiterElems    *List            `json:"arbiter_elems,omitempty"`
	ArbiterWhere    Node             `json:"arbiter_where,omitempty"`
	Constraint      Oid              `json:"constraint"`
	OnConflictSet   *List            `json:"on_conflict_set,omitempty"`
	OnConflictWhere Node             `json:"on_conflict_where,omitempty"`
	ExclRelIndex    int              `json:"excl_rel_index"`
	ExclRelTlist    *List            `json:"excl_rel_tlist,omitempty"`
}

func (*OnConflictExpr) Pos

func (n *OnConflictExpr) Pos() int

type OnDuplicateKeyUpdate

type OnDuplicateKeyUpdate struct {
	Tag NodeTag[OnDuplicateKeyUpdate] `json:"tag"`

	// TargetList contains the assignments (column = value pairs)
	TargetList *List `json:"target_list,omitempty"`
	Location   int   `json:"location"`
}

OnDuplicateKeyUpdate represents MySQL's ON DUPLICATE KEY UPDATE clause

func (*OnDuplicateKeyUpdate) Format

func (n *OnDuplicateKeyUpdate) Format(buf *TrackedBuffer, d format.Dialect)

func (*OnDuplicateKeyUpdate) Pos

func (n *OnDuplicateKeyUpdate) Pos() int

type OpExpr

type OpExpr struct {
	Tag NodeTag[OpExpr] `json:"tag"`

	Xpr          Node  `json:"xpr,omitempty"`
	Opno         Oid   `json:"opno"`
	Opresulttype Oid   `json:"opresulttype"`
	Opretset     bool  `json:"opretset"`
	Opcollid     Oid   `json:"opcollid"`
	Inputcollid  Oid   `json:"inputcollid"`
	Args         *List `json:"args,omitempty"`
	Location     int   `json:"location"`
}

func (*OpExpr) Pos

func (n *OpExpr) Pos() int

type OverridingKind

type OverridingKind uint

func (*OverridingKind) Pos

func (n *OverridingKind) Pos() int

type Param

type Param struct {
	Tag NodeTag[Param] `json:"tag"`

	Xpr         Node      `json:"xpr,omitempty"`
	Paramkind   ParamKind `json:"paramkind"`
	Paramid     int       `json:"paramid"`
	Paramtype   Oid       `json:"paramtype"`
	Paramtypmod int32     `json:"paramtypmod"`
	Paramcollid Oid       `json:"paramcollid"`
	Location    int       `json:"location"`
}

func (*Param) Pos

func (n *Param) Pos() int

type ParamExecData

type ParamExecData struct {
	Tag NodeTag[ParamExecData] `json:"tag"`

	ExecPlan any   `json:"exec_plan,omitempty"`
	Value    Datum `json:"value"`
	Isnull   bool  `json:"isnull"`
}

func (*ParamExecData) Pos

func (n *ParamExecData) Pos() int

type ParamExternData

type ParamExternData struct {
	Tag NodeTag[ParamExternData] `json:"tag"`

	Value  Datum  `json:"value"`
	Isnull bool   `json:"isnull"`
	Pflags uint16 `json:"pflags"`
	Ptype  Oid    `json:"ptype"`
}

func (*ParamExternData) Pos

func (n *ParamExternData) Pos() int

type ParamKind

type ParamKind uint

func (*ParamKind) Pos

func (n *ParamKind) Pos() int

type ParamListInfo

type ParamListInfo ParamListInfoData

func (*ParamListInfo) Pos

func (n *ParamListInfo) Pos() int

type ParamListInfoData

type ParamListInfoData struct {
	Tag NodeTag[ParamListInfoData] `json:"tag"`

	ParamFetchArg  any      `json:"param_fetch_arg,omitempty"`
	ParserSetupArg any      `json:"parser_setup_arg,omitempty"`
	NumParams      int      `json:"num_params"`
	ParamMask      []uint32 `json:"param_mask,omitempty"`
}

func (*ParamListInfoData) Pos

func (n *ParamListInfoData) Pos() int

type ParamRef

type ParamRef struct {
	Tag NodeTag[ParamRef] `json:"tag"`

	Number   int  `json:"number"`
	Location int  `json:"location"`
	Dollar   bool `json:"dollar"`
	// Name is the name the query gave the placeholder, when its syntax
	// has one: ClickHouse's {name:Type}.
	Name string `json:"name,omitempty"`
}

func (*ParamRef) Format

func (n *ParamRef) Format(buf *TrackedBuffer, d format.Dialect)

func (*ParamRef) Pos

func (n *ParamRef) Pos() int

type ParenExpr

type ParenExpr struct {
	Tag NodeTag[ParenExpr] `json:"tag"`

	Expr     Node `json:"expr,omitempty"`
	Location int  `json:"location"`
}

ParenExpr represents a parenthesized expression

func (*ParenExpr) Format

func (n *ParenExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*ParenExpr) Pos

func (n *ParenExpr) Pos() int

type PartitionBoundSpec

type PartitionBoundSpec struct {
	Tag NodeTag[PartitionBoundSpec] `json:"tag"`

	Strategy    byte  `json:"strategy"`
	Listdatums  *List `json:"listdatums,omitempty"`
	Lowerdatums *List `json:"lowerdatums,omitempty"`
	Upperdatums *List `json:"upperdatums,omitempty"`
	Location    int   `json:"location"`
}

func (*PartitionBoundSpec) Pos

func (n *PartitionBoundSpec) Pos() int

type PartitionCmd

type PartitionCmd struct {
	Tag NodeTag[PartitionCmd] `json:"tag"`

	Name  *RangeVar           `json:"name,omitempty"`
	Bound *PartitionBoundSpec `json:"bound,omitempty"`
}

func (*PartitionCmd) Pos

func (n *PartitionCmd) Pos() int

type PartitionElem

type PartitionElem struct {
	Tag NodeTag[PartitionElem] `json:"tag"`

	Name      *string `json:"name,omitempty"`
	Expr      Node    `json:"expr,omitempty"`
	Collation *List   `json:"collation,omitempty"`
	Opclass   *List   `json:"opclass,omitempty"`
	Location  int     `json:"location"`
}

func (*PartitionElem) Pos

func (n *PartitionElem) Pos() int

type PartitionRangeDatum

type PartitionRangeDatum struct {
	Tag NodeTag[PartitionRangeDatum] `json:"tag"`

	Kind     PartitionRangeDatumKind `json:"kind"`
	Value    Node                    `json:"value,omitempty"`
	Location int                     `json:"location"`
}

func (*PartitionRangeDatum) Pos

func (n *PartitionRangeDatum) Pos() int

type PartitionRangeDatumKind

type PartitionRangeDatumKind uint

func (*PartitionRangeDatumKind) Pos

func (n *PartitionRangeDatumKind) Pos() int

type PartitionSpec

type PartitionSpec struct {
	Tag NodeTag[PartitionSpec] `json:"tag"`

	Strategy   *string `json:"strategy,omitempty"`
	PartParams *List   `json:"part_params,omitempty"`
	Location   int     `json:"location"`
}

func (*PartitionSpec) Pos

func (n *PartitionSpec) Pos() int

type Pointer

type Pointer byte

func (*Pointer) Pos

func (n *Pointer) Pos() int

type PrepareStmt

type PrepareStmt struct {
	Tag NodeTag[PrepareStmt] `json:"tag"`

	Name     *string `json:"name,omitempty"`
	Argtypes *List   `json:"argtypes,omitempty"`
	Query    Node    `json:"query,omitempty"`
}

func (*PrepareStmt) Pos

func (n *PrepareStmt) Pos() int

type Query

type Query struct {
	Tag NodeTag[Query] `json:"tag"`

	CommandType      CmdType         `json:"command_type"`
	QuerySource      QuerySource     `json:"query_source"`
	QueryId          uint32          `json:"query_id"`
	CanSetTag        bool            `json:"can_set_tag"`
	UtilityStmt      Node            `json:"utility_stmt,omitempty"`
	ResultRelation   int             `json:"result_relation"`
	HasAggs          bool            `json:"has_aggs"`
	HasWindowFuncs   bool            `json:"has_window_funcs"`
	HasTargetSrfs    bool            `json:"has_target_srfs"`
	HasSubLinks      bool            `json:"has_sub_links"`
	HasDistinctOn    bool            `json:"has_distinct_on"`
	HasRecursive     bool            `json:"has_recursive"`
	HasModifyingCte  bool            `json:"has_modifying_cte"`
	HasForUpdate     bool            `json:"has_for_update"`
	HasRowSecurity   bool            `json:"has_row_security"`
	CteList          *List           `json:"cte_list,omitempty"`
	Rtable           *List           `json:"rtable,omitempty"`
	Jointree         *FromExpr       `json:"jointree,omitempty"`
	TargetList       *List           `json:"target_list,omitempty"`
	Override         OverridingKind  `json:"override"`
	OnConflict       *OnConflictExpr `json:"on_conflict,omitempty"`
	ReturningList    *List           `json:"returning_list,omitempty"`
	GroupClause      *List           `json:"group_clause,omitempty"`
	GroupingSets     *List           `json:"grouping_sets,omitempty"`
	HavingQual       Node            `json:"having_qual,omitempty"`
	WindowClause     *List           `json:"window_clause,omitempty"`
	DistinctClause   *List           `json:"distinct_clause,omitempty"`
	SortClause       *List           `json:"sort_clause,omitempty"`
	LimitOffset      Node            `json:"limit_offset,omitempty"`
	LimitCount       Node            `json:"limit_count,omitempty"`
	RowMarks         *List           `json:"row_marks,omitempty"`
	SetOperations    Node            `json:"set_operations,omitempty"`
	ConstraintDeps   *List           `json:"constraint_deps,omitempty"`
	WithCheckOptions *List           `json:"with_check_options,omitempty"`
	StmtLocation     int             `json:"stmt_location"`
	StmtLen          int             `json:"stmt_len"`
}

func (*Query) Pos

func (n *Query) Pos() int

type QuerySource

type QuerySource uint

func (*QuerySource) Pos

func (n *QuerySource) Pos() int

type RTEKind

type RTEKind uint

func (*RTEKind) Pos

func (n *RTEKind) Pos() int

type RangeFunction

type RangeFunction struct {
	Tag NodeTag[RangeFunction] `json:"tag"`

	Lateral    bool   `json:"lateral"`
	Ordinality bool   `json:"ordinality"`
	IsRowsfrom bool   `json:"is_rowsfrom"`
	Functions  *List  `json:"functions,omitempty"`
	Alias      *Alias `json:"alias,omitempty"`
	Coldeflist *List  `json:"coldeflist,omitempty"`
}

func (*RangeFunction) Format

func (n *RangeFunction) Format(buf *TrackedBuffer, d format.Dialect)

func (*RangeFunction) Pos

func (n *RangeFunction) Pos() int

type RangeSubselect

type RangeSubselect struct {
	Tag NodeTag[RangeSubselect] `json:"tag"`

	Lateral  bool   `json:"lateral"`
	Subquery Node   `json:"subquery,omitempty"`
	Alias    *Alias `json:"alias,omitempty"`
}

func (*RangeSubselect) Format

func (n *RangeSubselect) Format(buf *TrackedBuffer, d format.Dialect)

func (*RangeSubselect) Pos

func (n *RangeSubselect) Pos() int

type RangeTableFunc

type RangeTableFunc struct {
	Tag NodeTag[RangeTableFunc] `json:"tag"`

	Lateral    bool   `json:"lateral"`
	Docexpr    Node   `json:"docexpr,omitempty"`
	Rowexpr    Node   `json:"rowexpr,omitempty"`
	Namespaces *List  `json:"namespaces,omitempty"`
	Columns    *List  `json:"columns,omitempty"`
	Alias      *Alias `json:"alias,omitempty"`
	Location   int    `json:"location"`
}

func (*RangeTableFunc) Pos

func (n *RangeTableFunc) Pos() int

type RangeTableFuncCol

type RangeTableFuncCol struct {
	Tag NodeTag[RangeTableFuncCol] `json:"tag"`

	Colname       *string   `json:"colname,omitempty"`
	TypeName      *TypeName `json:"type_name,omitempty"`
	ForOrdinality bool      `json:"for_ordinality"`
	IsNotNull     bool      `json:"is_not_null"`
	Colexpr       Node      `json:"colexpr,omitempty"`
	Coldefexpr    Node      `json:"coldefexpr,omitempty"`
	Location      int       `json:"location"`
}

func (*RangeTableFuncCol) Pos

func (n *RangeTableFuncCol) Pos() int

type RangeTableSample

type RangeTableSample struct {
	Tag NodeTag[RangeTableSample] `json:"tag"`

	Relation   Node  `json:"relation,omitempty"`
	Method     *List `json:"method,omitempty"`
	Args       *List `json:"args,omitempty"`
	Repeatable Node  `json:"repeatable,omitempty"`
	Location   int   `json:"location"`
}

func (*RangeTableSample) Pos

func (n *RangeTableSample) Pos() int

type RangeTblEntry

type RangeTblEntry struct {
	Tag NodeTag[RangeTblEntry] `json:"tag"`

	Rtekind         RTEKind            `json:"rtekind"`
	Relid           Oid                `json:"relid"`
	Relkind         byte               `json:"relkind"`
	Tablesample     *TableSampleClause `json:"tablesample,omitempty"`
	Subquery        *Query             `json:"subquery,omitempty"`
	SecurityBarrier bool               `json:"security_barrier"`
	Jointype        JoinType           `json:"jointype"`
	Joinaliasvars   *List              `json:"joinaliasvars,omitempty"`
	Functions       *List              `json:"functions,omitempty"`
	Funcordinality  bool               `json:"funcordinality"`
	Tablefunc       *TableFunc         `json:"tablefunc,omitempty"`
	ValuesLists     *List              `json:"values_lists,omitempty"`
	Ctename         *string            `json:"ctename,omitempty"`
	Ctelevelsup     Index              `json:"ctelevelsup"`
	SelfReference   bool               `json:"self_reference"`
	Coltypes        *List              `json:"coltypes,omitempty"`
	Coltypmods      *List              `json:"coltypmods,omitempty"`
	Colcollations   *List              `json:"colcollations,omitempty"`
	Enrname         *string            `json:"enrname,omitempty"`
	Enrtuples       float64            `json:"enrtuples"`
	Alias           *Alias             `json:"alias,omitempty"`
	Eref            *Alias             `json:"eref,omitempty"`
	Lateral         bool               `json:"lateral"`
	Inh             bool               `json:"inh"`
	InFromCl        bool               `json:"in_from_cl"`
	RequiredPerms   AclMode            `json:"required_perms"`
	CheckAsUser     Oid                `json:"check_as_user"`
	SelectedCols    []uint32           `json:"selected_cols,omitempty"`
	InsertedCols    []uint32           `json:"inserted_cols,omitempty"`
	UpdatedCols     []uint32           `json:"updated_cols,omitempty"`
	SecurityQuals   *List              `json:"security_quals,omitempty"`
}

func (*RangeTblEntry) Pos

func (n *RangeTblEntry) Pos() int

type RangeTblFunction

type RangeTblFunction struct {
	Tag NodeTag[RangeTblFunction] `json:"tag"`

	Funcexpr          Node     `json:"funcexpr,omitempty"`
	Funccolcount      int      `json:"funccolcount"`
	Funccolnames      *List    `json:"funccolnames,omitempty"`
	Funccoltypes      *List    `json:"funccoltypes,omitempty"`
	Funccoltypmods    *List    `json:"funccoltypmods,omitempty"`
	Funccolcollations *List    `json:"funccolcollations,omitempty"`
	Funcparams        []uint32 `json:"funcparams,omitempty"`
}

func (*RangeTblFunction) Pos

func (n *RangeTblFunction) Pos() int

type RangeTblRef

type RangeTblRef struct {
	Tag NodeTag[RangeTblRef] `json:"tag"`

	Rtindex int `json:"rtindex"`
}

func (*RangeTblRef) Pos

func (n *RangeTblRef) Pos() int

type RangeVar

type RangeVar struct {
	Tag NodeTag[RangeVar] `json:"tag"`

	Catalogname    *string `json:"catalogname,omitempty"`
	Schemaname     *string `json:"schemaname,omitempty"`
	Relname        *string `json:"relname,omitempty"`
	Inh            bool    `json:"inh"`
	Relpersistence byte    `json:"relpersistence"`
	Alias          *Alias  `json:"alias,omitempty"`
	Location       int     `json:"location"`
}

func (*RangeVar) Format

func (n *RangeVar) Format(buf *TrackedBuffer, d format.Dialect)

func (*RangeVar) Pos

func (n *RangeVar) Pos() int

type RawStmt

type RawStmt struct {
	Tag NodeTag[RawStmt] `json:"tag"`

	Stmt         Node `json:"stmt,omitempty"`
	StmtLocation int  `json:"stmt_location"`
	StmtLen      int  `json:"stmt_len"`
}

func (*RawStmt) Format

func (n *RawStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*RawStmt) Pos

func (n *RawStmt) Pos() int

type ReassignOwnedStmt

type ReassignOwnedStmt struct {
	Tag NodeTag[ReassignOwnedStmt] `json:"tag"`

	Roles   *List     `json:"roles,omitempty"`
	Newrole *RoleSpec `json:"newrole,omitempty"`
}

func (*ReassignOwnedStmt) Pos

func (n *ReassignOwnedStmt) Pos() int

type RefreshMatViewStmt

type RefreshMatViewStmt struct {
	Tag NodeTag[RefreshMatViewStmt] `json:"tag"`

	Concurrent bool      `json:"concurrent"`
	SkipData   bool      `json:"skip_data"`
	Relation   *RangeVar `json:"relation,omitempty"`
}

func (*RefreshMatViewStmt) Format

func (n *RefreshMatViewStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*RefreshMatViewStmt) Pos

func (n *RefreshMatViewStmt) Pos() int

type RegProcedure

type RegProcedure regproc

func (*RegProcedure) Pos

func (n *RegProcedure) Pos() int

type ReindexObjectType

type ReindexObjectType uint

func (*ReindexObjectType) Pos

func (n *ReindexObjectType) Pos() int

type ReindexStmt

type ReindexStmt struct {
	Tag NodeTag[ReindexStmt] `json:"tag"`

	Kind     ReindexObjectType `json:"kind"`
	Relation *RangeVar         `json:"relation,omitempty"`
	Name     *string           `json:"name,omitempty"`
	Options  int               `json:"options"`
}

func (*ReindexStmt) Pos

func (n *ReindexStmt) Pos() int

type RelabelType

type RelabelType struct {
	Tag NodeTag[RelabelType] `json:"tag"`

	Xpr           Node         `json:"xpr,omitempty"`
	Arg           Node         `json:"arg,omitempty"`
	Resulttype    Oid          `json:"resulttype"`
	Resulttypmod  int32        `json:"resulttypmod"`
	Resultcollid  Oid          `json:"resultcollid"`
	Relabelformat CoercionForm `json:"relabelformat"`
	Location      int          `json:"location"`
}

func (*RelabelType) Pos

func (n *RelabelType) Pos() int

type RenameColumnStmt

type RenameColumnStmt struct {
	Tag NodeTag[RenameColumnStmt] `json:"tag"`

	Table     *TableName `json:"table,omitempty"`
	Col       *ColumnRef `json:"col,omitempty"`
	NewName   *string    `json:"new_name,omitempty"`
	MissingOk bool       `json:"missing_ok"`
}

func (*RenameColumnStmt) Pos

func (n *RenameColumnStmt) Pos() int

type RenameStmt

type RenameStmt struct {
	Tag NodeTag[RenameStmt] `json:"tag"`

	RenameType   ObjectType   `json:"rename_type"`
	RelationType ObjectType   `json:"relation_type"`
	Relation     *RangeVar    `json:"relation,omitempty"`
	Object       Node         `json:"object,omitempty"`
	Subname      *string      `json:"subname,omitempty"`
	Newname      *string      `json:"newname,omitempty"`
	Behavior     DropBehavior `json:"behavior"`
	MissingOk    bool         `json:"missing_ok"`
}

func (*RenameStmt) Pos

func (n *RenameStmt) Pos() int

type RenameTableStmt

type RenameTableStmt struct {
	Tag NodeTag[RenameTableStmt] `json:"tag"`

	Table     *TableName `json:"table,omitempty"`
	NewName   *string    `json:"new_name,omitempty"`
	MissingOk bool       `json:"missing_ok"`
}

func (*RenameTableStmt) Pos

func (n *RenameTableStmt) Pos() int

type RenameTypeStmt

type RenameTypeStmt struct {
	Tag NodeTag[RenameTypeStmt] `json:"tag"`

	Type    *TypeName `json:"type,omitempty"`
	NewName *string   `json:"new_name,omitempty"`
}

func (*RenameTypeStmt) Pos

func (n *RenameTypeStmt) Pos() int

type ReplicaIdentityStmt

type ReplicaIdentityStmt struct {
	Tag NodeTag[ReplicaIdentityStmt] `json:"tag"`

	IdentityType byte    `json:"identity_type"`
	Name         *string `json:"name,omitempty"`
}

func (*ReplicaIdentityStmt) Pos

func (n *ReplicaIdentityStmt) Pos() int

type ResTarget

type ResTarget struct {
	Tag NodeTag[ResTarget] `json:"tag"`

	Name        *string `json:"name,omitempty"`
	Indirection *List   `json:"indirection,omitempty"`
	Val         Node    `json:"val,omitempty"`
	Location    int     `json:"location"`
	// Relation qualifies Name in a multi-table UPDATE's SET list (MySQL:
	// SET t.col = ...). Analysis matches on Name alone; printing needs the
	// qualifier to keep the assignment on the table the author named.
	Relation *string `json:"relation,omitempty"`
}

func (*ResTarget) Format

func (n *ResTarget) Format(buf *TrackedBuffer, d format.Dialect)

func (*ResTarget) Pos

func (n *ResTarget) Pos() int

type RoleSpec

type RoleSpec struct {
	Tag NodeTag[RoleSpec] `json:"tag"`

	Roletype RoleSpecType `json:"roletype"`
	Rolename *string      `json:"rolename,omitempty"`
	Location int          `json:"location"`
}

func (*RoleSpec) Pos

func (n *RoleSpec) Pos() int

type RoleSpecType

type RoleSpecType uint

func (*RoleSpecType) Pos

func (n *RoleSpecType) Pos() int

type RoleStmtType

type RoleStmtType uint

func (*RoleStmtType) Pos

func (n *RoleStmtType) Pos() int

type RowCompareExpr

type RowCompareExpr struct {
	Tag NodeTag[RowCompareExpr] `json:"tag"`

	Xpr          Node           `json:"xpr,omitempty"`
	Rctype       RowCompareType `json:"rctype"`
	Opnos        *List          `json:"opnos,omitempty"`
	Opfamilies   *List          `json:"opfamilies,omitempty"`
	Inputcollids *List          `json:"inputcollids,omitempty"`
	Largs        *List          `json:"largs,omitempty"`
	Rargs        *List          `json:"rargs,omitempty"`
}

func (*RowCompareExpr) Pos

func (n *RowCompareExpr) Pos() int

type RowCompareType

type RowCompareType uint

func (*RowCompareType) Pos

func (n *RowCompareType) Pos() int

type RowExpr

type RowExpr struct {
	Tag NodeTag[RowExpr] `json:"tag"`

	Xpr       Node         `json:"xpr,omitempty"`
	Args      *List        `json:"args,omitempty"`
	RowTypeid Oid          `json:"row_typeid"`
	RowFormat CoercionForm `json:"row_format"`
	Colnames  *List        `json:"colnames,omitempty"`
	Location  int          `json:"location"`
}

func (*RowExpr) Format

func (n *RowExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*RowExpr) Pos

func (n *RowExpr) Pos() int

type RowMarkClause

type RowMarkClause struct {
	Tag NodeTag[RowMarkClause] `json:"tag"`

	Rti        Index              `json:"rti"`
	Strength   LockClauseStrength `json:"strength"`
	WaitPolicy LockWaitPolicy     `json:"wait_policy"`
	PushedDown bool               `json:"pushed_down"`
}

func (*RowMarkClause) Pos

func (n *RowMarkClause) Pos() int

type RuleStmt

type RuleStmt struct {
	Tag NodeTag[RuleStmt] `json:"tag"`

	Relation    *RangeVar `json:"relation,omitempty"`
	Rulename    *string   `json:"rulename,omitempty"`
	WhereClause Node      `json:"where_clause,omitempty"`
	Event       CmdType   `json:"event"`
	Instead     bool      `json:"instead"`
	Actions     *List     `json:"actions,omitempty"`
	Replace     bool      `json:"replace"`
}

func (*RuleStmt) Pos

func (n *RuleStmt) Pos() int

type SQLValueFunction

type SQLValueFunction struct {
	Tag NodeTag[SQLValueFunction] `json:"tag"`

	Xpr      Node               `json:"xpr,omitempty"`
	Op       SQLValueFunctionOp `json:"op"`
	Type     Oid                `json:"type"`
	Typmod   int32              `json:"typmod"`
	Location int                `json:"location"`
}

func (*SQLValueFunction) Format

func (n *SQLValueFunction) Format(buf *TrackedBuffer, d format.Dialect)

func (*SQLValueFunction) Pos

func (n *SQLValueFunction) Pos() int

type SQLValueFunctionOp

type SQLValueFunctionOp uint
const (
	SVFOpCurrentDate SQLValueFunctionOp
	SVFOpCurrentTime
	SVFOpCurrentTimeN
	SVFOpCurrentTimestamp
	SVFOpCurrentTimestampN
	SVFOpLocaltime
	SVFOpLocaltimeN
	SVFOpLocaltimestamp
	SVFOpLocaltimestampN
	SVFOpCurrentRole
	SVFOpCurrentUser
	SVFOpUser
	SVFOpSessionUser
	SVFOpCurrentCatalog
	SVFOpCurrentSchema
)

func (*SQLValueFunctionOp) Pos

func (n *SQLValueFunctionOp) Pos() int

type ScalarArrayOpExpr

type ScalarArrayOpExpr struct {
	Tag NodeTag[ScalarArrayOpExpr] `json:"tag"`

	Xpr         Node  `json:"xpr,omitempty"`
	Opno        Oid   `json:"opno"`
	UseOr       bool  `json:"use_or"`
	Inputcollid Oid   `json:"inputcollid"`
	Args        *List `json:"args,omitempty"`
	Location    int   `json:"location"`
}

func (*ScalarArrayOpExpr) Format

func (n *ScalarArrayOpExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*ScalarArrayOpExpr) Pos

func (n *ScalarArrayOpExpr) Pos() int

type ScanDirection

type ScanDirection uint

func (*ScanDirection) Pos

func (n *ScanDirection) Pos() int

type SecLabelStmt

type SecLabelStmt struct {
	Tag NodeTag[SecLabelStmt] `json:"tag"`

	Objtype  ObjectType `json:"objtype"`
	Object   Node       `json:"object,omitempty"`
	Provider *string    `json:"provider,omitempty"`
	Label    *string    `json:"label,omitempty"`
}

func (*SecLabelStmt) Pos

func (n *SecLabelStmt) Pos() int

type SelectStmt

type SelectStmt struct {
	Tag NodeTag[SelectStmt] `json:"tag"`

	DistinctClause *List        `json:"distinct_clause,omitempty"`
	IntoClause     *IntoClause  `json:"into_clause,omitempty"`
	TargetList     *List        `json:"target_list,omitempty"`
	FromClause     *List        `json:"from_clause,omitempty"`
	WhereClause    Node         `json:"where_clause,omitempty"`
	GroupClause    *List        `json:"group_clause,omitempty"`
	HavingClause   Node         `json:"having_clause,omitempty"`
	WindowClause   *List        `json:"window_clause,omitempty"`
	ValuesLists    *List        `json:"values_lists,omitempty"`
	SortClause     *List        `json:"sort_clause,omitempty"`
	LimitOffset    Node         `json:"limit_offset,omitempty"`
	LimitCount     Node         `json:"limit_count,omitempty"`
	LockingClause  *List        `json:"locking_clause,omitempty"`
	WithClause     *WithClause  `json:"with_clause,omitempty"`
	Op             SetOperation `json:"op"`
	All            bool         `json:"all"`
	Larg           *SelectStmt  `json:"larg,omitempty"`
	Rarg           *SelectStmt  `json:"rarg,omitempty"`
	// TableHints is the text inside a MySQL optimizer-hint comment
	// (SELECT /*+ MAX_EXECUTION_TIME(1000) */ ...). The compiler ignores
	// hints; printing keeps them because they change how the server runs
	// the query.
	TableHints string `json:"table_hints,omitempty"`
}

func (*SelectStmt) Format

func (n *SelectStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*SelectStmt) Pos

func (n *SelectStmt) Pos() int

type Selectivity

type Selectivity float64

func (*Selectivity) Pos

func (n *Selectivity) Pos() int

type SetOpCmd

type SetOpCmd uint

func (*SetOpCmd) Pos

func (n *SetOpCmd) Pos() int

type SetOpStrategy

type SetOpStrategy uint

func (*SetOpStrategy) Pos

func (n *SetOpStrategy) Pos() int

type SetOperation

type SetOperation uint
const (
	None SetOperation = iota
	Union
	Intersect
	Except
)

func (*SetOperation) Pos

func (n *SetOperation) Pos() int

func (SetOperation) String

func (n SetOperation) String() string

type SetOperationStmt

type SetOperationStmt struct {
	Tag NodeTag[SetOperationStmt] `json:"tag"`

	Op            SetOperation `json:"op"`
	All           bool         `json:"all"`
	Larg          Node         `json:"larg,omitempty"`
	Rarg          Node         `json:"rarg,omitempty"`
	ColTypes      *List        `json:"col_types,omitempty"`
	ColTypmods    *List        `json:"col_typmods,omitempty"`
	ColCollations *List        `json:"col_collations,omitempty"`
	GroupClauses  *List        `json:"group_clauses,omitempty"`
}

func (*SetOperationStmt) Pos

func (n *SetOperationStmt) Pos() int

type SetToDefault

type SetToDefault struct {
	Tag NodeTag[SetToDefault] `json:"tag"`

	Xpr       Node  `json:"xpr,omitempty"`
	TypeId    Oid   `json:"type_id"`
	TypeMod   int32 `json:"type_mod"`
	Collation Oid   `json:"collation"`
	Location  int   `json:"location"`
}

func (*SetToDefault) Pos

func (n *SetToDefault) Pos() int

type SortBy

type SortBy struct {
	Tag NodeTag[SortBy] `json:"tag"`

	Node        Node        `json:"node,omitempty"`
	SortbyDir   SortByDir   `json:"sortby_dir"`
	SortbyNulls SortByNulls `json:"sortby_nulls"`
	UseOp       *List       `json:"use_op,omitempty"`
	Location    int         `json:"location"`
}

func (*SortBy) Format

func (n *SortBy) Format(buf *TrackedBuffer, d format.Dialect)

func (*SortBy) Pos

func (n *SortBy) Pos() int

type SortByDir

type SortByDir uint
const (
	SortByDirUndefined SortByDir = 0
	SortByDirDefault   SortByDir = 1
	SortByDirAsc       SortByDir = 2
	SortByDirDesc      SortByDir = 3
	SortByDirUsing     SortByDir = 4
)

func (*SortByDir) Pos

func (n *SortByDir) Pos() int

type SortByNulls

type SortByNulls uint
const (
	SortByNullsUndefined SortByNulls = 0
	SortByNullsDefault   SortByNulls = 1
	SortByNullsFirst     SortByNulls = 2
	SortByNullsLast      SortByNulls = 3
)

func (*SortByNulls) Pos

func (n *SortByNulls) Pos() int

type SortGroupClause

type SortGroupClause struct {
	Tag NodeTag[SortGroupClause] `json:"tag"`

	TleSortGroupRef Index `json:"tle_sort_group_ref"`
	Eqop            Oid   `json:"eqop"`
	Sortop          Oid   `json:"sortop"`
	NullsFirst      bool  `json:"nulls_first"`
	Hashable        bool  `json:"hashable"`
}

func (*SortGroupClause) Pos

func (n *SortGroupClause) Pos() int

type Statement

type Statement struct {
	Tag NodeTag[Statement] `json:"tag"`

	Raw *RawStmt `json:"raw,omitempty"`
}

func (*Statement) Pos

func (n *Statement) Pos() int

type String

type String struct {
	Tag NodeTag[String] `json:"tag"`

	Str string `json:"str"`
}

func (*String) Format

func (n *String) Format(buf *TrackedBuffer, d format.Dialect)

func (*String) Pos

func (n *String) Pos() int
type SubLink struct {
	Tag NodeTag[SubLink] `json:"tag"`

	Xpr         Node        `json:"xpr,omitempty"`
	SubLinkType SubLinkType `json:"sub_link_type"`
	SubLinkId   int         `json:"sub_link_id"`
	Testexpr    Node        `json:"testexpr,omitempty"`
	OperName    *List       `json:"oper_name,omitempty"`
	Subselect   Node        `json:"subselect,omitempty"`
	Location    int         `json:"location"`
}

func (*SubLink) Format

func (n *SubLink) Format(buf *TrackedBuffer, d format.Dialect)

func (*SubLink) Pos

func (n *SubLink) Pos() int

type SubLinkType

type SubLinkType uint
const (
	EXISTS_SUBLINK SubLinkType = iota
	ALL_SUBLINK
	ANY_SUBLINK
	ROWCOMPARE_SUBLINK
	EXPR_SUBLINK
	MULTIEXPR_SUBLINK
	ARRAY_SUBLINK
	CTE_SUBLINK /* for SubPlans only */
)

type SubPlan

type SubPlan struct {
	Tag NodeTag[SubPlan] `json:"tag"`

	Xpr               Node        `json:"xpr,omitempty"`
	SubLinkType       SubLinkType `json:"sub_link_type"`
	Testexpr          Node        `json:"testexpr,omitempty"`
	ParamIds          *List       `json:"param_ids,omitempty"`
	PlanId            int         `json:"plan_id"`
	PlanName          *string     `json:"plan_name,omitempty"`
	FirstColType      Oid         `json:"first_col_type"`
	FirstColTypmod    int32       `json:"first_col_typmod"`
	FirstColCollation Oid         `json:"first_col_collation"`
	UseHashTable      bool        `json:"use_hash_table"`
	UnknownEqFalse    bool        `json:"unknown_eq_false"`
	ParallelSafe      bool        `json:"parallel_safe"`
	SetParam          *List       `json:"set_param,omitempty"`
	ParParam          *List       `json:"par_param,omitempty"`
	Args              *List       `json:"args,omitempty"`
	StartupCost       Cost        `json:"startup_cost"`
	PerCallCost       Cost        `json:"per_call_cost"`
}

func (*SubPlan) Pos

func (n *SubPlan) Pos() int

type SubTransactionId

type SubTransactionId uint32

func (*SubTransactionId) Pos

func (n *SubTransactionId) Pos() int

type TODO

type TODO struct {
	Tag NodeTag[TODO] `json:"tag"`
}

func (*TODO) Pos

func (n *TODO) Pos() int

type TableFunc

type TableFunc struct {
	Tag NodeTag[TableFunc] `json:"tag"`

	NsUris        *List    `json:"ns_uris,omitempty"`
	NsNames       *List    `json:"ns_names,omitempty"`
	Docexpr       Node     `json:"docexpr,omitempty"`
	Rowexpr       Node     `json:"rowexpr,omitempty"`
	Colnames      *List    `json:"colnames,omitempty"`
	Coltypes      *List    `json:"coltypes,omitempty"`
	Coltypmods    *List    `json:"coltypmods,omitempty"`
	Colcollations *List    `json:"colcollations,omitempty"`
	Colexprs      *List    `json:"colexprs,omitempty"`
	Coldefexprs   *List    `json:"coldefexprs,omitempty"`
	Notnulls      []uint32 `json:"notnulls,omitempty"`
	Ordinalitycol int      `json:"ordinalitycol"`
	Location      int      `json:"location"`
}

func (*TableFunc) Pos

func (n *TableFunc) Pos() int

type TableLikeClause

type TableLikeClause struct {
	Tag NodeTag[TableLikeClause] `json:"tag"`

	Relation *RangeVar `json:"relation,omitempty"`
	Options  uint32    `json:"options"`
}

func (*TableLikeClause) Pos

func (n *TableLikeClause) Pos() int

type TableLikeOption

type TableLikeOption uint

func (*TableLikeOption) Pos

func (n *TableLikeOption) Pos() int

type TableName

type TableName struct {
	Tag NodeTag[TableName] `json:"tag"`

	Catalog string `json:"catalog"`
	Schema  string `json:"schema"`
	Name    string `json:"name"`
}

func (*TableName) Format

func (n *TableName) Format(buf *TrackedBuffer, d format.Dialect)

func (*TableName) Pos

func (n *TableName) Pos() int

type TableSampleClause

type TableSampleClause struct {
	Tag NodeTag[TableSampleClause] `json:"tag"`

	Tsmhandler Oid   `json:"tsmhandler"`
	Args       *List `json:"args,omitempty"`
	Repeatable Node  `json:"repeatable,omitempty"`
}

func (*TableSampleClause) Pos

func (n *TableSampleClause) Pos() int

type TargetEntry

type TargetEntry struct {
	Tag NodeTag[TargetEntry] `json:"tag"`

	Xpr             Node       `json:"xpr,omitempty"`
	Expr            Node       `json:"expr,omitempty"`
	Resno           AttrNumber `json:"resno"`
	Resname         *string    `json:"resname,omitempty"`
	Ressortgroupref Index      `json:"ressortgroupref"`
	Resorigtbl      Oid        `json:"resorigtbl"`
	Resorigcol      AttrNumber `json:"resorigcol"`
	Resjunk         bool       `json:"resjunk"`
}

func (*TargetEntry) Pos

func (n *TargetEntry) Pos() int

type TrackedBuffer

type TrackedBuffer struct {
	*printer.Buffer
	// contains filtered or unexported fields
}

TrackedBuffer layers AST formatting over the document renderer in ast/printer: node dispatch, list joins, and comment emission. The renderer itself — tokens, groups, width fitting — lives in the printer package; TrackedBuffer stays here because every node's Format method names it, which an ast → printer → ast import cycle would forbid.

func NewTrackedBuffer

func NewTrackedBuffer() *TrackedBuffer

NewTrackedBuffer creates a new TrackedBuffer.

type TransactionId

type TransactionId uint32

func (*TransactionId) Pos

func (n *TransactionId) Pos() int

type TransactionStmt

type TransactionStmt struct {
	Tag NodeTag[TransactionStmt] `json:"tag"`

	Kind    TransactionStmtKind `json:"kind"`
	Options *List               `json:"options,omitempty"`
	Gid     *string             `json:"gid,omitempty"`
}

func (*TransactionStmt) Pos

func (n *TransactionStmt) Pos() int

type TransactionStmtKind

type TransactionStmtKind uint

func (*TransactionStmtKind) Pos

func (n *TransactionStmtKind) Pos() int

type TriggerTransition

type TriggerTransition struct {
	Tag NodeTag[TriggerTransition] `json:"tag"`

	Name    *string `json:"name,omitempty"`
	IsNew   bool    `json:"is_new"`
	IsTable bool    `json:"is_table"`
}

func (*TriggerTransition) Pos

func (n *TriggerTransition) Pos() int

type TruncateStmt

type TruncateStmt struct {
	Tag NodeTag[TruncateStmt] `json:"tag"`

	Relations   *List        `json:"relations,omitempty"`
	RestartSeqs bool         `json:"restart_seqs"`
	Behavior    DropBehavior `json:"behavior"`
}

func (*TruncateStmt) Format

func (n *TruncateStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*TruncateStmt) Pos

func (n *TruncateStmt) Pos() int

type TypeCast

type TypeCast struct {
	Tag NodeTag[TypeCast] `json:"tag"`

	Arg      Node      `json:"arg,omitempty"`
	TypeName *TypeName `json:"type_name,omitempty"`
	Location int       `json:"location"`
}

func (*TypeCast) Format

func (n *TypeCast) Format(buf *TrackedBuffer, d format.Dialect)

func (*TypeCast) Pos

func (n *TypeCast) Pos() int

type TypeName

type TypeName struct {
	Tag NodeTag[TypeName] `json:"tag"`

	Catalog string `json:"catalog"`
	Schema  string `json:"schema"`
	Name    string `json:"name"`
	// Spelling is the type as the author wrote it, when that differs from
	// Name: SQLite folds the spaces out of multi-word type names ("VARYING
	// CHARACTER" resolves as "VARYINGCHARACTER" in the catalog), so the
	// formatter prints this back instead of the folded form.
	Spelling string `json:"spelling"`
	// Canonical is the type as a call expression the analysis core reads,
	// when an engine spells it differently from what the formatter prints
	// back: DuckDB's STRUCT(a INTEGER, b VARCHAR) as struct(a: integer, b:
	// varchar), ClickHouse's Enum('a', 'b') as Enum8('a' = 1, 'b' = 2).
	Canonical string `json:"canonical,omitempty"`

	// From pg.TypeName
	Names       *List `json:"names,omitempty"`
	TypeOid     Oid   `json:"type_oid"`
	Setof       bool  `json:"setof"`
	PctType     bool  `json:"pct_type"`
	Typmods     *List `json:"typmods,omitempty"`
	Typemod     int32 `json:"typemod"`
	ArrayBounds *List `json:"array_bounds,omitempty"`
	Location    int   `json:"location"`
}

func (*TypeName) Format

func (n *TypeName) Format(buf *TrackedBuffer, d format.Dialect)

func (*TypeName) Pos

func (n *TypeName) Pos() int

type UnlistenStmt

type UnlistenStmt struct {
	Tag NodeTag[UnlistenStmt] `json:"tag"`

	Conditionname *string `json:"conditionname,omitempty"`
}

func (*UnlistenStmt) Pos

func (n *UnlistenStmt) Pos() int

type UpdateStmt

type UpdateStmt struct {
	Tag NodeTag[UpdateStmt] `json:"tag"`

	Relations     *List       `json:"relations,omitempty"`
	TargetList    *List       `json:"target_list,omitempty"`
	WhereClause   Node        `json:"where_clause,omitempty"`
	FromClause    *List       `json:"from_clause,omitempty"`
	LimitCount    Node        `json:"limit_count,omitempty"`
	ReturningList *List       `json:"returning_list,omitempty"`
	WithClause    *WithClause `json:"with_clause,omitempty"`
	// PostgreSQL 18 RETURNING WITH (OLD AS ..., NEW AS ...) aliases
	ReturningOldAlias string `json:"returning_old_alias"`
	ReturningNewAlias string `json:"returning_new_alias"`
	// TableRefs is the statement's table-reference tree as the author wrote
	// it (MySQL: UPDATE a JOIN b ON ...). Relations flattens that tree to
	// bare tables for analysis; printing prefers TableRefs when it is set,
	// so a join's ON condition survives formatting.
	TableRefs *List `json:"table_refs,omitempty"`
}

func (*UpdateStmt) Format

func (n *UpdateStmt) Format(buf *TrackedBuffer, d format.Dialect)

func (*UpdateStmt) Pos

func (n *UpdateStmt) Pos() int

type VacuumOption

type VacuumOption uint

func (*VacuumOption) Pos

func (n *VacuumOption) Pos() int

type VacuumStmt

type VacuumStmt struct {
	Tag NodeTag[VacuumStmt] `json:"tag"`

	Options  int       `json:"options"`
	Relation *RangeVar `json:"relation,omitempty"`
	VaCols   *List     `json:"va_cols,omitempty"`
}

func (*VacuumStmt) Pos

func (n *VacuumStmt) Pos() int

type Var

type Var struct {
	Tag NodeTag[Var] `json:"tag"`

	Xpr         Node       `json:"xpr,omitempty"`
	Varno       Index      `json:"varno"`
	Varattno    AttrNumber `json:"varattno"`
	Vartype     Oid        `json:"vartype"`
	Vartypmod   int32      `json:"vartypmod"`
	Varcollid   Oid        `json:"varcollid"`
	Varlevelsup Index      `json:"varlevelsup"`
	Varnoold    Index      `json:"varnoold"`
	Varoattno   AttrNumber `json:"varoattno"`
	Location    int        `json:"location"`
}

func (*Var) Pos

func (n *Var) Pos() int

type VariableExpr

type VariableExpr struct {
	Tag NodeTag[VariableExpr] `json:"tag"`

	Name     string `json:"name"`
	Location int    `json:"location"`
}

VariableExpr represents a MySQL user variable (e.g., @user_id) This is distinct from sqlc's @param named parameter syntax.

func (*VariableExpr) Format

func (n *VariableExpr) Format(buf *TrackedBuffer, d format.Dialect)

func (*VariableExpr) Pos

func (n *VariableExpr) Pos() int

type VariableSetKind

type VariableSetKind uint

func (*VariableSetKind) Pos

func (n *VariableSetKind) Pos() int

type VariableSetStmt

type VariableSetStmt struct {
	Tag NodeTag[VariableSetStmt] `json:"tag"`

	Kind    VariableSetKind `json:"kind"`
	Name    *string         `json:"name,omitempty"`
	Args    *List           `json:"args,omitempty"`
	IsLocal bool            `json:"is_local"`
}

func (*VariableSetStmt) Pos

func (n *VariableSetStmt) Pos() int

type VariableShowStmt

type VariableShowStmt struct {
	Tag NodeTag[VariableShowStmt] `json:"tag"`

	Name *string `json:"name,omitempty"`
}

func (*VariableShowStmt) Pos

func (n *VariableShowStmt) Pos() int

type ViewCheckOption

type ViewCheckOption uint

func (*ViewCheckOption) Pos

func (n *ViewCheckOption) Pos() int

type ViewStmt

type ViewStmt struct {
	Tag NodeTag[ViewStmt] `json:"tag"`

	View            *RangeVar       `json:"view,omitempty"`
	Aliases         *List           `json:"aliases,omitempty"`
	Query           Node            `json:"query,omitempty"`
	Replace         bool            `json:"replace"`
	Options         *List           `json:"options,omitempty"`
	WithCheckOption ViewCheckOption `json:"with_check_option"`
}

func (*ViewStmt) Pos

func (n *ViewStmt) Pos() int

type WCOKind

type WCOKind uint

func (*WCOKind) Pos

func (n *WCOKind) Pos() int

type WindowClause

type WindowClause struct {
	Tag NodeTag[WindowClause] `json:"tag"`

	Name            *string `json:"name,omitempty"`
	Refname         *string `json:"refname,omitempty"`
	PartitionClause *List   `json:"partition_clause,omitempty"`
	OrderClause     *List   `json:"order_clause,omitempty"`
	FrameOptions    int     `json:"frame_options"`
	StartOffset     Node    `json:"start_offset,omitempty"`
	EndOffset       Node    `json:"end_offset,omitempty"`
	Winref          Index   `json:"winref"`
	CopiedOrder     bool    `json:"copied_order"`
}

func (*WindowClause) Pos

func (n *WindowClause) Pos() int

type WindowDef

type WindowDef struct {
	Tag NodeTag[WindowDef] `json:"tag"`

	Name            *string `json:"name,omitempty"`
	Refname         *string `json:"refname,omitempty"`
	PartitionClause *List   `json:"partition_clause,omitempty"`
	OrderClause     *List   `json:"order_clause,omitempty"`
	FrameOptions    int     `json:"frame_options"`
	StartOffset     Node    `json:"start_offset,omitempty"`
	EndOffset       Node    `json:"end_offset,omitempty"`
	Location        int     `json:"location"`
}

func (*WindowDef) Format

func (n *WindowDef) Format(buf *TrackedBuffer, d format.Dialect)

func (*WindowDef) Pos

func (n *WindowDef) Pos() int

type WindowFunc

type WindowFunc struct {
	Tag NodeTag[WindowFunc] `json:"tag"`

	Xpr         Node  `json:"xpr,omitempty"`
	Winfnoid    Oid   `json:"winfnoid"`
	Wintype     Oid   `json:"wintype"`
	Wincollid   Oid   `json:"wincollid"`
	Inputcollid Oid   `json:"inputcollid"`
	Args        *List `json:"args,omitempty"`
	Aggfilter   Node  `json:"aggfilter,omitempty"`
	Winref      Index `json:"winref"`
	Winstar     bool  `json:"winstar"`
	Winagg      bool  `json:"winagg"`
	Location    int   `json:"location"`
}

func (*WindowFunc) Pos

func (n *WindowFunc) Pos() int

type WithCheckOption

type WithCheckOption struct {
	Tag NodeTag[WithCheckOption] `json:"tag"`

	Kind     WCOKind `json:"kind"`
	Relname  *string `json:"relname,omitempty"`
	Polname  *string `json:"polname,omitempty"`
	Qual     Node    `json:"qual,omitempty"`
	Cascaded bool    `json:"cascaded"`
}

func (*WithCheckOption) Pos

func (n *WithCheckOption) Pos() int

type WithClause

type WithClause struct {
	Tag NodeTag[WithClause] `json:"tag"`

	Ctes      *List `json:"ctes,omitempty"`
	Recursive bool  `json:"recursive"`
	Location  int   `json:"location"`
}

func (*WithClause) Format

func (n *WithClause) Format(buf *TrackedBuffer, d format.Dialect)

func (*WithClause) Pos

func (n *WithClause) Pos() int

type XmlExpr

type XmlExpr struct {
	Tag NodeTag[XmlExpr] `json:"tag"`

	Xpr       Node          `json:"xpr,omitempty"`
	Op        XmlExprOp     `json:"op"`
	Name      *string       `json:"name,omitempty"`
	NamedArgs *List         `json:"named_args,omitempty"`
	ArgNames  *List         `json:"arg_names,omitempty"`
	Args      *List         `json:"args,omitempty"`
	Xmloption XmlOptionType `json:"xmloption"`
	Type      Oid           `json:"type"`
	Typmod    int32         `json:"typmod"`
	Location  int           `json:"location"`
}

func (*XmlExpr) Pos

func (n *XmlExpr) Pos() int

type XmlExprOp

type XmlExprOp uint

func (*XmlExprOp) Pos

func (n *XmlExprOp) Pos() int

type XmlOptionType

type XmlOptionType uint

func (*XmlOptionType) Pos

func (n *XmlOptionType) Pos() int

type XmlSerialize

type XmlSerialize struct {
	Tag NodeTag[XmlSerialize] `json:"tag"`

	Xmloption XmlOptionType `json:"xmloption"`
	Expr      Node          `json:"expr,omitempty"`
	TypeName  *TypeName     `json:"type_name,omitempty"`
	Location  int           `json:"location"`
}

func (*XmlSerialize) Pos

func (n *XmlSerialize) Pos() int

Source Files

Directories

Path Synopsis
Package printer implements the document renderer the SQL formatter prints through: a small Wadler-style engine, the model behind Prettier and ruff (via Biome's printer).
Package printer implements the document renderer the SQL formatter prints through: a small Wadler-style engine, the model behind Prettier and ruff (via Biome's printer).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL