Content-type: text/html; charset=UTF-8 Man page of qedit

qedit

Section: Herrin Software Development, Inc. (1)
Updated: 10 Aug 2001
Index Return to Main Contents
 

NAME

qedit - Edit a list of tuples in the qddb Database, given a list of keys and set operations.  

SYNOPSIS

qedit l|e|d RelationDirectory 
[[-a | -o | -! |] [-f field] item ... ]
        -a: and (default)
        -o: or
        -!: excluding
        -f: name of field (attribute) to restrict search
        item = [SearchString | -r RegExp | -n Number |
                -nr Number-Number | -sr SearchString-SearchString]
 

DESCRIPTION

qedit(1) lists (l), edits (e), or deletes (d) all tuples in RelationDirectory matching the search specification. The search specification is composed of items. But default, the items are combined by the Boolean "and" operator, that is, only those tuples matched by all items are selected. However, items following the first one may explicitly start with -a for "and" (set intersection), -o for "or" (set union), or -! for "excluding" (set subtraction). Each item is applied in the order listed.

By default, each item refers to characteristics of the entire tuple. However, an item beginning with "-f field" refers only to characteristics of the given field. Nested fields are represented by a fully-qualified dotted notation, such as in "-f Person.Residence.Phone".

The item itself can be in one of 5 formats.

SearchString: The item matches those tuples that have a token equal to the given string (case-insensitive comparison).

-r RegExp: The item matches those tuples that have a token matching the given regular expression (case-insensitive comparison).

-n Number: The item matches those tuples that have a token numerically equivalent (after leading zeros are removed) to the given number.

-sr SearchString-SearchString: The item matches those tuples that have a token lexically within the range bounded by the two given strings; boundaries are included in the range.

The following are examples of valid qedit command lines:

        qedit e PersonalDB -r '(.*)[Rr]osh(.*)'
        qedit l PersonalDB rosh
        qedit l PersonalDB sharon -a rosh
        qedit l PersonalDB -r '[Gg]il(.*)' -a benson
        qedit d PersonalDB -f Person.Name.First raphael -! Finkel

All comparison is case-insensitive, so the regular expression '[Rr]' is the same as 'r'. The first example will invoke the editor on all tuples (one at a time) that contain the word rosh, even when that word is embedded in other words. The second example will list all tuples with the token (typically, word separated by white space or punctuation) 'rosh'. The third example lists all tuples that have both tokens lists all tuples with the word 'benson' and a word that matches the given regular expression. The fifth example deletes all tuples that have token 'raphael' in the nested field Person.Name.First except for tuples that have the token 'finkel' (in any field).

The EDITOR environment variable determines the editor used to edit each tuple. /usr/bin/vi is the default editor if the EDITOR variable is not initialized.

Tuples that are modified and saved in the editor are added to the Changes directory. Unmodified entries remain in the stable database only.  

SEE ALSO

qs(1), query(1)  

DIAGNOSTICS

Qedit was designed as an example of how to write query programs with Qddb. It has many shortcomings and does not attempt to give the user access to the full querying capabilities of Qddb.  

BUGS

Each tuple is edited with a separate invocation of the editor. This prevents the overhead of determining which tuples were actually modified, but adds the overhead of the invocations.  

REFERENCES

A Guide to QDDB
Eric H. Herrin II and Raphael A. Finkel

Qddb User's Guide

An ASCII Database for Fast Queries of Relatively Stable Data
Eric H. Herrin II and Raphael A. Finkel
Computing Systems, Volume 4 Number 2
University of California Press, Berkeley CA

Schema and Tuple Trees: An Intuitive Structure for 
Representing Relational Data
Eric H. Herrin, II and Raphael A. Finkel
Computing Systems, Volume 9, Number 2
MIT Press, Cambridge MA


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
DIAGNOSTICS
BUGS
REFERENCES

This document was created by man2html, using the manual pages.
Time: 18:55:30 GMT, October 31, 2018