package pg_query
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b1d24219ccf7875d7921e81c21159589cade9775b871ab0e22959007820a8385
sha512=91f4dfae163c6c942c4e5294130751ff7c90ca50529bb9ff6e76b3694740d913a4e35007504682762c7d7178d8781e7ed3df0a625300855ab366d09ee847782f
Description
OCaml bindings to libpg_query for parsing PostgreSQL, and a command-line tool that uses them
Added to opam-repository:
README
pg_query-ocaml
Bindings for pg_query for parsing PostgreSQL. Documentation is here.
Usage
This provides a library that can be used in OCaml code like so:
let statement = "SELECT user, email FROM users WHERE id = 7"
let () =
match Pg_query.parse statement with
| Ok parse_tree -> use parse_tree
| Error error_message -> use error_messageand a command-line utility:
$ echo "SELECT * FROM users" >> good.sql
$ echo "SELECT * FFROM users" >> bad.sql
$ pg_check good.sql bad.sql
[{"RawStmt": {"stmt": {"SelectStmt": {"targetList": [{"ResTarget": {"val": {"ColumnRef": {"fields": [{"A_Star": {}}], "location": 7}}, "location": 7}}], "fromClause": [{"RangeVar": {"relname": "users", "inh": true, "relpersistence": "p", "location": 14}}], "op": 0}}}}]
syntax error at or near "FFROM"
Dependencies (7)
- ppx_deriving
-
ctypes-foreign
>= "0.21.1" - ctypes
-
cmdliner
>= "1.1.0" -
dune
>= "2.0" -
ocaml
< "5.0" & (arch = "x86_32" | arch = "arm32") -
ocaml
>= "4.07"
Dev Dependencies (1)
-
alcotest
with-test
Optional Dependencies
None
Used by (1)
Conflicts
None
Build status
Results of building pg_query with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.9.8 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure