fun insertInto(table: Table, setBody: (InsertStatement) -> Unit): Builder
Run an insert statement, and collect results, i.e. the values of primary key column(s). For example:
val db : Database = ...
pragueId = db.insertInto(this) { row ->
row[name] = "Prague"
} run { r -> r[id] } // r[id] is assigned to pragueId
See InsertStatement.Builder for parameters and arguments that can be set. The statement is run with InsertStatement.Builder.run.
fun insertInto(table: Table): BuilderNoResults
Run an insert statement, but ignore any results, e.g. the values of primary keys. For example:
val db : Database = ...
db.insertInto(People) run { row ->
row[People.name] = "Alfred E. Neuman"
row[People.worried] = false
}
See InsertStatement.BuilderNoResults for parameters and arguments that can be set. The statement is run with InsertStatement.BuilderNoResults.run