Skip to content

Commit

Permalink
last few edits on the README
Browse files Browse the repository at this point in the history
  • Loading branch information
avsm authored and samoht committed Feb 16, 2010
1 parent fa159d5 commit ea0caef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -87,9 +87,10 @@ Finally, using `Dyntype.type-of`, functions to access the database are generated
gallery list

For both types, we are generating:

1. arguments that can be easily translated into an optimized SQL queries;
2. a more general (and thus slow) custom query function directly written in OCaml.

On one hand, (1) is achieved by generating optional labelled arguments with the OCaml type corresponding to what `Dyntype.type_of` generated. This allows the programmer to specify a conjunction of type-safe constraints for his queries. For example, the field `name` is of type string which is associated to the constraint of type `Eq of string | Contains of string`. Values of this type can then be mapped to SQL equality or the `LIKE` operator.

On the other hand, (2) is achieved using a SQLite extension to define custom SQL functions---in our case we register an OCaml callback directly. This is relatively slow as it bypasse the query optimizer, but allows the programmer to define very complex queries.
On the other hand, (2) is achieved using a SQLite extension to define custom SQL functions; in our case we register an OCaml callback directly. This is relatively slow as it bypasses the query optimizer, but allows the programmer to define very complex queries.

0 comments on commit ea0caef

Please sign in to comment.