Database schema elements (views, constraints, tables) should be designed to be context-independent and self-contained. This means all identifiers should be fully qualified, and only information supported by the SQL parser should be included in DDL representations.
Database schema elements (views, constraints, tables) should be designed to be context-independent and self-contained. This means all identifiers should be fully qualified, and only information supported by the SQL parser should be included in DDL representations.
Key principles:
Example of context-independent view text:
// Bad - context-dependent
"SELECT * FROM my_table"
// Good - context-independent
"SELECT * FROM my_catalog.my_schema.my_table"
Example of parser-compatible constraint DDL:
// Remove unsupported validation status from DDL
return String.format(
"CONSTRAINT %s %s %s %s",
name,
definition(),
enforced ? "ENFORCED" : "NOT ENFORCED"
// validationStatus removed - not supported by parser
);
This approach ensures schema portability, reduces ambiguity, and maintains compatibility with SQL standards.
Enter the URL of a public GitHub repository