在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):orangy/squash开源软件地址(OpenSource Url):https://github.com/orangy/squash开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):SquashSquash is a data access and manipulation DSL library for relational databases.
Quick SamplesDefine tables: object Cities : TableDefinition() {
val id = integer("id").autoIncrement()
val name = varchar("name", 50)
}
object Citizens : TableDefinition() {
val id = varchar("id", 10).primaryKey()
val name = varchar("name", length = 50)
val cityId = reference(Cities.id, "city_id").nullable()
} Insert data: insertInto(Citizens).values {
it[id] = "eugene"
it[name] = "Eugene"
it[cityId] = munichId
}.execute() Query tables: val row = from(Citizens)
.where { Citizens.id eq "eugene" }
.select(Citizens.name, Citizens.id)
.execute()
.single()
assertEquals("eugene", row[Citizens.id])
assertEquals("Eugene", row[Citizens.name]) Join: from(Citizens)
.innerJoin(Cities) { Cities.id eq Citizens.cityId }
.select(Citizens.name, Cities.name) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论