Class MetaContainer

java.lang.Object
org.pgcodekeeper.core.schema.meta.MetaContainer

public final class MetaContainer extends Object
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 Details

    • MetaContainer

      public MetaContainer()
  • Method Details

    • addStatement

      public void addStatement(IStatement st)
      Adds a statement to the appropriate collection based on its type.
      Parameters:
      st - the statement to add
    • containsCastImplicit

      public boolean containsCastImplicit(String source, String target)
      Checks if there is an implicit cast from source to target type.
      Parameters:
      source - the source data type
      target - the target data type
      Returns:
      true if an implicit cast exists, false otherwise
    • findRelation

      public IRelation findRelation(String schemaName, String relationName)
      Finds a relation by schema and name.
      Parameters:
      schemaName - the schema name
      relationName - the relation name
      Returns:
      the relation, or null if not found
    • getRelations

      public Map<String,Map<String,IRelation>> getRelations()
      Returns all relations grouped by schema name.
      Returns:
      unmodifiable map of relations
    • findFunction

      public IFunction findFunction(String schemaName, String functionName)
      Finds a function by schema and name.
      Parameters:
      schemaName - the schema name
      functionName - the function name
      Returns:
      the function, or null if not found
    • findChFunction

      public boolean findChFunction(String functionName)
      Checks if a ClickHouse function exists.
      Parameters:
      functionName - the function name
      Returns:
      true if the function exists, false otherwise
    • availableChFunctions

      public Collection<IFunction> availableChFunctions()
      Returns all available ClickHouse functions.
      Returns:
      unmodifiable collection of ClickHouse functions
    • availableFunctions

      public Collection<IFunction> availableFunctions(String schemaName)
      Returns available functions in the specified schema.
      Parameters:
      schemaName - the schema name
      Returns:
      unmodifiable collection of functions
    • findOperator

      public IOperator findOperator(String schemaName, String operatorName)
      Finds an operator by schema and name.
      Parameters:
      schemaName - the schema name
      operatorName - the operator name
      Returns:
      the operator, or null if not found
    • findType

      public MetaCompositeType findType(String schemaName, String typeName)
      Finds a PostgreSQL composite type by schema and name.
      Parameters:
      schemaName - the schema name
      typeName - the type name
      Returns:
      the composite type, or null if not found
    • availableOperators

      public Collection<IOperator> availableOperators(String schemaName)
      Returns available operators in the specified schema.
      Parameters:
      schemaName - the schema name
      Returns:
      unmodifiable collection of operators
    • getConstraints

      public Collection<IConstraint> getConstraints(String schemaName, String tableName)
      Returns constraints for the specified table.
      Parameters:
      schemaName - the schema name
      tableName - the table name
      Returns:
      collection of constraints for the table