Skip to main content

Module schema

Module schema 

Source
Expand description

Schema management for SQL queries

This module provides functionality for:

  • Representing database schemas (tables, columns, types)
  • Looking up column types for query optimization
  • Normalizing identifiers per dialect

Based on the Python implementation in sqlglot/schema.py.

Structs§

ColumnInfo
A column with its type and visibility
MappingSchema
A mapping-based schema implementation

Enums§

SchemaError
Errors that can occur during schema operations
SchemaNode
A node in the schema tree

Constants§

TABLE_PARTS
Supported table argument names

Traits§

Schema
Abstract trait for database schemas

Functions§

ensure_schema
Ensure we have a schema instance
flatten_schema_paths
Flatten a nested schema to get all table paths
from_simple_map
Helper to build a schema from a simple map
nested_get
Get a value from a nested dictionary-like structure
nested_set
Set a value in a nested dictionary-like structure
normalize_name
Normalize a table or column name according to dialect rules

Type Aliases§

SchemaResult
Result type for schema operations