Skip to content

Instantly share code, notes, and snippets.

@juancho088
Created February 17, 2019 17:50
Show Gist options
  • Save juancho088/478ddbb94f9ff336303b9bef43484e64 to your computer and use it in GitHub Desktop.
Save juancho088/478ddbb94f9ff336303b9bef43484e64 to your computer and use it in GitHub Desktop.
Kotlin Exposed DAO example
// CREATE
val movie = StarWarsFilm.new {
name = "The Last Jedi"
sequelId = 8
director = "Rian Johnson"
}
// READ
val movies = StarWarsFilm.all()
val movies = StarWarsFilm.find { StarWarsFilms.sequelId eq 8 }
val movie = StarWarsFilm.findById(5)
// UPDATE
movie.name = "Episode VIII – The Last Jedi"
// DELETE
movie.delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment