public final class SqldepCatalogInputReader extends Object implements CatalogInputReader
CatalogInputKind.SQLDEP_JSON sources — the JSON shape the legacy
SQLDepSQLEnv consumes (plan §11 T2.A.4 / first Phase 2.A static-file adapter).
Per plan §6 / §11.2 this reader funnels the SQLDep export shape into the same
UnifiedCatalogModel the JSON-manifest reader uses; the eager bridge then
materializes a TSQLEnv byte-for-byte equivalent to what the legacy
SQLDepSQLEnv would build (parity test in SqldepLegacyParityTest).
The legacy path remains untouched per plan §8.5.
SQLDep export schema (key fields):
{
"createdBy": "sqldep ...", // optional but conventional; not required
"databaseModel": { ... }, // optional outer wrapper
"databases": [
{
"name": "ORCL",
"tables": [
{
"schema": "HR", // per-table schema label
"name": "EMPLOYEES",
"isView": "false", // optional, string boolean
"columns": [{"name": "..."}, ...]
}
]
}
]
}
The reader is dispatch-by-CatalogInputKind.SQLDEP_JSON (callers tag the
source explicitly). Auto-claim by createdBy content marker is intentionally
not implemented here — that dispatch already lives in the legacy
TJSONSQLEnvParser and reproducing it inside a supports() pre-scan
would force every SQLDep candidate source to be drained twice.
Identifier names with embedded dots are wrapped with the vendor's quote
character before storage. Without the wrap, ModelBackedCatalogProvider
later concatenates segments with . into qualified strings (e.g.
catalog.schema.A.B) that CatalogIdentifierPolicy.parse would
split into four segments instead of three, and the runtime would never resolve
the SQL reference "A.B". The legacy SQLDepSQLEnv carries the
same defense — the delimiter chars come from TSQLEnv.delimitedChar —
and we duplicate that table here so catalog/** stays free of a
compile-time dependency on the sqlenv runtime layer.
CatalogModelValidator still surfaces an identifier-bypass WARN when
the produced names disagree with IdentifierService.normalize, exactly
as for the JSON-manifest reader.
| Modifier and Type | Class and Description |
|---|---|
static class |
SqldepCatalogInputReader.Factory
ServiceLoader-discoverable factory.
|
| Constructor and Description |
|---|
SqldepCatalogInputReader() |
| Modifier and Type | Method and Description |
|---|---|
CatalogInputKind |
kind() |
UnifiedCatalogModel |
read(CatalogInputSource source,
CatalogLoadOptions options) |
boolean |
supports(CatalogInputSource source,
CatalogLoadOptions options) |
public SqldepCatalogInputReader()
public CatalogInputKind kind()
kind in interface CatalogInputReaderpublic boolean supports(CatalogInputSource source, CatalogLoadOptions options)
supports in interface CatalogInputReaderpublic UnifiedCatalogModel read(CatalogInputSource source, CatalogLoadOptions options) throws CatalogInputException
read in interface CatalogInputReaderCatalogInputException