* [Caml-list] [ANN] Macaque 0.7 and 0.7.1
@ 2014-10-09 22:59 Jacques-Pascal Deplaix
0 siblings, 0 replies; only message in thread
From: Jacques-Pascal Deplaix @ 2014-10-09 22:59 UTC (permalink / raw)
To: OCaml mailing list, ocsigen
Hello,
We're happy to announce the double release of macaque 0.7 and 0.7.1.
Macaque is a type-safe and composable way to interact with SQL databases
from OCaml. We propose a form of "comprehension syntax" that allow to
modularly create queries in a strongly-typed and relatively principled way.
Macaque is hosted on github at:
https://github.com/ocsigen/macaque
The packages are available on opam.
Those two new releases come with some features and tiny breaking changes.
The new main features are:
- macaque now handles UNION, INTERSECT and EXCEPT:
* Postgresql documentation:
http://www.postgresql.org/docs/9.3/static/queries-union.html
* Macaque example: << union ({t.foo} | t in $table1$) ({t.foo} |
t in $table2$) ({t.foo} | t in $table3$) >>
- new aggregate function: md5:
* Postgresql documentation:
http://www.postgresql.org/docs/9.3/static/functions-string.html
* Macaque example: << group {hash = md5[t.foo]} | t in $table$ >>
- a new operator: IN:
* Postgresql documentation:
http://www.postgresql.org/docs/9.3/static/functions-comparisons.html#AEN18448
* Macaque example: << {t.foo} | t in $table$; in' t.id $ids$ >>
(where ids being a list of postgresql integers)
Breaking changes:
- We've fixed the type of current_timestamp so this should be
changed in your code (see the change bellow)
- We've also changed the way of calling operators. So the following
code:
<:table< table (
date timestamp NOT NULL DEFAULT(current_timestamp)
) >>
should have to change to something like:
<:table< table (
date timestamp NOT NULL DEFAULT(localtimestamp ())
) >>
(The first change is about the name and the second about the
argument added)
Full details:
0.7.1:
- Works with PGOCaml >= 2.0. int32_array is now mapped to int32
option array
instead of int32 array
0.7:
- Switch to OASIS
- Add support for UNION, INTERSECT, EXCEPT and their UNION ALL variant
- Add short types: nullable_data and non_nullable_data
- Add support for SQL function/operators: md5, IN
- Support unary operators (BREAKING CHANGE)
- Current_timestamp now using timestamptz + adding localtimestamp
for timestamp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-09 22:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-09 22:59 [Caml-list] [ANN] Macaque 0.7 and 0.7.1 Jacques-Pascal Deplaix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox