Rel is a library for programming with relational databases in OCaml. It provides:
A few things are TODO.
These manuals are available:
rel
libraryRel
Relational databases.Rel_sql
SQL helpers.Rel_query
Embedded query language.Rel_list
Query OCaml lists of rows.Each of these modules live in its own rel.*
library.
Rel_sqlite3
SQLite3 support.Each of these modules live in its own rel.*
library.
Rel.Type.Text
at some point.Rel
should maybe depend on Rel_sql
, or possibly have a pre-Rel_sql with the expression language, since we will hit recursive dependencies. One issue is that we would like to be able to define an expression for the default of columns. This should be parametric on the dialect and/or be a structured SQL expression.Rel_sql.dialect
at the level of statements creation is a bit annoying. Maybe go back to the idea of having an AST in Rel_sql.Stmt.src
. The backends then directly act on this. The only thing we need is something that is fast to test for equality for caches of prepared statements.Rel.Col
need a collation parameter. Also the `Expr
Rel.Col.default
case is unsatisfying it should be either an SQL expression AST or at least be a function of the dialect (which gets us into recursive trouble). Also for indexes this is not as expressive as it could be.Rel.Table.Index.get_name
stuff is not that great, should we simply have ""
as a default and rename when we add to a table ?)Rel.Col.value
value but that's not what we have in the API at the moment.Rel_sqlite3
changes. Be smarter on tables changes that involve only index/add drops.