jvmMain.dev.inmo.micro_utils.repos.exposed.ExposedTableInitialization.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro_utils.repos.exposed-jvm Show documentation
Show all versions of micro_utils.repos.exposed-jvm Show documentation
It is set of projects with micro tools for avoiding of routines coding
package dev.inmo.micro_utils.repos.exposed
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.transaction
fun Table.initTable(database: Database) {
transaction(database) { SchemaUtils.createMissingTablesAndColumns(this@initTable) }
}
fun T.initTable() where T: ExposedRepo, T: Table = initTable(database)