Skip to content

Instantly share code, notes, and snippets.

@pjagielski
Created February 11, 2019 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjagielski/9b9d3c33b23f19460805b40b044e7b66 to your computer and use it in GitHub Desktop.
Save pjagielski/9b9d3c33b23f19460805b40b044e7b66 to your computer and use it in GitHub Desktop.
UserTable.select { UserTable.username eq username }?.toUser()
// or
UserTable.select { UserTable.username like username }.map { it.toUser() }
fun ResultRow.toUser() = User(
username = this[UserTable.username],
email = this[UserTable.email],
password = this[UserTable.password]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment