public final class SQLEnvToCatalogRuntimeAdapter extends Object
CatalogRuntime view over a hand-built TSQLEnv.
Plan §6 / §8.5. Lets new consumers (SQLGuard, Semantic IR, anything that targets
the new SPI) accept a hand-built TSQLEnv from upstream callers without
re-implementing the catalog traversal each time.
The resulting runtime is read-only at the snapshot level: subsequent mutations to
the underlying TSQLEnv are not reflected, since adapt(gudusoft.gsqlparser.sqlenv.TSQLEnv) takes a
point-in-time snapshot. Callers that need fresh views should call adapt(gudusoft.gsqlparser.sqlenv.TSQLEnv)
again. The mutable CatalogOverlay is
still available on the runtime for new consumers (DDL discovered downstream).
| Constructor and Description |
|---|
SQLEnvToCatalogRuntimeAdapter() |
| Modifier and Type | Method and Description |
|---|---|
CatalogRuntime |
adapt(TSQLEnv env)
|
CatalogRuntime |
adapt(TSQLEnv env,
IdentifierConfig identifierConfig)
Same as
adapt(TSQLEnv) but with an explicit IdentifierConfig
override so the snapshot keys are built under a non-default policy (e.g. |
CatalogSnapshot |
snapshot(TSQLEnv env)
Build the snapshot directly without wrapping it in a runtime.
|
public SQLEnvToCatalogRuntimeAdapter()
public CatalogRuntime adapt(TSQLEnv env)
CatalogRuntime that exposes the contents of env as an
immutable CatalogSnapshot. The snapshot covers every catalog → schema →
table/view/routine/synonym walk reachable from TSQLEnv.getCatalogList()
including columns on tables and views.public CatalogRuntime adapt(TSQLEnv env, IdentifierConfig identifierConfig)
adapt(TSQLEnv) but with an explicit IdentifierConfig
override so the snapshot keys are built under a non-default policy (e.g. MSSQL
collation, MySQL lower_case_table_names). Vendor must match env.public CatalogSnapshot snapshot(TSQLEnv env)