"org.h2.Driver") db.withSession { create (Cities, Users) val saintPetersburgId = insert (Cities.values("St. Petersburg")) get Cities.id val munichId = insert (Cities.values("Munich")) get Cities.id insert (Cities.values("Prague")) insert (Users.values("andrey", "Andrey", saintPetersburgId)) insert (Users.values("sergey", "Sergey", munichId)) insert (Users.values("eugene", "Eugene", munichId)) insert (Users.values("alex", "Alex", null)) insert (Users.values("smth", "Something", null)) update (Users) { set(name("Alexey")) } where Users.id.equals("alex") delete (Users) where Users.name.like("%thing") println("All cities:") select (Cities.all) forEach { val (id, name) = it println("$id: $name") } } Exposed