public final class SqlflowNameForm extends Object
nameForm declaration of the sqlflow servers metadata format (plain and
sharded), for a reader that works on the parsed JSON tree itself.
A file declares once, at its root, how it writes object names: SQL_LEXICAL
("Amount", the default and what the sqlflow-ingester exporter emits) or
CATALOG_STORED (Amount, the name the database catalog holds). Every reader
of the format reads names as SQL text, so a CATALOG_STORED tree is rewritten here,
once, into the SQL spelling of the same stored names. The spelling rule itself is
TSQLEnv.toLexical(gudusoft.gsqlparser.EDbVendor, gudusoft.gsqlparser.sqlenv.ESQLDataObjectType, java.lang.String, gudusoft.gsqlparser.sqlenv.IdentifierInputForm); this class only knows which JSON key holds which kind of name.
SqlflowSQLEnv and SqlflowShardedSQLEnv apply the same rule name by name
instead, because their public constructors receive a caller-owned map that must not be
modified. See docs/refactor/identifier/README.md, "Catalog inputs and name output".
| Modifier and Type | Method and Description |
|---|---|
static IdentifierInputForm |
declared(Map root)
The form a
servers file declares; SQL_LEXICAL when it declares none. |
static void |
shardToLexicalInPlace(EDbVendor vendor,
Map shard,
ESQLDataObjectType role,
IdentifierInputForm manifestForm)
Rewrite one catalog or schema shard of a sharded export, in place.
|
static IdentifierInputForm |
toLexicalInPlace(EDbVendor defaultVendor,
Map root)
Rewrite a parsed
servers file, in place, so that its names are SQL text. |
public static IdentifierInputForm declared(Map root)
servers file declares; SQL_LEXICAL when it declares none.TSQLEnv.InvalidNameFormException - for a misspelt valuepublic static IdentifierInputForm toLexicalInPlace(EDbVendor defaultVendor, Map root)
servers file, in place, so that its names are SQL text. Does
nothing unless the file declares CATALOG_STORED. The declaration is then changed
to SQL_LEXICAL, so a second call cannot encode the names twice.defaultVendor - the dialect of a server that carries no dbVendorpublic static void shardToLexicalInPlace(EDbVendor vendor, Map shard, ESQLDataObjectType role, IdentifierInputForm manifestForm)
nameForm covers all of them.role - what the shard's own name is (dotCatalog or
dotSchema), or null to leave it alone