Interface ISchemaBuilder
- All Superinterfaces:
- AutoCloseable
- All Known Implementing Classes:
- DryRunSchemaBuilder,- SchemaBuilder
- 
Method SummaryModifier and TypeMethodDescriptionAlter an existing table.default IAlterTableBuilderAlter an existing table.alterIfExists(Token table) Alter an existing table if it exists.default IAlterTableBuilderalterIfExists(String table) Alter an existing table if it exists.voidclose()booleancolumnExists(Token table, Token column) Check if a column exists.default booleancolumnExists(String table, String column) Check if a column exists.Create a new table.default ICreateTableBuilderCreate a new table.voidcreateDatabaseAndUser(String databaseName, String username, String password) Creates a new database and user.createIfNotExists(Token table) Create a new table if it does not already exist.default ICreateTableBuildercreateIfNotExists(String table) Create a new table.voidDrop an existing table.default voidDrop an existing table.voiddropIfExists(Token table) Drop an existing table if it exists.default voiddropIfExists(String table) Drop an existing table if it exists.booleanCheck if a table exists.default booleanCheck if a table exists.
- 
Method Details- 
createCreate a new table. Will fail if a table with the same name already exists.Note: remember to call IBaseBuilder.execute()Note: to specify non-standard table names, use create(Token)withToken.literal(String)- Parameters:
- table- that will be created, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
- Returns:
- a builder that can be used to build the new table.
 
- 
createCreate a new table. Will fail if a table with the same name already exists.Note: remember to call IBaseBuilder.execute()- Parameters:
- table- that will be created.
- Returns:
- a builder that can be used to build the new table.
 
- 
createIfNotExistsCreate a new table. Does nothing a table with the same name already exists, no matter its contents.Note: remember to call IBaseBuilder.execute()Note: to specify non-standard table names, use createIfNotExists(Token)withToken.literal(String)- Parameters:
- table- that will be created, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
- Returns:
- a builder that can be used to build the new table.
 
- 
createIfNotExistsCreate a new table if it does not already exist. Does nothing if a table with the same name already exists, no matter its contents.Note: remember to call IBaseBuilder.execute()- Parameters:
- table- that will be created if not already.
- Returns:
- a builder that can be used to build the new table.
 
- 
alterAlter an existing table.Note: remember to call IBaseBuilder.execute()Note: to specify non-standard table names, use alter(Token)withToken.literal(String)- Parameters:
- table- that will be altered, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
- Returns:
- a builder that can be used to alter the table.
 
- 
alterAlter an existing table.Note: remember to call IBaseBuilder.execute()- Parameters:
- table- that will be altered.
- Returns:
- a builder that can be used to alter the table.
 
- 
alterIfExistsAlter an existing table if it exists.Note: remember to call IBaseBuilder.execute()Note: to specify non-standard table names, use alterIfExists(Token)withToken.literal(String)- Parameters:
- table- that will be altered, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
- Returns:
- a builder that can be used to alter the table.
 
- 
alterIfExistsAlter an existing table if it exists.Note: remember to call IBaseBuilder.execute()- Parameters:
- table- that will be altered if it exists.
- Returns:
- a builder that can be used to alter the table.
 
- 
dropDrop an existing table.Note: to specify non-standard table names, use drop(Token)withToken.literal(String)- Parameters:
- table- that will be dropped, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
 
- 
dropDrop an existing table.- Parameters:
- table- that will be dropped.
 
- 
dropIfExistsDrop an existing table if it exists.Note: to specify non-standard table names, use dropIfExists(Token)withToken.literal(String)- Parameters:
- table- that will be dropped, will be tokenized, for example "myTable" will reference table "my_table" for MariaDb
 
- 
dropIfExistsDrop an existing table if it exists.- Parameters:
- table- that will be dropped.
 
- 
existsCheck if a table exists.Note: to specify non-standard table names, use exists(Token)withToken.literal(String)- Parameters:
- 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
 
- 
existsCheck if a table exists.- Parameters:
- table- to be checked
- Returns:
- true if the table exists, false otherwise
 
- 
columnExistsCheck if a column exists.Note: to specify non-standard table or column names, use columnExists(Token, Token)- Parameters:
- table- the table to check in, 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 column exists, false otherwise
 
- 
columnExistsCheck if a column exists.- Parameters:
- table- the table to check in
- column- the column to be checked
- Returns:
- true if the column exists, false otherwise
 
- 
createDatabaseAndUserCreates a new database and user. The user will be granted all privileges on the database.- Parameters:
- databaseName- The name of the database to create
- username- The name of the user to create
- password- The password of the user to create
 
- 
closevoid close()- Specified by:
- closein interface- AutoCloseable
 
 
-