Documentation
¶
Index ¶
- type Mapping
- type MappingSchema
- func (m *MappingSchema) AddTable(table any, columnMapping any, dialect dialects.DialectType, normalize *bool, ...) error
- func (m *MappingSchema) ColumnNames(table any, onlyVisible bool, dialect dialects.DialectType, normalize *bool) ([]string, error)
- func (m *MappingSchema) Dialect() *dialects.Dialect
- func (m *MappingSchema) Empty() bool
- func (m *MappingSchema) Find(table exp.Expression, raiseOnMissing bool, ensureDataTypes bool) (*Mapping, error)
- func (m *MappingSchema) GetColumnType(table any, column any, dialect dialects.DialectType, normalize *bool) (exp.Expression, error)
- func (m *MappingSchema) GetUDFType(udf any, dialect dialects.DialectType, normalize *bool) (exp.Expression, error)
- func (m *MappingSchema) HasColumn(table any, column any, dialect dialects.DialectType, normalize *bool) (bool, error)
- func (m *MappingSchema) SupportedTableArgs() []string
- type Schema
- type SchemaType
- type TrieResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapping ¶
type Mapping struct {
// contains filtered or unexported fields
}
func NewMapping ¶
func NewMapping() *Mapping
type MappingSchema ¶
type MappingSchema struct {
// contains filtered or unexported fields
}
func NewMappingSchema ¶
func NewMappingSchema(schema *Mapping, dialect dialects.DialectType, normalize bool) (*MappingSchema, error)
func NewMappingSchemaWithImplicit ¶
func NewMappingSchemaWithImplicit(schema *Mapping, implicit *Mapping, dialect dialects.DialectType, normalize bool) (*MappingSchema, error)
NewMappingSchemaWithImplicit is NewMappingSchema plus a NON-UPSTREAM implicit-column marking (DEVIATIONS): implicit mirrors the mapping's nesting with []string leaves naming the columns that exist in the mapping but are engine-implicit (e.g. PG's ctid/xmin/xmax/cmin/cmax/tableoid). An implicit column resolves like any column when named explicitly, but is excluded from `SELECT *` / `t.*` expansion and from NATURAL JOIN / USING candidate sets — the upstream `visible` mechanism, populated as the implicit set's complement. The implicit *Mapping uses the same node keys as the RAW mapping (pre-normalization, never re-split on dots — a table literally named "x.foo" is a node key like any other): depth 1 = table → []string, depth 2 = schema → table → []string, depth 3 = catalog → schema → table → []string (the primary consumer shape). An implicit key or column absent from the mapping is an input error (fail-closed), never silently ignored.
func (*MappingSchema) AddTable ¶
func (m *MappingSchema) AddTable(table any, columnMapping any, dialect dialects.DialectType, normalize *bool, matchDepth bool) error
func (*MappingSchema) ColumnNames ¶
func (m *MappingSchema) ColumnNames(table any, onlyVisible bool, dialect dialects.DialectType, normalize *bool) ([]string, error)
func (*MappingSchema) Dialect ¶
func (m *MappingSchema) Dialect() *dialects.Dialect
func (*MappingSchema) Empty ¶
func (m *MappingSchema) Empty() bool
func (*MappingSchema) Find ¶
func (m *MappingSchema) Find(table exp.Expression, raiseOnMissing bool, ensureDataTypes bool) (*Mapping, error)
func (*MappingSchema) GetColumnType ¶
func (m *MappingSchema) GetColumnType(table any, column any, dialect dialects.DialectType, normalize *bool) (exp.Expression, error)
func (*MappingSchema) GetUDFType ¶
func (m *MappingSchema) GetUDFType(udf any, dialect dialects.DialectType, normalize *bool) (exp.Expression, error)
func (*MappingSchema) HasColumn ¶
func (m *MappingSchema) HasColumn(table any, column any, dialect dialects.DialectType, normalize *bool) (bool, error)
func (*MappingSchema) SupportedTableArgs ¶
func (m *MappingSchema) SupportedTableArgs() []string
type Schema ¶
type Schema interface {
AddTable(table any, columnMapping any, dialect dialects.DialectType, normalize *bool, matchDepth bool) error
ColumnNames(table any, onlyVisible bool, dialect dialects.DialectType, normalize *bool) ([]string, error)
GetColumnType(table any, column any, dialect dialects.DialectType, normalize *bool) (exp.Expression, error)
HasColumn(table any, column any, dialect dialects.DialectType, normalize *bool) (bool, error)
GetUDFType(udf any, dialect dialects.DialectType, normalize *bool) (exp.Expression, error)
SupportedTableArgs() []string
Empty() bool
Dialect() *dialects.Dialect
Find(table exp.Expression, raiseOnMissing bool, ensureDataTypes bool) (*Mapping, error)
}
func EnsureSchema ¶
func EnsureSchema(s SchemaType, dialect dialects.DialectType, normalize bool) (Schema, error)
type SchemaType ¶
type SchemaType = any
SchemaType is the polymorphic column-schema argument, mirroring upstream sqlglot's SchemaType. A value is one of:
- nil — an empty schema
- *Mapping — a column-name→type mapping (build one with schema.M or NewMapping)
- Schema — an already-built Schema (e.g. *MappingSchema), returned as-is
It is a type alias for any, so it is fully interchangeable with any: adding it to a signature never breaks an existing caller.