Versions in this module Expand all Collapse all v0 v0.2.1 Jun 12, 2026 v0.2.0 Jun 12, 2026 Changes in this version + var ErrStatementHasNoRowType = errors.New("statement has no row type") + func InitGoogleSQL() error + func RowTypeFromAnalyzerOutput(out *googlesql.AnalyzerOutput, schema *Catalog) (*spannerpb.StructType, error) + func RowTypeFromResolvedQuery(query *googlesql.ResolvedQueryStmt, schema *Catalog) (*spannerpb.StructType, error) + func SpannerTypeFromGoogleSQLType(t googlesql.Googlesql_TypeNode) (*spannerpb.Type, error) + func TypeFromAnalyzerOutput(out *googlesql.AnalyzerOutput) (*spannerpb.Type, error) + type Analyzer struct + func NewAnalyzer(schema *Catalog) (*Analyzer, error) + func NewAnalyzerFromDDL(path, ddlSQL string) (*Analyzer, error) + func NewAnalyzerFromDDLWithOptions(path, ddlSQL string, options ...AnalyzerOption) (*Analyzer, error) + func NewAnalyzerFromDDLWithProtoDescriptorFiles(path, ddlSQL string, protoDescriptorPaths []string) (*Analyzer, error) + func NewAnalyzerFromDDLWithProtoDescriptorFilesAndOptions(path, ddlSQL string, protoDescriptorPaths []string, options ...AnalyzerOption) (*Analyzer, error) + func NewAnalyzerFromGoogleSQLCatalog(googleSQLCatalog *GoogleSQLCatalog) (*Analyzer, error) + func NewAnalyzerWithOptions(schema *Catalog, options ...AnalyzerOption) (*Analyzer, error) + func (a *Analyzer) AddPositionalQueryParameter(spec *TypeSpec) error + func (a *Analyzer) AddQueryParameter(name string, spec *TypeSpec) error + func (a *Analyzer) FunctionCatalogDebugString(verbose bool) (string, error) + func (a *Analyzer) ParseDebugString(sqlMode, sql string) (string, error) + func (a *Analyzer) ResolvedASTDebugString(sqlMode, sql string) (string, error) + func (a *Analyzer) RowTypeForExpression(sql string) (*spannerpb.StructType, error) + func (a *Analyzer) RowTypeForStatement(sql string) (*spannerpb.StructType, error) + func (a *Analyzer) TypeForExpression(sql string) (*spannerpb.Type, error) + func (a *Analyzer) Unparse(sqlMode, sql string) (string, error) + type AnalyzerOption func(*analyzerConfig) + func WithFoldLiteralCast(enabled bool) AnalyzerOption + func WithMaximumDevelopmentLanguageFeatures(enabled bool) AnalyzerOption + func WithParseLocationRecordType(recordType googlesql.ParseLocationRecordType) AnalyzerOption + func WithProductMode(mode googlesql.ProductMode) AnalyzerOption + func WithPruneUnusedColumns(enabled bool) AnalyzerOption + func WithStrictNameResolution(enabled bool) AnalyzerOption + type BigQueryAnalyzer struct + func NewBigQueryAnalyzerFromDDL(path, ddlSQL string, options ...AnalyzerOption) (*BigQueryAnalyzer, error) + func NewBigQueryAnalyzerFromGoogleSQLCatalog(catalog *BigQueryGoogleSQLCatalog) (*BigQueryAnalyzer, error) + func (a *BigQueryAnalyzer) AddQueryParameter(name string, spec *TypeSpec) error + func (a *BigQueryAnalyzer) AddSpannerExternalDataset(dataset, spannerSource string, catalog *Catalog) (*BigQuerySpannerExternalDatasetBinding, error) + func (a *BigQueryAnalyzer) AddSpannerExternalDatasetWithOptions(dataset, spannerSource string, catalog *Catalog, ...) (*BigQuerySpannerExternalDatasetBinding, error) + func (a *BigQueryAnalyzer) ParseDebugString(sqlMode, sql string) (string, error) + func (a *BigQueryAnalyzer) ResolvedASTDebugString(sqlMode, sql string) (string, error) + func (a *BigQueryAnalyzer) SetExternalQueryAnalyzers(analyzers map[string]*Analyzer) + func (a *BigQueryAnalyzer) TableSchemaForExpression(sql string) (*BigQueryTableSchema, error) + func (a *BigQueryAnalyzer) TableSchemaForStatement(sql string) (*BigQueryTableSchema, error) + func (a *BigQueryAnalyzer) Unparse(sqlMode, sql string) (string, error) + type BigQueryDataPolicyOption struct + Name string + type BigQueryDatasetReference struct + Dataset string + Path string + Project string + type BigQueryFieldElementType struct + Type string + type BigQueryGoogleSQLCatalog struct + AnalyzerOptions *googlesql.AnalyzerOptions + SimpleCatalog *googlesql.SimpleCatalog + TypeFactory *googlesql.TypeFactory + func BuildBigQueryGoogleSQLCatalogFromDDL(path, ddlSQL string, options ...AnalyzerOption) (*BigQueryGoogleSQLCatalog, error) + func (c *BigQueryGoogleSQLCatalog) Helper() *GoogleSQLHelper + type BigQueryPolicyTags struct + Names []string + type BigQuerySpannerExternalDatasetBinding struct + Access string + AccessVerification BigQuerySpannerExternalDatasetVerification + BigQueryDataset string + BigQueryDatasetRef BigQueryDatasetReference + CloudResourceConnection string + CloudResourceConnectionMetadata *BigQuerySpannerExternalDatasetCloudResourceConnectionMetadata + Connection string + DatabaseRole string + DatabaseRoleSource string + Execution BigQuerySpannerExternalDatasetExecution + ExternalSource string + Kind string + Limitations []string + Location string + LocationMetadata *BigQuerySpannerExternalDatasetLocationMetadata + Name string + ProjectedTables []BigQuerySpannerExternalDatasetTable + ProjectionMatrix BigQuerySpannerExternalDatasetProjectionMatrix + ProjectionPolicy BigQuerySpannerExternalDatasetProjectionPolicy + RequiresDataBoostAccess bool + SourceSchema string + SpannerSource string + VetSuppressions []QueryCodegenPlanVetSuppression + Warnings []QueryCodegenPlanWarning + type BigQuerySpannerExternalDatasetCloudResourceConnectionMetadata struct + ID string + LocationMatch bool + ParsedLocation string + ParsedLocationCanonical string + type BigQuerySpannerExternalDatasetColumn struct + BigQueryKeyMetadataVisible bool + BigQueryType string + Name string + Reason string + SpannerType string + UnderlyingSpannerPrimaryKey bool + Visible bool + VisibleInBigQueryMetadata bool + type BigQuerySpannerExternalDatasetExecution struct + DataBoost string + QueryPriority string + Writable bool + type BigQuerySpannerExternalDatasetLocationMetadata struct + Canonical string + Configured string + type BigQuerySpannerExternalDatasetOptions struct + Access string + AccessVerification BigQuerySpannerExternalDatasetVerification + AccessVerificationHint string + AccessVerificationSource string + AccessVerificationStatus string + CloudResourceConnection string + Connection string + DatabaseRole string + DatabaseRoleSource string + DefaultProject string + ExternalSource string + Location string + NamedSchemaPolicy string + Project string + UnsupportedColumns string + type BigQuerySpannerExternalDatasetProjectionMatrix struct + DocsLastChecked string + DocsLastUpdated string + GeneratorMatrixVersion int + Rows []BigQuerySpannerExternalDatasetProjectionMatrixRow + Source string + SourceURL string + type BigQuerySpannerExternalDatasetProjectionMatrixRow struct + Behavior string + DefaultSeverity string + EvidenceKind string + Object string + SourceURL string + type BigQuerySpannerExternalDatasetProjectionPolicy struct + NamedSchemas string + UnsupportedColumns string + type BigQuerySpannerExternalDatasetTable struct + BigQueryKeyMetadataVisible bool + BigQueryTable string + Columns []BigQuerySpannerExternalDatasetColumn + Name string + NameMatching string + Reason string + SourceTable string + SpannerTable string + Visible bool + VisibleInBigQueryMetadata bool + type BigQuerySpannerExternalDatasetVerification struct + CheckedAt string + ConfiguredHint string + EvidenceDigest string + IndependentlyVerifiedByGenerator bool + Source string + Status string + Verifier string + Volatile bool + type BigQueryTableFieldSchema struct + Collation string + DataPolicies []*BigQueryDataPolicyOption + DefaultValueExpr string + Description string + Fields []*BigQueryTableFieldSchema + MaxLength string + Mode string + Name string + PolicyTags *BigQueryPolicyTags + Precision string + RangeElementType *BigQueryFieldElementType + RoundingMode string + Scale string + Type string + func BigQueryTableFieldSchemaFromExpressionAnalyzerOutput(name string, out *googlesql.AnalyzerOutput) (*BigQueryTableFieldSchema, error) + func BigQueryTableFieldSchemaFromGoogleSQLType(name string, typ googlesql.Googlesql_TypeNode) (*BigQueryTableFieldSchema, error) + type BigQueryTableSchema struct + Fields []*BigQueryTableFieldSchema + func BigQueryTableSchemaFromAnalyzerOutput(out *googlesql.AnalyzerOutput) (*BigQueryTableSchema, error) + func BigQueryTableSchemaFromResolvedQuery(query *googlesql.ResolvedQueryStmt) (*BigQueryTableSchema, error) + type Catalog struct + Indexes map[string]*Index + Models map[string]*Model + PropertyGraphs map[string]*PropertyGraph + ProtoDescriptors *ProtoDescriptorSet + ProtoTypes map[string]bool + Sequences map[string]*Sequence + Tables map[string]*Table + ViewOrder []string + Views map[string]*View + func BuildSchemaCatalog(path, ddlSQL string) (*Catalog, error) + func (c *Catalog) ApplyDDL(ddl ast.DDL) error + func (c *Catalog) LoadProtoDescriptorSetFiles(paths []string) error + type Column struct + AllowCommitTimestamp bool + DefaultSQL string + GeneratedSQL string + Hidden bool + Name string + NotNull bool + OnUpdateSQL string + PrimaryKey bool + Type *TypeSpec + type GoogleSQLCatalog struct + AnalyzerOptions *googlesql.AnalyzerOptions + DescriptorPool *googlesql.DescriptorPool + SimpleCatalog *googlesql.SimpleCatalog + SpannerCatalog *Catalog + TypeFactory *googlesql.TypeFactory + func BuildGoogleSQLCatalogFromDDL(path, ddlSQL string, protoDescriptorPaths []string, options ...AnalyzerOption) (*GoogleSQLCatalog, error) + func BuildGoogleSQLCatalogFromSpannerCatalog(schema *Catalog, options ...AnalyzerOption) (*GoogleSQLCatalog, error) + func (c *GoogleSQLCatalog) FunctionCatalogDebugString(verbose bool) (string, error) + func (c *GoogleSQLCatalog) Helper() *GoogleSQLHelper + func (c *GoogleSQLCatalog) TypeSpecToGoogleSQLType(spec *TypeSpec) (googlesql.Googlesql_TypeNode, error) + type GoogleSQLHelper struct + Catalog *googlesql.SimpleCatalog + Options *googlesql.AnalyzerOptions + TypeFactory *googlesql.TypeFactory + func (h *GoogleSQLHelper) AnalyzeExpression(sql string) (*googlesql.AnalyzerOutput, error) + func (h *GoogleSQLHelper) AnalyzeStatement(sql string) (*googlesql.AnalyzerOutput, error) + func (h *GoogleSQLHelper) Parse(sqlMode, sql string) (*googlesql.ParserOutput, error) + func (h *GoogleSQLHelper) ParseDebugString(sqlMode, sql string) (string, error) + func (h *GoogleSQLHelper) ResolvedASTDebugString(sqlMode, sql string) (string, error) + func (h *GoogleSQLHelper) Unparse(sqlMode, sql string) (string, error) + type GraphDerivedProperty struct + Name string + SQL string + type GraphElement struct + Alias string + Destination *GraphEndpoint + DynamicLabel string + DynamicProperties string + KeyColumns []string + Labels []*GraphLabelProperties + Name string + Properties *GraphProperties + PropertiesSQL string + Source *GraphEndpoint + type GraphEndpoint struct + ElementReference string + KeyColumns []string + ReferenceColumns []string + type GraphLabelProperties struct + Default bool + Name string + Properties *GraphProperties + PropertiesSQL string + type GraphProperties struct + AllColumns bool + DerivedProperties []*GraphDerivedProperty + ExceptColumns []string + NoProperties bool + type Index struct + Keys []*KeyPart + Name ObjectName + NullFiltered bool + StoredColumns []string + TableName ObjectName + type KeyPart struct + Desc bool + Name string + type Model struct + Inputs []*ModelColumn + Name string + Outputs []*ModelColumn + type ModelColumn struct + Name string + Type *TypeSpec + type ObjectName struct + Parts []string + func (n ObjectName) String() string + type PropertyGraph struct + EdgeTables []*GraphElement + Name string + NodeTables []*GraphElement + RawSQL string + type ProtoDescriptorSet struct + func LoadProtoDescriptorSetFiles(paths []string) (*ProtoDescriptorSet, error) + type QueryCodegenDiagnosticError struct + Err error + ID string + Message string + Stage string + Subject string + func (e QueryCodegenDiagnosticError) Error() string + func (e QueryCodegenDiagnosticError) Unwrap() error + type QueryCodegenPlanVetSuppression struct + Expires string + Owner string + Reason string + Rule string + type QueryCodegenPlanWarning struct + Message string + Remediation string + Rule string + Severity string + type Sequence struct + Name ObjectName + type StructField struct + Name string + Type *TypeSpec + type Table struct + Columns []*Column + Name ObjectName + PrimaryKey []*KeyPart + Synonyms []string + func (t *Table) Column(name string) (*Column, int) + type TypeSpec struct + ArrayElement *TypeSpec + Code spannerpb.TypeCode + Length *int64 + Max bool + ProtoTypeFQN string + StructFields []StructField + Tokenlist bool + func ParseTypeSpec(path, typeSQL string) (*TypeSpec, error) + func TypeSpecFromSpannerPB(t *spannerpb.Type) (*TypeSpec, error) + func (t *TypeSpec) SpannerPB() (*spannerpb.Type, error) + type View struct + Name ObjectName + Query string