Class MetaContainer
java.lang.Object
org.pgcodekeeper.core.schema.meta.MetaContainer
Container for database metadata objects organized by type and schema.
Provides efficient lookup and storage of functions, operators, relations, constraints,
casts, and composite types from database schemas.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a statement to the appropriate collection based on its type.Returns all available ClickHouse functions.availableFunctions(String schemaName) Returns available functions in the specified schema.availableOperators(String schemaName) Returns available operators in the specified schema.booleancontainsCastImplicit(String source, String target) Checks if there is an implicit cast from source to target type.booleanfindChFunction(String functionName) Checks if a ClickHouse function exists.findFunction(String schemaName, String functionName) Finds a function by schema and name.findOperator(String schemaName, String operatorName) Finds an operator by schema and name.findRelation(String schemaName, String relationName) Finds a relation by schema and name.Finds a PostgreSQL composite type by schema and name.getConstraints(String schemaName, String tableName) Returns constraints for the specified table.Returns all relations grouped by schema name.
-
Constructor Details
-
MetaContainer
public MetaContainer()
-
-
Method Details
-
addStatement
Adds a statement to the appropriate collection based on its type.- Parameters:
st- the statement to add
-
containsCastImplicit
Checks if there is an implicit cast from source to target type.- Parameters:
source- the source data typetarget- the target data type- Returns:
- true if an implicit cast exists, false otherwise
-
findRelation
Finds a relation by schema and name.- Parameters:
schemaName- the schema namerelationName- the relation name- Returns:
- the relation, or null if not found
-
getRelations
Returns all relations grouped by schema name.- Returns:
- unmodifiable map of relations
-
findFunction
Finds a function by schema and name.- Parameters:
schemaName- the schema namefunctionName- the function name- Returns:
- the function, or null if not found
-
findChFunction
Checks if a ClickHouse function exists.- Parameters:
functionName- the function name- Returns:
- true if the function exists, false otherwise
-
availableChFunctions
Returns all available ClickHouse functions.- Returns:
- unmodifiable collection of ClickHouse functions
-
availableFunctions
Returns available functions in the specified schema.- Parameters:
schemaName- the schema name- Returns:
- unmodifiable collection of functions
-
findOperator
Finds an operator by schema and name.- Parameters:
schemaName- the schema nameoperatorName- the operator name- Returns:
- the operator, or null if not found
-
findType
Finds a PostgreSQL composite type by schema and name.- Parameters:
schemaName- the schema nametypeName- the type name- Returns:
- the composite type, or null if not found
-
availableOperators
Returns available operators in the specified schema.- Parameters:
schemaName- the schema name- Returns:
- unmodifiable collection of operators
-
getConstraints
Returns constraints for the specified table.- Parameters:
schemaName- the schema nametableName- the table name- Returns:
- collection of constraints for the table
-