Skip to content

Instantly share code, notes, and snippets.

@juancho088
Created February 17, 2019 17:19
Show Gist options
  • Save juancho088/b5689714a98d2fe2d7a72107778a83e3 to your computer and use it in GitHub Desktop.
Save juancho088/b5689714a98d2fe2d7a72107778a83e3 to your computer and use it in GitHub Desktop.
DSL Kotlin Exposed Example
// READ
val query: Query = StarWarsFilms.select { StarWarsFilms.sequelId eq 8 }
// INSERT
val id = StarWarsFilms.insertAndGetId {
it[name] = "The Last Jedi"
it[sequelId] = 8
it[director] = "Rian Johnson"
}
// UPDATE
StarWarsFilms.update ({ StarWarsFilms.sequelId eq 8 }) {
it[name] = "Episode VIII – The Last Jedi"
}
// DELETE
StarWarsFilms.deleteWhere { StarWarsFilms.sequelId eq 8 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment