How Mnemosyne cursors are used ?

Sean Hinde sean.hinde@REDACTED
Wed Nov 12 11:01:54 CET 2003

On Wednesday, November 12, 2003, at 09:16  am, Massimo Cesaro wrote:

> On Wed, 2003-11-12 at 09:57, Sean Hinde wrote:
>> Check out ets:select in all its forms which allows you to retrieve a
>> table in chunks. The match syntax would certainly allow you to
>> formulate the query you have here. Also check out ets:fun2ms which
>> allows easy generation of the match code.
> I used ets:select and also considered using ets:fun2ms, but what I'd
> like to avoid is rewriting persistent cursors logic.
> I'm doing the query from a Yaws page. It is a report where I can define
> a start date, an end date and the number of lines per page.
> Then the page is dynamically generated from Yaws, and each time I click
> the "Next" button on the web page, the idea was to pass the cursor 
> state
> as a cookie to continue returning records. I thought of using Mnemosyne
> queries as well, but the requirement of initialising the query with
> mnemosyne:init_query/1 each time render useless this method as well.
> My aim is to allow for a report-like functionality from a Yaws
> application, hence the integration between Yaws and ets/Mnesia would
> avoid the need to export the records to another dbms and and use 
> another
> web server (I'm becoming an Erlang addict!).
> The number of record I expect to handle is relatively small (less than
> 5000), the function is just a call trace log.

You could try to encode the Continuation term returned from 
ets:select/3 and pass back it as the cookie.


More information about the erlang-questions mailing list