Skip to content

kkazuo/pgez

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Eazy wrapper of postgresql

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors