https://github.com/todesking/qb-scalikejdbc
Goal: Platform independent query builder for relational data.
https://github.com/todesking/qb-scalikejdbc
Last synced: 2 months ago
JSON representation
Goal: Platform independent query builder for relational data.
- Host: GitHub
- URL: https://github.com/todesking/qb-scalikejdbc
- Owner: todesking
- License: mit
- Created: 2014-10-08T16:55:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-13T10:02:41.000Z (over 11 years ago)
- Last Synced: 2026-01-17T16:50:15.929Z (5 months ago)
- Language: Scala
- Size: 145 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QB: Generic query builder
Goal: Framework independent query builder
Current target: Scalikejdbc
```scala
import com.todesking.qb
import com.todesking.qb.QueryInterpolation._
qb.Sql.buildQuery(
table"users"
.where(col"age" eq 20)
.where(col"name" like "Alice%")
.where(col"id" in (table"owners" select(col"user_id")))
)
=> SqlData("SELECT * FROM users WHERE ((age = ? AND name LIKE ?) AND id IN (SELECT user_id FROM owners))",List(20, "Alice%"))
```