kotlin
dependencies {
implementation("io.korm:korm-core:1.0.0")
}
kotlin
Korm.init {
dialect = "mysql"
url = "jdbc:mysql://localhost:3306/mydatabase"
driver = "com.mysql.jdbc.Driver"
username = "username"
password = "password"
}
kotlin
@Table("users")
data class User(
@Id val id: Int,
val name: String,
val age: Int
)
kotlin
val user = User(1, "John", 25)
user.insert()
val users = User.list()