[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-recutils] Recutils - User Feedback

From: Jose E. Marchesi
Subject: Re: [bug-recutils] Recutils - User Feedback
Date: Sun, 05 Aug 2012 14:05:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Hi John.

    Having read through the user manual over the last couple of weeks, 
    played with recutils a little, and of course attended Jose's 
    excellent presentations,  my opinions on Recutils are as follows:

Thanks for the feedback! :)
    1. Recsel can perform a single join only.
       It would be extremely useful to be able to perform a query joining 3 or 
       record types at once.  Eg:
       recsel -t Thing0 -j ThingA,ThingB -j ThingD file.rec
       My idea here is that ThingA and ThingB are foriegn keys in Thing0, whilst
       ThingD is a foriegn key in the result of the first join.
       I thought I could work around this limitation with something like
       recsel -t Thing0 -j ThingA -d file.rec | recsel -t Thing0_ThingA -j 
       but it seems not.  Maybe it could if the -d flag was a little
       more intelligent... 

That is the idea.  The implemenation of -d and the joins is not
complete: it must create a record descriptor with the proper definitions
so several recsels can be chained in a pipeline. 

We could also support the first syntax as well, quite easily: it is a
matter of chaining several calls to the API function rec_db_query.
    2. Recfmt has limited ability.
       For example some kind of conditional syntax would make it a lot more 
       Dear {{$case Gender 'Male')Sir 'Female')Madam}},
       of course there are ways around this problem, but that involves makeing 
the database
       architecture more complex.

Yep.  A more powerful macro language for recfmt is in the TODO.  See
http://lists.gnu.org/archive/html/bug-recutils/2011-05/msg00019.html for
a design I worked out some time ago.
    3. Date expressions could be somewhat more flexible.
       For example, the ability to match against only one field in a date.
       # Select all those people who have birthdays in March
       recsel -e "Date-of-Birth >> '01 March *' && Date-of-Birth << '31 March 
*' file.rec

Hmm.  Another pending feature is the support of "scalar functions" in
selection expressions, in the same way they are supported in other
database systems.

Having scalar functions would probably fix the issue, because we could
add functions like Year(DATE), Month(DATE), Dady(DATE), etc.

Jose E. Marchesi         http://www.jemarch.net
GNU Project              http://www.gnu.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]