Documentation
ΒΆ
Index ΒΆ
- Constants
- type AnalyzeError
- type AnalyzeOutput
- type AnalyzerOptions
- type Engine
- func (e *Engine) Analyze(ctx context.Context, sql string, cat *types.SimpleCatalog, ...) (*AnalyzeOutput, error)
- func (e *Engine) AnalyzeNext(ctx context.Context, loc *ParseResumeLocation, cat *types.SimpleCatalog, ...) (*AnalyzeOutput, bool, error)
- func (e *Engine) Close(ctx context.Context) error
- func (e *Engine) Parse(ctx context.Context, sql string) (*Statement, error)
- func (e *Engine) ParseNext(ctx context.Context, loc *ParseResumeLocation) (*Statement, bool, error)
- type LanguageFeature
- type LanguageOptions
- func (o *LanguageOptions) DisableAllLanguageFeatures()
- func (o *LanguageOptions) EnableLanguageFeature(f LanguageFeature)
- func (o *LanguageOptions) EnableMaximumLanguageFeatures()
- func (o *LanguageOptions) EnableMaximumLanguageFeaturesForDevelopment()
- func (o *LanguageOptions) EnableReservableKeyword(keyword string, enable bool)
- func (o *LanguageOptions) SetSupportedStatementKinds(kinds []StatementKind)
- func (o *LanguageOptions) SetSupportsAllStatementKinds()
- type NameResolutionMode
- type NodeMap
- type ParameterMode
- type ParseError
- type ParseLocationRecordType
- type ParseResumeLocation
- type ProductMode
- type Statement
- type StatementKind
Constants ΒΆ
const Version = "0.17.0"
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type AnalyzeError ΒΆ
type AnalyzeError struct {
Message string
}
AnalyzeError represents a semantic analysis error returned by ZetaSQL.
func (*AnalyzeError) Error ΒΆ
func (e *AnalyzeError) Error() string
type AnalyzeOutput ΒΆ
type AnalyzeOutput struct {
Resolved resolved_ast.StatementNode
Parsed ast.StatementNode
}
AnalyzeOutput holds the result of a successful semantic analysis. Resolved is the resolved (semantically analyzed) AST; Parsed is the parser AST that produced it. Pair the two via NewNodeMap to look up parser-side nodes from a resolved node.
type AnalyzerOptions ΒΆ
type AnalyzerOptions struct {
Language *LanguageOptions
ParseLocationRecordType *ParseLocationRecordType
AllowUndeclaredParameters bool
ParameterMode ParameterMode
QueryParameters map[string]types.Type
PositionalQueryParameters []types.Type
// RejectInvalidLiteralCasts opts into BigQuery-compatible strict
// cast checking at analyze time. When true, Engine.Analyze walks
// the resolved AST after analysis and returns a
// *types.CastValueError (with Value, ToType, and the literal's
// Line / Col populated) instead of the deferred resolved tree
// when it finds a ResolvedCast whose source is a STRING literal
// that cannot be parsed as the target type.
//
// Default false matches upstream ZetaSQL 2025.x, which
// deliberately leaves such casts unfolded for runtime evaluation
// (see types.CastValueError doc for the upstream rationale).
// Callers that target BigQuery semantics -- where the equivalent
// CAST fails before execution -- set this to true.
//
// Side effect: when this is true and ParseLocationRecordType is
// left nil, the engine auto-promotes ParseLocationRecordType to
// FullNodeScope so the C++ analyzer attaches the parse locations
// the gate needs to populate Line / Col. Callers that set
// ParseLocationRecordType explicitly keep their choice; opting
// down to None silently produces zero Line / Col and the short
// fallback wording on the returned error.
//
// This flag is Go-side only; it does not affect the C++ analyzer
// and is therefore not propagated through toProto.
RejectInvalidLiteralCasts bool
}
AnalyzerOptions configures the behavior of the ZetaSQL analyzer.
QueryParameters and PositionalQueryParameters tell the analyzer the type of each `@name` / positional `?` parameter that may appear in the SQL text. The analyzer needs only the type β values are bound at execution time by the caller's runtime. Entries with a nil Type are skipped on toProto so a partially-populated table does not poison the wire form; for positional parameters that means a nil entry will cause its successors to shift down, so callers building the slice should treat nil as a programming error rather than a placeholder.
func NewAnalyzerOptions ΒΆ
func NewAnalyzerOptions() *AnalyzerOptions
NewAnalyzerOptions creates AnalyzerOptions with default settings.
func (*AnalyzerOptions) Clone ΒΆ
func (o *AnalyzerOptions) Clone() *AnalyzerOptions
Clone returns a deep copy of the AnalyzerOptions. The returned value shares no pointer state with the receiver: Language is deep-copied, ParseLocationRecordType is duplicated, and QueryParameters / PositionalQueryParameters get fresh container backing arrays. types.Type values are themselves immutable, so the elements alias.
type Engine ΒΆ added in v0.7.0
type Engine struct {
// contains filtered or unexported fields
}
Engine is the single ZetaSQL runtime instance. It owns the wazero runtime and the loaded WASM module, and exposes Parse, Analyze, and AnalyzeNext as separate methods on the same engine. There is no separate parser-only or analyzer-only type β the underlying WASM binary contains both, and instantiating it twice would only double the memory cost.
func New ΒΆ added in v0.7.0
New compiles and instantiates the ZetaSQL WASM module, runs its C++ global constructors via init_module, and returns a ready-to-use engine. The caller owns the returned engine and must invoke Close to release the runtime when finished.
func (*Engine) Analyze ΒΆ added in v0.7.0
func (e *Engine) Analyze( ctx context.Context, sql string, cat *types.SimpleCatalog, opts *AnalyzerOptions, ) (*AnalyzeOutput, error)
Analyze performs semantic analysis on a SQL statement. Returns an *AnalyzeError if the SQL is semantically invalid.
Before reaching the C++ resolver the SQL is run through the source-rewriting passes in the ast package (currently: RewriteNamedTimezoneLiterals, which adapts named-IANA TIMESTAMP literals to the numeric-offset form the bundled WASM accepts). Skipping the extra parse on inputs that cannot trigger any pass keeps the common case free of overhead β see preprocessForAnalyze.
func (*Engine) AnalyzeNext ΒΆ added in v0.7.0
func (e *Engine) AnalyzeNext( ctx context.Context, loc *ParseResumeLocation, cat *types.SimpleCatalog, opts *AnalyzerOptions, ) (*AnalyzeOutput, bool, error)
AnalyzeNext analyzes the next statement from a multi-statement SQL string. Returns the analysis output, whether more statements remain, and any error. Call repeatedly with the same ParseResumeLocation until it returns false.
func (*Engine) Close ΒΆ added in v0.7.0
Close releases the wazero runtime that backs the engine. After Close the engine must not be used again.
func (*Engine) Parse ΒΆ added in v0.7.0
Parse parses a SQL statement and returns the AST. Returns a *ParseError if the SQL is syntactically invalid.
func (*Engine) ParseNext ΒΆ added in v0.8.0
func (e *Engine) ParseNext( ctx context.Context, loc *ParseResumeLocation, ) (*Statement, bool, error)
ParseNext parses the next statement from a multi-statement SQL string, using the given ParseResumeLocation to track position. Returns the parsed statement, whether more statements remain, and any error. Call repeatedly with the same ParseResumeLocation until it returns false. Symmetric to AnalyzeNext but skips semantic analysis.
type LanguageFeature ΒΆ
type LanguageFeature int32
LanguageFeature is a single ZetaSQL language feature flag.
Use the Feature* constants in this package (or zetasql-wasm/wasm/generated for ones not yet exposed by name) to set values; LanguageOptions tracks the enabled set as a map.
const ( FeatureAnalyticFunctions LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_ANALYTIC_FUNCTIONS) FeatureBignumericType LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_BIGNUMERIC_TYPE) FeatureCreateTableAsSelectColumnList LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_CREATE_TABLE_AS_SELECT_COLUMN_LIST) FeatureCreateTableNotNull LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_CREATE_TABLE_NOT_NULL) FeatureGeography LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_GEOGRAPHY) FeatureGroupByRollup LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_GROUP_BY_ROLLUP) FeatureIntervalType LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_INTERVAL_TYPE) FeatureJsonArrayFunctions LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_JSON_ARRAY_FUNCTIONS) FeatureJsonStrictNumberParsing LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_JSON_STRICT_NUMBER_PARSING) FeatureJsonType LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_JSON_TYPE) FeatureJsonValueExtractionFunctions LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_JSON_VALUE_EXTRACTION_FUNCTIONS) FeatureNamedArguments LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_NAMED_ARGUMENTS) FeatureNumericType LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_NUMERIC_TYPE) FeatureParameterizedTypes LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_PARAMETERIZED_TYPES) FeatureTablesample LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_TABLESAMPLE) FeatureTemplateFunctions LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_TEMPLATE_FUNCTIONS) FeatureTimestampNanos LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_TIMESTAMP_NANOS) )
Plain (non-versioned) features.
const ( FeatureV11HavingInAggregate LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_HAVING_IN_AGGREGATE) FeatureV11LimitInAggregate LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_LIMIT_IN_AGGREGATE) FeatureV11NullHandlingModifierInAggregate LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_NULL_HANDLING_MODIFIER_IN_AGGREGATE) FeatureV11NullHandlingModifierInAnalytic LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_NULL_HANDLING_MODIFIER_IN_ANALYTIC) FeatureV11OrderByCollate LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_ORDER_BY_COLLATE) FeatureV11OrderByInAggregate LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_ORDER_BY_IN_AGGREGATE) FeatureV11SelectStarExceptReplace LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_SELECT_STAR_EXCEPT_REPLACE) FeatureV11WithOnSubquery LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_1_WITH_ON_SUBQUERY) )
V_1_1 features.
const ( FeatureV12CivilTime LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_2_CIVIL_TIME) FeatureV12SafeFunctionCall LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_2_SAFE_FUNCTION_CALL) FeatureV12WeekWithWeekday LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_2_WEEK_WITH_WEEKDAY) )
V_1_2 features.
const ( FeatureV14AliasesForStringAndDateFunctions LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_4_ALIASES_FOR_STRING_AND_DATE_FUNCTIONS) FeatureV14JsonMoreValueExtractionFunctions LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_4_JSON_MORE_VALUE_EXTRACTION_FUNCTIONS) )
V_1_4 features.
const ( FeatureV13AdditionalStringFunctions LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_ADDITIONAL_STRING_FUNCTIONS) FeatureV13AllowDashesInTableName LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_ALLOW_DASHES_IN_TABLE_NAME) FeatureV13AllowRegexpExtractOptionals LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_ALLOW_REGEXP_EXTRACT_OPTIONALS) FeatureV13ConcatMixedTypes LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_CONCAT_MIXED_TYPES) FeatureV13DateArithmetics LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_DATE_ARITHMETICS) FeatureV13DateTimeConstructors LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_DATE_TIME_CONSTRUCTORS) FeatureV13DecimalAlias LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_DECIMAL_ALIAS) FeatureV13ExtendedDateTimeSignatures LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_EXTENDED_DATE_TIME_SIGNATURES) FeatureV13ExtendedGeographyParsers LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_EXTENDED_GEOGRAPHY_PARSERS) FeatureV13FormatInCast LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_FORMAT_IN_CAST) FeatureV13IsDistinct LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_IS_DISTINCT) FeatureV13NullsFirstLastInOrderBy LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_NULLS_FIRST_LAST_IN_ORDER_BY) FeatureV13Pivot LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_PIVOT) FeatureV13Qualify LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_QUALIFY) FeatureV13Unpivot LanguageFeature = LanguageFeature(generated.LanguageFeature_FEATURE_V_1_3_UNPIVOT) )
V_1_3 features.
func (LanguageFeature) String ΒΆ
func (f LanguageFeature) String() string
String returns the canonical proto enum name (e.g. "FEATURE_ANALYTIC_FUNCTIONS").
type LanguageOptions ΒΆ
type LanguageOptions struct {
Features map[LanguageFeature]bool
StatementKinds []StatementKind
AllStatements bool
Keywords map[string]bool
NameResolutionMode NameResolutionMode
ProductMode ProductMode
}
LanguageOptions controls which ZetaSQL language features are enabled.
func NewLanguageOptions ΒΆ
func NewLanguageOptions() *LanguageOptions
NewLanguageOptions creates LanguageOptions with no features enabled.
func (*LanguageOptions) DisableAllLanguageFeatures ΒΆ
func (o *LanguageOptions) DisableAllLanguageFeatures()
DisableAllLanguageFeatures disables all language features.
func (*LanguageOptions) EnableLanguageFeature ΒΆ
func (o *LanguageOptions) EnableLanguageFeature(f LanguageFeature)
EnableLanguageFeature enables the given language feature.
func (*LanguageOptions) EnableMaximumLanguageFeatures ΒΆ
func (o *LanguageOptions) EnableMaximumLanguageFeatures()
EnableMaximumLanguageFeatures enables all released (non-test) language features.
func (*LanguageOptions) EnableMaximumLanguageFeaturesForDevelopment ΒΆ
func (o *LanguageOptions) EnableMaximumLanguageFeaturesForDevelopment()
EnableMaximumLanguageFeaturesForDevelopment enables all language features including those still in development.
func (*LanguageOptions) EnableReservableKeyword ΒΆ
func (o *LanguageOptions) EnableReservableKeyword(keyword string, enable bool)
EnableReservableKeyword sets whether a keyword is reserved.
func (*LanguageOptions) SetSupportedStatementKinds ΒΆ
func (o *LanguageOptions) SetSupportedStatementKinds(kinds []StatementKind)
SetSupportedStatementKinds sets the allowed statement kinds.
func (*LanguageOptions) SetSupportsAllStatementKinds ΒΆ
func (o *LanguageOptions) SetSupportsAllStatementKinds()
SetSupportsAllStatementKinds enables support for all statement kinds.
type NameResolutionMode ΒΆ
type NameResolutionMode int32
NameResolutionMode controls how the analyzer resolves unqualified names.
const ( NameResolutionDefault NameResolutionMode = NameResolutionMode(generated.NameResolutionMode_NAME_RESOLUTION_DEFAULT) NameResolutionStrict NameResolutionMode = NameResolutionMode(generated.NameResolutionMode_NAME_RESOLUTION_STRICT) )
func (NameResolutionMode) String ΒΆ
func (m NameResolutionMode) String() string
String returns the canonical proto enum name (e.g. "NAME_RESOLUTION_DEFAULT").
type NodeMap ΒΆ
type NodeMap struct {
// contains filtered or unexported fields
}
NodeMap indexes the resolved and parsed AST of a single statement by parse location, enabling forward lookup of resolved nodes from a byte range and reverse lookup of the parsed nodes that share that range. Build one by calling NewNodeMap on a statement analyzed with PARSE_LOCATION_RECORD_FULL_NODE_SCOPE.
func NewNodeMap ΒΆ
func NewNodeMap(resolved resolved_ast.StatementNode, parsed ast.StatementNode) *NodeMap
NewNodeMap walks both the resolved and parsed AST of the same statement and indexes every node that has a non-nil ParseLocationRange by its (start, end) byte offsets. The parsed argument may be nil, in which case parsed-side lookups return empty results.
func (*NodeMap) FindParsedNodes ΒΆ added in v0.7.0
func (m *NodeMap) FindParsedNodes(resolved resolved_ast.Node) []ast.Node
FindParsedNodes returns the parsed AST nodes whose parse location matches that of the given resolved node exactly. Multiple nodes can share a single (start, end) range when a parser AST chain (for example ASTFunctionCall and its enclosing path expression) maps onto the same resolved node β callers select among them by Go type. Returns nil when no parsed node shares the location, including the cases where the resolved node has no recorded location or NewNodeMap was given a nil parsed AST.
func (*NodeMap) NodeAt ΒΆ
func (m *NodeMap) NodeAt(start, end int32) resolved_ast.Node
NodeAt returns the first resolved node whose parse location exactly matches the given [start, end) byte range, or nil if none.
func (*NodeMap) NodesAt ΒΆ
func (m *NodeMap) NodesAt(start, end int32) []resolved_ast.Node
NodesAt returns all resolved nodes whose parse location exactly matches the given [start, end) byte range.
func (*NodeMap) NodesInRange ΒΆ
func (m *NodeMap) NodesInRange(start, end int32) []resolved_ast.Node
NodesInRange returns all resolved nodes whose parse location is fully contained within the given [start, end) byte range.
type ParameterMode ΒΆ
type ParameterMode int32
ParameterMode selects how query parameters are referenced in the SQL text.
const ( ParameterNamed ParameterMode = ParameterMode(generated.ParameterMode_PARAMETER_NAMED) ParameterPositional ParameterMode = ParameterMode(generated.ParameterMode_PARAMETER_POSITIONAL) ParameterNone ParameterMode = ParameterMode(generated.ParameterMode_PARAMETER_NONE) )
func (ParameterMode) String ΒΆ
func (m ParameterMode) String() string
String returns the canonical proto enum name (e.g. "PARAMETER_NAMED").
type ParseError ΒΆ
type ParseError struct {
Message string
}
ParseError represents a SQL parse error returned by ZetaSQL.
func (*ParseError) Error ΒΆ
func (e *ParseError) Error() string
type ParseLocationRecordType ΒΆ
type ParseLocationRecordType int32
ParseLocationRecordType controls how the analyzer attaches source-location information to resolved AST nodes.
const ( ParseLocationRecordNone ParseLocationRecordType = ParseLocationRecordType(generated.ParseLocationRecordType_PARSE_LOCATION_RECORD_NONE) ParseLocationRecordFullNodeScope ParseLocationRecordType = ParseLocationRecordType(generated.ParseLocationRecordType_PARSE_LOCATION_RECORD_FULL_NODE_SCOPE) ParseLocationRecordCodeSearch ParseLocationRecordType = ParseLocationRecordType(generated.ParseLocationRecordType_PARSE_LOCATION_RECORD_CODE_SEARCH) )
func (ParseLocationRecordType) String ΒΆ
func (t ParseLocationRecordType) String() string
String returns the canonical proto enum name (e.g. "PARSE_LOCATION_RECORD_FULL_NODE_SCOPE").
type ParseResumeLocation ΒΆ
ParseResumeLocation tracks the position in a multi-statement SQL string for incremental parsing with AnalyzeNextStatement.
func NewParseResumeLocation ΒΆ
func NewParseResumeLocation(sql string) *ParseResumeLocation
NewParseResumeLocation creates a new resume location for the given SQL input.
func (*ParseResumeLocation) Reset ΒΆ
func (l *ParseResumeLocation) Reset()
Reset sets BytePosition back to 0 so the same Input can be re-parsed from the beginning.
type ProductMode ΒΆ
type ProductMode int32
ProductMode selects between INTERNAL (Google internal) and EXTERNAL (open-source / customer-facing) ZetaSQL behaviour.
const ( ProductInternal ProductMode = ProductMode(generated.ProductMode_PRODUCT_INTERNAL) ProductExternal ProductMode = ProductMode(generated.ProductMode_PRODUCT_EXTERNAL) )
func (ProductMode) String ΒΆ
func (m ProductMode) String() string
String returns the canonical proto enum name (e.g. "PRODUCT_INTERNAL").
type Statement ΒΆ
type Statement struct {
SQL string
Root ast.StatementNode
}
Statement represents a successfully parsed SQL statement.
type StatementKind ΒΆ added in v0.2.0
type StatementKind int32
StatementKind identifies a top-level SQL statement form (QUERY, INSERT, CREATE TABLE, β¦) for use with LanguageOptions.SetSupportedStatementKinds.
The underlying proto enum (generated.ResolvedNodeKind) carries every resolved-AST node kind, including hundreds of non-statement values. StatementKind is a named subset wrapper: the constants below cover the statement (RESOLVED_*_STMT) values, so callers configuring an analyzer don't need to import wasm/generated. Wire identity is preserved (both are int32) so values round-trip through toProto without conversion loss.
const ( StatementKindAbortBatch StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ABORT_BATCH_STMT) StatementKindAlterAllRowAccessPolicies StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_ALL_ROW_ACCESS_POLICIES_STMT) StatementKindAlterApproxView StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_APPROX_VIEW_STMT) StatementKindAlterConnection StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_CONNECTION_STMT) StatementKindAlterDatabase StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_DATABASE_STMT) StatementKindAlterEntity StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_ENTITY_STMT) StatementKindAlterExternalSchema StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_EXTERNAL_SCHEMA_STMT) StatementKindAlterIndex StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_INDEX_STMT) StatementKindAlterMaterializedView StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_MATERIALIZED_VIEW_STMT) StatementKindAlterModel StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_MODEL_STMT) StatementKindAlterPrivilegeRestriction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_PRIVILEGE_RESTRICTION_STMT) StatementKindAlterRowAccessPolicy StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_ROW_ACCESS_POLICY_STMT) StatementKindAlterSchema StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_SCHEMA_STMT) StatementKindAlterSequence StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_SEQUENCE_STMT) StatementKindAlterTableSetOptions StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_TABLE_SET_OPTIONS_STMT) StatementKindAlterTable StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_TABLE_STMT) StatementKindAlterView StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ALTER_VIEW_STMT) StatementKindAnalyze StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ANALYZE_STMT) StatementKindAssert StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ASSERT_STMT) StatementKindAssignment StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ASSIGNMENT_STMT) StatementKindAuxLoadData StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_AUX_LOAD_DATA_STMT) StatementKindBegin StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_BEGIN_STMT) StatementKindCall StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CALL_STMT) StatementKindCloneData StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CLONE_DATA_STMT) StatementKindCommit StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_COMMIT_STMT) StatementKindCreateApproxView StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_APPROX_VIEW_STMT) StatementKindCreateConnection StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_CONNECTION_STMT) StatementKindCreateConstant StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_CONSTANT_STMT) StatementKindCreateDatabase StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_DATABASE_STMT) StatementKindCreateEntity StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_ENTITY_STMT) StatementKindCreateExternalSchema StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_EXTERNAL_SCHEMA_STMT) StatementKindCreateExternalTable StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_EXTERNAL_TABLE_STMT) StatementKindCreateFunction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_FUNCTION_STMT) StatementKindCreateIndex StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_INDEX_STMT) StatementKindCreateMaterializedView StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_MATERIALIZED_VIEW_STMT) StatementKindCreateModel StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_MODEL_STMT) StatementKindCreatePrivilegeRestriction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_PRIVILEGE_RESTRICTION_STMT) StatementKindCreateProcedure StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_PROCEDURE_STMT) StatementKindCreatePropertyGraph StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_PROPERTY_GRAPH_STMT) StatementKindCreateRowAccessPolicy StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_ROW_ACCESS_POLICY_STMT) StatementKindCreateSchema StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_SCHEMA_STMT) StatementKindCreateSequence StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_SEQUENCE_STMT) StatementKindCreateSnapshotTable StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_SNAPSHOT_TABLE_STMT) StatementKindCreateTableAsSelect StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_TABLE_AS_SELECT_STMT) StatementKindCreateTableFunction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_TABLE_FUNCTION_STMT) StatementKindCreateTable StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_TABLE_STMT) StatementKindCreateView StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_VIEW_STMT) StatementKindCreateWithEntry StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_CREATE_WITH_ENTRY_STMT) StatementKindDefineTable StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DEFINE_TABLE_STMT) StatementKindDelete StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DELETE_STMT) StatementKindDescribe StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DESCRIBE_STMT) StatementKindDropFunction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_FUNCTION_STMT) StatementKindDropIndex StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_INDEX_STMT) StatementKindDropMaterializedView StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_MATERIALIZED_VIEW_STMT) StatementKindDropPrivilegeRestriction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_PRIVILEGE_RESTRICTION_STMT) StatementKindDropRowAccessPolicy StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_ROW_ACCESS_POLICY_STMT) StatementKindDropSnapshotTable StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_SNAPSHOT_TABLE_STMT) StatementKindDrop StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_STMT) StatementKindDropTableFunction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_DROP_TABLE_FUNCTION_STMT) StatementKindExecuteImmediate StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_EXECUTE_IMMEDIATE_STMT) StatementKindExplain StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_EXPLAIN_STMT) StatementKindExportData StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_EXPORT_DATA_STMT) StatementKindExportMetadata StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_EXPORT_METADATA_STMT) StatementKindExportModel StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_EXPORT_MODEL_STMT) StatementKindGeneralizedQuery StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_GENERALIZED_QUERY_STMT) StatementKindGrant StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_GRANT_STMT) StatementKindImport StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_IMPORT_STMT) StatementKindInsert StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_INSERT_STMT) StatementKindMerge StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_MERGE_STMT) StatementKindModule StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_MODULE_STMT) StatementKindMulti StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_MULTI_STMT) StatementKindQuery StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_QUERY_STMT) StatementKindRename StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_RENAME_STMT) StatementKindRevoke StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_REVOKE_STMT) StatementKindRollback StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_ROLLBACK_STMT) StatementKindRunBatch StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_RUN_BATCH_STMT) StatementKindSetTransaction StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_SET_TRANSACTION_STMT) StatementKindShow StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_SHOW_STMT) StatementKindStartBatch StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_START_BATCH_STMT) StatementKindStatementWithPipeOperators StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_STATEMENT_WITH_PIPE_OPERATORS_STMT) StatementKindSubpipeline StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_SUBPIPELINE_STMT) StatementKindTruncate StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_TRUNCATE_STMT) StatementKindUndrop StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_UNDROP_STMT) StatementKindUpdate StatementKind = StatementKind(generated.ResolvedNodeKind_RESOLVED_UPDATE_STMT) )
Statement kind constants. One per RESOLVED_*_STMT value in the underlying proto enum.
func (StatementKind) String ΒΆ added in v0.2.0
func (k StatementKind) String() string
String returns the canonical proto enum name (e.g. "RESOLVED_QUERY_STMT").