Interface ISchemaExaminer

All Known Implementing Classes:
SchemaExaminer

public interface ISchemaExaminer
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    columnExists(String schema, Token table, Token column)
    Check if a column exists in a specified schema and table.
    default boolean
    columnExists(String schema, String table, String column)
    Check if a column exists in a specified schema and table.
    boolean
    hasPrimaryKey(String schema, Token table)
    Check if a primary key exists for a table in a schema.
    default boolean
    hasPrimaryKey(String schema, String table)
    Check if a primary key exists for a table in a schema.
    boolean
    Check if a schema exists.
    boolean
    tableExists(String schema, Token table)
    Check if a table exists in a specified schema.
    default boolean
    tableExists(String schema, String table)
    Check if a table exists in a specified schema.
  • Method Details

    • columnExists

      @CheckReturnValue default boolean columnExists(String schema, String table, String column)
      Check if a column exists in a specified schema and table.

      Note: to specify non-standard table or column names, use columnExists(String, Token, Token) with Token.literal(String)

      Parameters:
      schema - the schema to check in
      table - the table to be checked, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
      column - the column to be checked, will be tokenized, for example "myColumn" will reference column "my_column" for MariaDb
      Returns:
      true if the table exists, false otherwise
    • columnExists

      @CheckReturnValue boolean columnExists(String schema, Token table, Token column)
      Check if a column exists in a specified schema and table.
      Parameters:
      schema - the schema to check in
      table - the table to be checked
      column - the column to be checked
      Returns:
      true if the table exists, false otherwise
    • tableExists

      @CheckReturnValue default boolean tableExists(String schema, String table)
      Check if a table exists in a specified schema.

      Note: to specify non-standard table names, use tableExists(String, Token) with Token.literal(String)

      Parameters:
      schema - the schema to check in
      table - the table to be checked, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
      Returns:
      true if the table exists, false otherwise
    • tableExists

      @CheckReturnValue boolean tableExists(String schema, Token table)
      Check if a table exists in a specified schema.
      Parameters:
      schema - the schema to check in
      table - the table to be checked.
      Returns:
      true if the table exists, false otherwise
    • schemaExists

      @CheckReturnValue boolean schemaExists(String schema)
      Check if a schema exists.
      Parameters:
      schema - the schema to check
      Returns:
      true if the schema exists, false otherwise
    • hasPrimaryKey

      @CheckReturnValue default boolean hasPrimaryKey(String schema, String table)
      Check if a primary key exists for a table in a schema.

      Note: to specify non-standard table names, use hasPrimaryKey(String, Token) with Token.literal(String)

      Parameters:
      schema - the schema to check in
      table - the table to be checked
      Returns:
      true if the table has a primary key, false otherwise
    • hasPrimaryKey

      @CheckReturnValue boolean hasPrimaryKey(String schema, Token table)
      Check if a primary key exists for a table in a schema.
      Parameters:
      schema - the schema to check in
      table - the table to be checked
      Returns:
      true if the table has a primary key, false otherwise