public final class CatalogLoaders extends Object
CatalogLoader.
Plan §7.1 / §13.4. loadToSQLEnv(CatalogInputSource, CatalogLoadOptions)
and loadIntoSQLEnv(TSQLEnv, UnifiedCatalogModel, CatalogLoadOptions) delegate
to SQLEnvCatalogLoader (sqlenv/compat) — that bridge ships in P1C; until
then those entry points throw a clear UnsupportedOperationException pointing
at the bridge work item. loadRuntime(CatalogInputSource, CatalogLoadOptions)
and fromProvider(CatalogProvider, CatalogProviderConfig) are fully wired.
public static CatalogLoader defaultLoader()
public static CatalogRuntime loadRuntime(CatalogInputSource source, CatalogLoadOptions options)
CatalogInputSource into a UnifiedCatalogModel
via CatalogInputReaders.forSource(gudusoft.gsqlparser.catalog.input.CatalogInputSource, gudusoft.gsqlparser.catalog.input.CatalogLoadOptions) and materialize a CatalogRuntime
around a ModelBackedCatalogProvider. Diagnostics from validation are
forwarded to options.diagnosticSink() when present.public static CatalogRuntime fromProvider(CatalogProvider provider, CatalogProviderConfig config)
CatalogProvider in a CatalogRuntime. The
provider must already be opened
by the caller; this facade does not do lifecycle management.
The runtime is configured with vendor EDbVendor.dbvgeneric,
which means resolver candidate-expansion will not apply per-vendor identifier folding
or search-path rules. Most callers want
fromProvider(CatalogProvider, CatalogProviderConfig, gudusoft.gsqlparser.EDbVendor)
instead — the vendor-explicit overload — because correct resolution depends on
matching the snapshot's vendor. We deliberately do NOT probe the provider for a
vendor here: live/lazy providers treat an empty requestedNames
CatalogQuery as "fetch every object",
which would defeat the lazy contract just to discover a vendor.
public static CatalogRuntime fromProvider(CatalogProvider provider, CatalogProviderConfig config, EDbVendor vendor)
fromProvider(CatalogProvider, CatalogProviderConfig).
Preferred form when the caller knows the provider's vendor — bypasses the probe
snapshot and ensures the runtime's resolver candidate-expansion uses the right
vendor for identifier folding and search-path resolution.public static TSQLEnv loadToSQLEnv(CatalogInputSource source, CatalogLoadOptions options)
source into a UnifiedCatalogModel and apply it to
a freshly-constructed TSQLEnv via SqlEnvCatalogBridge.from(gudusoft.gsqlparser.catalog.input.model.UnifiedCatalogModel, gudusoft.gsqlparser.catalog.input.CatalogLoadOptions). This is
the eager path the design §5.1 demo uses.public static CatalogLoadResult loadIntoSQLEnv(TSQLEnv env, UnifiedCatalogModel model, CatalogLoadOptions options)
model to an existing caller-managed TSQLEnv via
SQLEnvCatalogLoader.loadIntoSQLEnv(gudusoft.gsqlparser.sqlenv.TSQLEnv, gudusoft.gsqlparser.catalog.input.model.UnifiedCatalogModel, gudusoft.gsqlparser.catalog.input.CatalogLoadOptions).public static TSQLEnv loadToSQLEnvForSql(CatalogInputSource source, CatalogLoadOptions options, String sqlText)
sqlText via
TGSqlParser.getrawsqlstatements() to populate CatalogQuery.requestedNames
before opening the provider, so live providers can batch fetches.