Besides determining the type of record that follows in the stream, record descriptors can be used to describe other properties of those records. This can be done by using special fields, which have special names from a predefined set. Consider for example the following database, where record descriptors are used to specify a (optional) numeric `Id' and a mandatory `Title' field:
%rec: Item %type: Id int %mandatory: Title Id: 10 Title: Notebook (big) Id: 11 Title: Fountain Pen
Note that the names of special fields always start with the character
%. Also note that it is also possible to use non-special
fields in a record descriptor, but such fields will have no effect on
the described record set.
Every record set must contain one, and only one, field named
%rec. It is not mandated that that field must occupy the first
position in the record. However, it is considered a good style to
place it as the first field in the record set, in order for the casual
reader to easily identify the type of the records.
The following list briefly describes the special fields defined in the recutils format, along with references to the sections of this manual describing their usage in deep.
%mandatory, %allowed and %prohibit
%unique and %key
%typedef and %type