help-recutils
[Top][All Lists]
Advanced

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

Re: [help-recutils] Question to compound fields


From: Jose E. Marchesi
Subject: Re: [help-recutils] Question to compound fields
Date: Wed, 05 Oct 2011 23:16:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Sven.
    
    I read about compound fields in the manual
    and tried the example from here:
    http://www.mail-archive.com/address@hidden/msg34382.html

The full support for compound fields is not implemented.  This is
because some time ago I decided to abandon that approach in favor to a
solution that fits better in the overall design.  The new solution
introduces foreign keys without tampering with the data: all the
metadata is in the record descriptor.

The following is an example of a rec file with packages and maintainers,
using the foreign keys mechanism:

  %rec: Package
  %key: Name
  %type: Maintainer rec Maintainer
  %type: PreviousMaintainer rec Maintainer

  Name: recutils
  Maintainer: Jose E. Marchesi
 
  Name: GNU PDF
  Maintainer: Jose E. Marchesi
  Maintainer: Aleksander Morgado

Note the new type 'rec'.  It means that Maintainer and
PreviousMaintainer are references to some records of the specified
types.  The association is done using the key of those record types.

The utilities will support this notion by allowing:

- Dot notation to refer to fields in a referenced record.  For example:

  $ recsel -t Package -e 'Name = "GNU PDF"' -p Name,Maintainer.Email
  Name: GNU PDF
  MaintainerEmail: address@hidden

  Name: GNU PDF
  MaintainerEmail: address@hidden

- A field renaming mechanism to simplify the output:

  $ recsel -t Package -e 'Name = "GNU PDF"' -p Name,Maintainer.Email:MEmail
  Name: GNU PDF
  MEmail: address@hidden

  Name: GNU PDF
  MEmail: address@hidden

- Support for dot notation in selection expressions:

  $ recsel -t Package -e 'Maintainer.Email = "address@hidden"' -p Name
  Name: GNU Foo

I will do the implementation for foreign keys support immediatly after
the release of 1.4.

PS: The encryption support is now complete in the git version.  Do a
checkout and take a look to the manual, as well as the --help output of
recsel, recins and recfix :)

-- 
Jose E. Marchesi    address@hidden
GNU Project         http://www.gnu.org



reply via email to

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