next up previous contents index
Next: 11.2 The format Up: 11 Schemas Previous: 11 Schemas

11.1 Creating a Qddb Database

The Schema file is the only file that you need to edit in order to setup a Qddb database. Remember from chapter 2, your Schema file (along with the other Qddb files) is automatically generated when you enter the command: ``$ qnewdb <DatabaseName>''

For example, if you enter the commands shown in figure 11.1



$ cd ~/Databases
$ qnewdb MyRecords

  
Figure 11.1: Steps to creating a new Database(Schema)





Qddb will automatically create the ``~/Databases/MyRecords'' subdirectory. Inside this subdirectory, Qddb creates several directories/files; each of these files are briefly described below:

Schema
Immediately after performing the ``qnewdb MyRecords'' command you need to edit the Schema file (using your normal editor such as vi or emacs) to describe your database. Qddb uses this Schema file to setup your database.
Additions
This directory initially contains only one file -- NextNumber. NextNumber is a file used by Qddb to determine the ``next number'' of the filename that gets stored in the Additions directory. This number is actually a sequential number that gets incremented each time an entry is added to your database. Each time you add a new record to your database, Qddb determines what number this entry is (by reading the ``NextNumber'' file) and then stores the information in the file beneath the Additions directory. The filename is the number of the entry. For example, the first time you save an entry from nxqddb, a file named ``1'' is created in the Additions directory. The second entry has the filename ``2'', the third ``3'', and so forth. These files are added to the ``Database'' file and removed from the Additions directory whenever you do a ``qstall'' command.
Database
This file is initially empty when you first do a ``qnewdb'' command. The Database file gets populated when you perform the ``qstall'' command. The qstall (short for Qddb stabilize all) command stabilizes the Qddb database. Meaning, Qddb reads all the Additions' files to add to the database, and then regenerates its indexes. If you *really* know what you're doing, you can even edit this Database file (however we don't recommend this since its easy enough to do within nxqddb!)
Indexing files
Qddb will create its indexing files and store them in your Database's subdirectory: HashTable, KeyIndex, Database.key, Index and NumericIndex. You should *not* modify these files.
Changes
Qddb creates new files in the Changes subdirectory to store any modifications that you make to existing tuples. You should not make any modifications to the files stored in this directory.


next up previous contents index
Next: 11.2 The format Up: 11 Schemas Previous: 11 Schemas

Herrin Software Development, Inc.