createSimpleDbTables

open fun <T : DbTableData> createSimpleDbTables(tableDefinitions: Set<T>, autoCreateSchema: Boolean = false)

The purpose of this function is to allow the creation of simple database tables based on the DbTableData data classes. By defining data classes that are subclasses of DbTableData, a limited CREATE TABLE specification can be obtained and the table created. Then, the database can be used to insert data from instances of the DbTableData subclasses. The DbTableData data classes cannot have auto-increment type primary keys. In addition, the tables will not have foreign key specifications nor referential integrity specifications. If supported by the underlying database engine, additional specifications could be added via alter table DDL specifications.

Parameters

tableDefinitions

an example set of table definitions based on DbTableData specifications. The specified table must not already exist in its specified schema.

autoCreateSchema

if true, if a table is in a schema that does not exist, the schema will automatically be created. The default is false. In which case, an error may occur if the schema does not exist to hold the table. Some databases do not support schemas. In that case, do not specify a schema for the table. Leave the schema null.