The Qddb Database Suite

Have you ever needed a program to manage
some data? Perhaps you have tried one of the many relational
database products that require a significant amount of effort to
set up a few simple tables and wondered why there isn't one that is
easy to use.

When looking at the design of the available database
products, notice that most of the tools are very cumbersome. You
must carefully define your fields, select those that require a
separate table, define link fields between the tables, choose the
important fields for searching, then finally build some sort of
interface. In many cases, people decide to use flat files because a
real database is too time consuming. There are many tasks that can
benefit greatly from a program that makes it easy to design simple
databases.

What is Qddb?

Qddb is a multi-user database suite that allows you to
quickly design custom databases. If you know the data your database
should contain, you can design your database and be up and running
almost as fast as you can type the field names. Skeptical? Let's
work through an example.

There are two basic steps to building a Qddb database. First,
you must create a blank database with Qddb's
qnewdb() command:

bash$ qnewdb Properties

qnewdb() builds a new
database directory (named Properties in this case) and populates it
with several files for Qddb's use. Next, you must edit the file
Properties/Schema and define the format of the individual records:

The first thing you notice about the Schema file is its free-style
format. Each word (other than the keywords type
and defaultvalue followed by a data type or
string) defines a field in a record. By default, each field's value
in a record may contain an arbitrary-length string. You can also
explicitly assign data types of string,
real, integer and
date to each field.

Some fields are structured, that is,
they contain other fields. For example, Apartments contains the
subfields AptNumber, Rented, Lease, Person and Comments.
Apartments.Lease and Apartments.Person are also structured and
contain subfields.

Some fields are expandable, meaning each
record in the database can contain multiple values for that field.
Expandable fields are denoted by an asterisk (*) at the end of its
definition.

The sample Schema above defines a database that contains one
record for each property owned by a landlord. Each property
contains multiple apartments. Each apartment has a number, whether
it is rented, lease dates, a list of people living there and a list
of comments.

nxqddb()--Qddb's
Generic Database Browser

Now, you are ready to use your Properties database with
Qddb's generic X-based application
nxqddb.

To add records, select the Modes menu button and choose Add
Mode. Once in Add Mode, you can simply fill in the fields. If you
want to add multiple values for an expandable field, you click the
mouse on the Add button next to the field's label. You can also
view all the values in an expandable field by clicking the View
button. When you are ready to save a record, select the File menu
button and choose Save. Now you are ready to add another record.
Note that Qddb does not clear the entry boxes for the next record
by default; you can choose auto-clear under
the configuration menu if that is the behavior you want.

Once you have added some records, you can go to Search Mode
and perform simple, fast database queries. For example, let's say
you want to find all the people renting apartments whose first name
is Sally. Just type “sally” in the Apartments.Person.First entry
box and press return. If you want to confine
your search further, to the last name “Jones”, type “jones” in
the Apartments.Person.Last field and press
return. A list of all the properties matching
the criteria will appear in a Search Results window as shown in
Figure 2. If you want to edit one of the records, click the mouse
on the entry and you will be switched to Change Mode for that
record.

You will quickly find that Qddb, by default, splits field
values into searchable components. A separator
is a character that separates the searchable components in a field.
You can specify your own set of separators for any field in the
schema:

MyField separators ",.;"

The separators schema option above tells Qddb to index the
field MyField using only the separators “,” (comma),
“.”(period) and “;” (semicolon). The default list of separators
includes all ASCII non-alphanumeric characters. (Note that only
fields of type string use separators.)