Skip to content

Commit be088e6

Browse files
committed
Rewrite parts of the README.
1 parent ad9f64f commit be088e6

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

README.md

+57-57
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,26 @@ Caqti then loads a driver which can handle the URI, and provides a
1313
first-class module which implements the driver API and additional
1414
convenience functionality.
1515

16-
Caqti does not make assumptions about the structure of the query language,
17-
and only provides the type information needed at the edges of communication
18-
between the OCaml code and the database; i.e. for encoding parameters and
19-
decoding returned tuples. It is hoped that this agnostic choice makes it a
20-
suitable target for higher level interfaces and code generators.
16+
Caqti does not generate or analyze SQL but provides templating and uniform
17+
query parameter handling, including encoding and decoding data according to
18+
declared types. It is hoped that this agnostic choice makes it a suitable
19+
target for higher level interfaces and code generators.
2120

22-
## Drivers
23-
24-
The following drivers are available.
21+
The following drivers are available:
2522

2623
RDBMS | URI scheme | library | Unix | MirageOS
2724
---------- | --------------- | -------------- | ---- | --------
2825
MariaDB | `mariadb://` | [mariadb][] | yes | no
2926
PostgreSQL | `postgresql://` | [postgresql][] | yes | no
30-
PostgreSQL | `pgx://` | [pgx][] (p) | yes | yes
27+
PostgreSQL | `pgx://` | [pgx][] | yes | yes
3128
SQLite3 | `sqlite3://` | [sqlite3][] | yes | no
3229

33-
**The PGX based driver is not production-ready yet** due to the lack of TLS,
34-
esp. given that the only supported authentication mechanism is plaintext.
35-
36-
If you link against `caqti-dynload`, then drivers are loaded dynamically
37-
based on the URI. If dynamic loading is unavailable on your platform, link
38-
instead against the `caqti-driver-*` libraries which you expect to use.
30+
The PGX based driver is experimental and only recommended for MirageOS.
31+
More about the drivers below.
3932

4033
## Documentation
4134

42-
Tutorials and examples:
35+
### Tutorials and Examples
4336

4437
- The [caqti-study][] repository is a tutorial with examples, which we
4538
will keep up to date with the latest release of Caqti. It is work in
@@ -50,40 +43,53 @@ Tutorials and examples:
5043
- [The documented example][bikereg] in this repository can give a first
5144
idea.
5245

53-
API documentation from ocaml.org contains documentation for matching
54-
releases of individual packages:
55-
56-
- [caqti](https://ocaml.org/p/caqti/latest)
57-
- [caqti-lwt](https://ocaml.org/p/caqti-lwt/latest)
58-
- [caqti-async](https://ocaml.org/p/caqti-async/latest)
59-
- [caqti-eio](https://ocaml.org/p/caqti-eio/latest) (pending release)
60-
- [caqti-mirage](https://ocaml.org/p/caqti-mirage/latest) (pending
61-
release)
62-
- [caqti-driver-mariadb](https://ocaml.org/p/caqti-driver-mariadb)
63-
- [caqti-driver-postgresql](https://ocaml.org/p/caqti-driver-postgresql)
64-
- [caqti-driver-sqlite3](https://ocaml.org/p/caqti-driver-sqlite3)
65-
- [caqti-driver-pgx](https://ocaml.org/p/caqti-driver-sqlite3) (pending
66-
release)
67-
68-
If the above lacks links to modules, it may be due to build issues. You may
69-
instead refer to my own latest rendering:
70-
71-
- [Caqti API Reference][API] contains the index with the most important
72-
entry points being:
73-
- [caqti-blocking][] for Unix system library with no concurrency, supports
74-
all drivers
75-
- [caqti-lwt.unix][] for Lwt with Unix system library, supports all
76-
drivers
77-
- [caqti-async][] for Async with Unix system library, supports all drivers
78-
- [caqti-eio.unix][] for experimental Eio support.
79-
- [caqti-mirage][] for experimental MirageOS support.
80-
81-
The linked modules provide a connect functions which receives an URI, loads
82-
the appropriate driver, and returns a connection as a first-class module
83-
containing query functionality for the database.
84-
85-
You can also build the API reference matching your installed version using
86-
[odig][] or run `dune build @doc` in a Git checkout.
46+
### API Documentation for Stable Releases
47+
48+
The stable API documentation is hosted on [https://ocaml.org](), where you
49+
can search package by name.
50+
51+
A full Caqti release contains the following packages:
52+
53+
- [caqti](https://ocaml.org/p/caqti/latest):
54+
Core libraries and blocking unix connector.
55+
- [caqti-lwt](https://ocaml.org/p/caqti-lwt/latest):
56+
Lwt support library and connector.
57+
- [caqti-async](https://ocaml.org/p/caqti-async/latest):
58+
Async connector.
59+
- [caqti-eio](https://ocaml.org/p/caqti-eio/latest):
60+
Experimental EIO connector.
61+
- [caqti-mirage](https://ocaml.org/p/caqti-mirage/latest):
62+
Experimental MirageOS connector.
63+
- [caqti-driver-mariadb](https://ocaml.org/p/caqti-driver-mariadb):
64+
Driver for MariaDB and MySQL using C bindings from [mariadb][].
65+
- [caqti-driver-postgresql](https://ocaml.org/p/caqti-driver-postgresql):
66+
Driver for PostgreSQL using C bindings from [postgresql][].
67+
- [caqti-driver-sqlite3](https://ocaml.org/p/caqti-driver-sqlite3):
68+
Driver for local SQlite3 databases using C bindings from [sqlite3][].
69+
- [caqti-driver-pgx](https://ocaml.org/p/caqti-driver-pgx):
70+
Experimental driver for PostgreSQL using the [pgx][] library.
71+
- [caqti-tls](https://ocaml.org/p/caqti-tls):
72+
TLS configuration currently only used by caqti-mirage, and only relevant
73+
for pgx, since drivers based on C bindings have external TLS support.
74+
75+
The connector modules provide a connect functions which receives an URI,
76+
dispatches to an appropriate driver, and returns a connection object as a
77+
first-class module, which contains query functionality for the database.
78+
The application can either link against the drivers it needs or the link
79+
against the `caqti.plugin` library in order to load the appropriate driver
80+
at runtime.
81+
82+
(A few package not mentioned include unreleased TLS packages and the
83+
semi-deprecated packages
84+
[caqti-type-calendar](https://ocaml.org/p/caqti-type-calendar/latest) and
85+
[caqti-dynload](https://ocaml.org/p/caqti-dynload/latest).)
86+
87+
### API Documentation for Development Snapshots
88+
89+
Apart from the above links, the [GitHub pages][caqti-ghpages] are updated
90+
occasionally with a rendering from the master branch. You can also build
91+
the API reference matching your installed version using [odig][] or run
92+
`dune build @doc` in a Git checkout.
8793

8894
## Running under utop
8995

@@ -123,17 +129,11 @@ Thanks to the <a href="https://ocaml-sf.org">OCaml Software Foundation</a>
123129
for economic support to the development of Caqti.
124130

125131

126-
[API]: http://paurkedal.github.io/ocaml-caqti/index.html
132+
[caqti-ghpages]: http://paurkedal.github.io/ocaml-caqti/index.html
127133
[BP-2018]: https://medium.com/@bobbypriambodo/interfacing-ocaml-and-postgresql-with-caqti-a92515bdaa11
128134
[bikereg]: examples/bikereg.ml
129-
[caqti-async]: https://paurkedal.github.io/ocaml-caqti/caqti-async/Caqti_async/index.html
130-
[caqti-blocking]: https://paurkedal.github.io/ocaml-caqti/caqti/Caqti_blocking/index.html
131-
[caqti-eio.unix]: https://paurkedal.github.io/ocaml-caqti/caqti-eio/Caqti_eio_unix/index.html
132-
[caqti-lwt.unix]: https://paurkedal.github.io/ocaml-caqti/caqti-lwt/Caqti_lwt_unix/index.html
133-
[caqti-mirage]: https://paurkedal.github.io/ocaml-caqti/caqti-mirage/Caqti_mirage/index.html
134135
[caqti-study]: https://github.com/paurkedal/caqti-study/
135136
[odig]: http://erratique.ch/software/odig
136-
[topkg-care]: http://erratique.ch/software/topkg
137137
[mariadb]: https://github.com/andrenth/ocaml-mariadb
138138
[pgx]: https://github.com/arenadotio/pgx
139139
[postgresql]: https://mmottl.github.io/postgresql-ocaml

0 commit comments

Comments
 (0)