database Rest API項(xiàng)目 pREST 介紹
開源 database Rest API服務(wù)項(xiàng)目
在前后端分離的背景下, 對于一些小型項(xiàng)目, 其實(shí)后端可以做的非常輕, 只要它能提供一些基礎(chǔ)的rest api, 邏輯完全可以在前端實(shí)現(xiàn), 尤其是使用Type script或Blazor這樣的前端語言/架構(gòu), 工程能力已經(jīng)足夠強(qiáng)大.
| 開源產(chǎn)品 | 開發(fā)語言 | 后臺數(shù)據(jù)庫 | 數(shù)據(jù)操作 | 安全 |
|---|---|---|---|---|
| PostgREST | Haskell | Postgresql | table-resource映射 | JWT |
| pREST | Go | Postgresql | table-resource映射, 也支持SQL | JWT |
| Elide | Java | Postgresql,MySQL,H2 | JPA方式 | Java Security ,以及更新粒度的 Permission Check |
選擇
上面三個(gè)項(xiàng)目我更喜歡pREST, 最主要的原因是, 它支持custom SQL方式, 只有custom SQL才能適應(yīng)復(fù)雜業(yè)務(wù)需求, 唯一的缺點(diǎn)僅支持PostgreSQL數(shù)據(jù)庫.
打算寫幾個(gè)博文, 學(xué)習(xí) pREST 項(xiàng)目, 這絕對是做項(xiàng)目的一個(gè)好工具.
pREST 資料
官網(wǎng)document內(nèi)容偏簡單, 很多信息沒有介紹到, 社區(qū)中介紹 pREST 資料也不多
- github 主頁: https://github.com/prest/prest
- 官網(wǎng)文檔 https://docs.prestd.com
- github 主頁上的文檔 https://github.com/prest/prest/tree/main/docs
- 配置文件寫法 https://github.com/prest/prest/blob/main/docs/deployment/server-configuration.md
- 一個(gè)簡明教程 https://dev.to/eminetto/accessing-postgres-via-rest-using-prest-4fdk, https://eltonminetto.dev/en/post/2021-08-31-prest/
- prest/adapter-mysql 插件, 可以了解 rREST的對外接口 https://github.com/prest/adapter-mysql
- pREST學(xué)習(xí)筆記 https://zhuanlan.zhihu.com/p/419203293
DbREST 項(xiàng)目
DbREST 是新項(xiàng)目, vision 更大, api 設(shè)計(jì)得也更加好,
- 官網(wǎng)主頁: https://docs.dbrest.io/
- github項(xiàng)目主頁: https://github.com/dbrest-io/dbREST
- api router: https://github.com/dbrest-io/dbREST/blob/main/server/routes.go

浙公網(wǎng)安備 33010602011771號