https://kotlinlang.org logo
#exposed
Title
# exposed
g

Gunslingor

04/02/2020, 5:03 PM
I can't figure out how to insert records, docs seem old. When I try to assign the values in the insert it says val cannot be reassigned, like its ignoring the insert part. Any help?
Copy code
transaction {
    Categories.insert {

    }
}

object Categories : Table() {
    val category = varchar("category", 255)
    val description = varchar("description", 255)
    override val primaryKey = PrimaryKey(category, name = "PK_Category_category")
}
Oops... this seems to work, I put categories in quotes which screwed things up
Copy code
Categories.insert {
        it[category] = "test"
    }
3 Views