Interface ISchemaExaminer
- All Known Implementing Classes:
SchemaExaminer
public interface ISchemaExaminer
-
Method Summary
Modifier and TypeMethodDescriptionbooleancolumnExists(String schema, Token table, Token column) Check if a column exists in a specified schema and table.default booleancolumnExists(String schema, String table, String column) Check if a column exists in a specified schema and table.booleanhasPrimaryKey(String schema, Token table) Check if a primary key exists for a table in a schema.default booleanhasPrimaryKey(String schema, String table) Check if a primary key exists for a table in a schema.booleanschemaExists(String schema) Check if a schema exists.booleantableExists(String schema, Token table) Check if a table exists in a specified schema.default booleantableExists(String schema, String table) Check if a table exists in a specified schema.
-
Method Details
-
columnExists
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)withToken.literal(String)- Parameters:
schema- the schema to check intable- the table to be checked, will be tokenized, for example "myTable" will reference table "my_table" for MariaDbcolumn- 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
Check if a column exists in a specified schema and table.- Parameters:
schema- the schema to check intable- the table to be checkedcolumn- the column to be checked- Returns:
- true if the table exists, false otherwise
-
tableExists
Check if a table exists in a specified schema.Note: to specify non-standard table names, use
tableExists(String, Token)withToken.literal(String)- Parameters:
schema- the schema to check intable- 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
Check if a table exists in a specified schema.- Parameters:
schema- the schema to check intable- the table to be checked.- Returns:
- true if the table exists, false otherwise
-
schemaExists
Check if a schema exists.- Parameters:
schema- the schema to check- Returns:
- true if the schema exists, false otherwise
-
hasPrimaryKey
Check if a primary key exists for a table in a schema.Note: to specify non-standard table names, use
hasPrimaryKey(String, Token)withToken.literal(String)- Parameters:
schema- the schema to check intable- the table to be checked- Returns:
- true if the table has a primary key, false otherwise
-
hasPrimaryKey
Check if a primary key exists for a table in a schema.- Parameters:
schema- the schema to check intable- the table to be checked- Returns:
- true if the table has a primary key, false otherwise
-