Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# Pgez

Eazy wrapper of postgresql.

```
let db = new Postgresql.connection () in

Pgez.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 _ ->
();
```