Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkazuo/pgez
Eazy wrapper of postgresql
https://github.com/kkazuo/pgez
core ocaml postgresql
Last synced: 10 days ago
JSON representation
Eazy wrapper of postgresql
- Host: GitHub
- URL: https://github.com/kkazuo/pgez
- Owner: kkazuo
- License: isc
- Created: 2019-02-10T14:52:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-12T14:32:34.000Z (almost 6 years ago)
- Last Synced: 2024-11-15T15:47:53.543Z (2 months ago)
- Topics: core, ocaml, postgresql
- Language: OCaml
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pgez
Eazy wrapper of postgresql.
```
let db = new Postgresql.connection () inPgez.with_transaction ~db ~f:begin fun () ->
Pgez.exec ~db {|
SELECT name FROM Names
WHERE uid = $1
|} ~params:[| `Int 1234 |]
|> Result.return
end
|> function
| Ok [ [| `String name |] ] ->
Log.Global.info "found %s." name
| Ok r -> r
|> [%sexp_of: Pgez.Value.t array list]
|> Sexp.to_string
|> Log.Global.info "%s"
| Error _ ->
();
```