public final class SQLEnvCatalogLoader extends Object
UnifiedCatalogModel and writes every catalog/schema/
table/view/routine into a TSQLEnv via the existing public mutation API.
Plan §8.2 / §12 (T1C.2). Per spike T0.3 inventory the loader uses only public TSQLEnv
mutation methods and the public catalog-tree API (TSQLEnv.getSQLCatalog(java.lang.String, boolean),
TSQLCatalog.getSchema(java.lang.String, boolean), TSQLSchema.createTable(java.lang.String), etc.) — no reflection,
no private-field access. The catalog-tree path mirrors SqlflowSQLEnv so
schema-less dialects (MySQL, where TSQLEnv.supportSchema(EDbVendor) is
false) route through TSQLEnv.DEFAULT_SCHEMA_NAME the same way the
legacy loader does.
Sequences are not modeled in TSQLEnv (no dotSequence member of
ESQLDataObjectType); they are represented in the runtime layer instead. The
loader records an INFO diagnostic for each skipped sequence so callers can correlate
the gap.
| Constructor and Description |
|---|
SQLEnvCatalogLoader() |
| Modifier and Type | Method and Description |
|---|---|
CatalogLoadResult |
loadIntoSQLEnv(TSQLEnv env,
UnifiedCatalogModel model,
CatalogLoadOptions options)
Walk
model and apply it to env. |
TSQLEnv |
loadToSQLEnv(UnifiedCatalogModel model,
CatalogLoadOptions options)
Convenience: spin up a fresh
TSQLEnv (concrete TDDLSQLEnv subclass
with empty defaults) and apply model to it. |
public SQLEnvCatalogLoader()
public CatalogLoadResult loadIntoSQLEnv(TSQLEnv env, UnifiedCatalogModel model, CatalogLoadOptions options)
model and apply it to env. Validation runs first; default mode
fails on ERROR-severity diagnostics and strict mode also fails on WARN, matching
DefaultCatalogLoader (plan §15).
On a validation failure this method throws CatalogException carrying the
counts of ERROR / WARN diagnostics — CatalogLoadResult is only returned on
success. This matches CatalogLoaders.DefaultCatalogLoader.load(...); the
sink (when set on options) still receives every diagnostic before the
exception fires so callers can correlate. On non-validation success the returned
result carries the populated env plus any informational diagnostics emitted by the
loader (e.g. unrepresented sequences).
public TSQLEnv loadToSQLEnv(UnifiedCatalogModel model, CatalogLoadOptions options)
TSQLEnv (concrete TDDLSQLEnv subclass
with empty defaults) and apply model to it. Throws CatalogException
on failure to match DefaultCatalogLoader.load(...) semantics.