public final class CatalogRuntime extends Object implements AutoCloseable
CatalogProvider, holds the current
CatalogSnapshot, exposes the CatalogResolver, and manages the mutable
CatalogOverlay.
Plan §5.1 / §5.4 / §7.2. Resolver lookup precedence:
CatalogOverlay — DDL discovered mid-batch, temp tables, addTable.CatalogSnapshot — immutable snapshot from the last
CatalogProvider.snapshot(CatalogQuery) call.provider.snapshot(...)
is asked for the missing name and the result merged into the cached snapshot.Read-only consumers (resolver, future SQLGuard, future Semantic IR) target the
snapshot/resolver; live sources implement CatalogProvider. The runtime is
single-threaded by default; concurrent parsers should use one runtime per analysis run.
| Modifier and Type | Class and Description |
|---|---|
static class |
CatalogRuntime.Builder |
| Modifier and Type | Method and Description |
|---|---|
static CatalogRuntime.Builder |
builder() |
void |
close() |
List<CatalogEntry> |
findChildren(CatalogObjectId parent,
CatalogObjectKind kind)
Children of
parent restricted to kind, drawing from the lazy
children map captured at fetch time and (additively) the cached snapshot. |
CatalogEntry |
findEntry(CatalogQualifiedName name,
CatalogObjectKind kind)
Walk overlay → lazy cache → snapshot in resolver-precedence order and return the
first matching
CatalogEntry. |
CatalogLoadingMode |
loadingMode() |
CatalogOverlay |
overlay() |
CatalogProvider |
provider() |
CatalogSnapshot |
refresh(CatalogQuery query)
Bypass any cached snapshot and force a fresh fetch.
|
void |
resetForNewAnalysis()
Reset per-analysis state: clears the overlay, the lazy fetch cache, and the
fetch counter.
|
CatalogResolver |
resolver() |
CatalogSnapshot |
snapshot()
Current cached snapshot.
|
CatalogSnapshot |
snapshot(CatalogQuery query)
Eagerly request a snapshot for the given query and cache it.
|
EDbVendor |
vendor() |
public static CatalogRuntime.Builder builder()
public CatalogProvider provider()
public CatalogOverlay overlay()
public CatalogResolver resolver()
public CatalogLoadingMode loadingMode()
public CatalogSnapshot snapshot()
null until snapshot(CatalogQuery)
or refresh(CatalogQuery) is called.public CatalogSnapshot snapshot(CatalogQuery query)
requestedNames or not. Clears the lazy fetch cache because previously
fetched per-name results may now be stale relative to the new snapshot.public CatalogSnapshot refresh(CatalogQuery query)
public void resetForNewAnalysis()
refresh(CatalogQuery).public CatalogEntry findEntry(CatalogQualifiedName name, CatalogObjectKind kind)
CatalogEntry. Used by the legacy TSQLEnv bridge
after a successful CatalogResolver.resolve(gudusoft.gsqlparser.catalog.runtime.CatalogContext, gudusoft.gsqlparser.catalog.runtime.CatalogQualifiedName) to recover the underlying entry
(the binding alone does not carry properties+children). Returns null when
no layer holds the entry.public List<CatalogEntry> findChildren(CatalogObjectId parent, CatalogObjectKind kind)
parent restricted to kind, drawing from the lazy
children map captured at fetch time and (additively) the cached snapshot. Used by
the bridge to materialize columns when the legacy resolver asks for a table/view
via ICatalogProvider.findObject(java.lang.String, java.lang.String, java.lang.String, gudusoft.gsqlparser.sqlenv.ESQLDataObjectType); the
lazy resolver path preserves children at fetch time so the bridge can attach them
to the materialized TSQLTable.public void close()
close in interface AutoCloseable