DB Schema
Opening...
Select Tools ->
DB Schema (or
for mobile,
then DB Schema) to open the dialog.
When you select this, you may be asked "Do you want to save a
copy of your data before you modify the specs?". There is a good
reason for this... Changing the schema in the wrong way could
cause you to lose data. The system is pretty tighly designed to
make it as difficult as possible for this to happen, but it still
may. So if you are changing the schema, a good process to follow
is
- Save your data.
- Modify the schema.
- Check that your data is OK.
- If it is, then carry on doing whatever you were going to do.
- If it isn't, then shut down the application and Discard
your changes. All will be good with the world.
So that question that it asks did have a purpose after all... Of
course, it can be tricky about it. If you haven't made any changes
to the data, or you just saved, then it knows that and won't
bother asking you.
The Dialog
The dialog is split into 3 different areas:
- (On the left) - The list of Object Specs
and Queries. If the entry starts with
"OS:" then it is an Object Spec. If it starts with "Q:", then it
is a Query. If you select one of the entries in the list, then
it will be displayed in the upper-right area. If you
double-click the entry, the spec edit dialog will open.
- (On the right) - This displays the contents of the spec
that is selected in the list. You cannot edit the specs from
here (you have to double click in the list, or press the
button.
- (On the lower right) - The build results from the most recent
build. When you are working on Object specs, it is a good idea
to try building the schema from time to time (just to check if
there are any errors). To do this, select
. The results of the
build will be shown in the lower right section.
The dialog has a number of toolbar buttons:
- Close - Closes the dialog. If you made any changes, it will
also prompt you whether build the database schema. If there are
any errors in the schema, then it won't close the dialog, but
will instead prompt you to fix the errors.
- Creates a new Object Spec or Query and opens the Edit
Dialog for you to type in the spec details.
- Clones the selected Object
Spec or Query. It will open the edit dialog - The name of the
clone will be whatever the item you are cloning is called with
"Copy" added to the end of it.
- Edits the selected Spec or
Query.
- Deletes the selected
Spec or Query. You can only delete a Spec if no Entries in the
diary use that spec and if no other specs reference this one
(i.e. inherit from it or have it as a child spec).
- Builds all of the
specs in the database. It does not, however, apply the changes
to the actual entries in the diary. Any errors will be shown in
the lower right window.
- This will build the specs,
and also apply the changes to the diary. This means if you
changed the variables in any specs, those variables will be
changed right then.
The Spec Edit Dialog
This dialog lets you change an Object Spec.
- The top field is the name of the spec.
- The main edit area shows (and lets you edit) the text of the
spec.
- The Build Results area shows the results of pressing the Build
button.
- The
button will build just this spec, and tell you if
there are any syntax errors in it.
The Query Edit Dialog
This dialog is the same as the spec edit dialog, but works for
queries instead.
Object Specs
See Object Specs
Queries
See Queries