https://github.com/ousc/kotoframework-v2
https://github.com/ousc/kotoframework-v2
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ousc/kotoframework-v2
- Owner: ousc
- Created: 2024-03-17T08:03:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-31T08:43:10.000Z (about 1 year ago)
- Last Synced: 2025-02-16T02:41:52.895Z (4 months ago)
- Size: 99.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
aliases:
- README
---
### Koto 是一个数据持久层框架,设计用于 Kotlin,轻量级,现代化。Koto 2.0旨在通过编写kotlin k2编译器插件,实现更加强大且语义化的orm功能。
>示例:
```kotlin
//查询示例
// 1. 条件查询 / 查询单个字段 / 使用query()查询List结果
val users: List> = from()
.select { it.userName }.where { it.id == 1 }.query()// 1.多条件查询 / 查询多个字段 / 带分页 / 带去重 / 带排序
val (users, total): List = from()
.select { it.userName + it.authCode + it.id }
.where { it.id == 1 && }
.page(1, 10)
.orderBy { it.updateTime.desc() }
.distinct()
.withTotal {
queryForList()
}//连表查询