Expand description
Dysql 是一个轻量级的编译时生成 SQL 模板的库,它在运行时根据传入的 DTO 自动生成动态的 SQL 并设置数据参数, 在底层 Dysql 使用 sqlx, tokio-postgres, rbac 等框架执行最终的 SQL。
Macros§
- execute
- Execute query
- fetch_
all - fetch all datas that filtered by dto
- fetch_
one - fetch one data that filtered by dto
- fetch_
scalar - Fetch a scalar value from query
- insert
- Insert data Note: if you use this macro under postgres database, you should add “returning id” at the end of sql statement by yourself.
- page
- page query
- sql
- Define a global sql fragment