Created
February 17, 2019 17:19
-
-
Save juancho088/b5689714a98d2fe2d7a72107778a83e3 to your computer and use it in GitHub Desktop.
DSL Kotlin Exposed Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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