I have a code that inserts a new row and returns its ID:
transaction {
val id = Comments.insert {
it[this.postId] = postId
it[msg] = comment.msg
it[this.createdBy] = createdBy
} get Comments.id
}
However, how can I return all values, not just ID? In SQL I would write a something as below:
INSERT INTO comments (post_id, msg, created_by)
VALUES (?, ?, ?)
RETURNING id, post_id, msg, created_by, created_at;