[m-users.] Accessing a Relational Database and Purity

Peter Wang novalazy at gmail.com
Wed Nov 14 13:49:35 AEDT 2018


On Tue, 13 Nov 2018 20:05:41 -0600, X Y <ayrnieu at gmail.com> wrote:
> Just pass io through your C FFI functions, as in
> https://github.com/jrfondren/getr-mercury/blob/master/rusage.m , and
> then add the promise_pure flag.
> On Tue, Nov 13, 2018 at 10:17 AM Charles Shuller
> <charles.shuller at gmail.com> wrote:
> >
> > Hello,
> >
> > Is it possible to access a relational database from mercury in a pure way??
> >
> > Using the FFI I can use a C library to interact with the DB, but the resultant functions aren't pure.   Do I need to do something with a state variable??

For an example, here's my sqlite3 binding:

https://github.com/wangp/plugsink/blob/master/src/sqlite3.m

Peter


More information about the users mailing list