Hi Ana + Henrik,

> > what do you do when your db model changes?
> It depends, in the case of adding attributes you don't have to do anything.

That's right. As objects (i.e. their property lists) may grow to any
size, new relations can simply be defined, and will appear as empty
attributes in pre-existing objects. You can then write a script (in Lisp
or Pilog) then to fill these attributes with meaningful values if

> In the case of removing attributes and wanting to free that space on the

If a relation is to be removed, the recommended procedure is:

   1. Use a Lisp or Pilog command to clear that attribute in all
      objects _before_ removing that relation's definition.

   2. Stop the application, remove the relation's definition, and start
      it again.

In general, there is nothing magic to that. As database objects and
their relations are normal symbols, you can manipulate them
programmatically in any way. The relations and their demon objects just
sit in between, and handle side effects like index and link/joint

Omitting step (1) has no bad effect, except that the space occupied by
those attributes is wasted. The data can still be accessed with direct
Lisp commands. Changing them will not update related information (index
trees, links/joints etc.), as there are no more relation daemons
handling that.

> harddrive there might be a utility script that could be of help in the form
> of lib/too.l

There is no special utility script for removing attributes. Probably you
thought about 'rebuild' and 're-index' in "lib/too.l", which can be used
generally to rebuild index trees.

> > since (pool) only holds one database, how do you migrate objects from
> > one pool to the other?

This is another question. To migrate objects, you must export them from
one DB, and import them into the other.

In "lib/too.l" there is the 'dump' function, which takes a Pilog
expression to select the relevant objects (may be from multiple classes
for related exports, or arbitrary groups of objects), and writes them to
the current output channel. It also correctly handles Blobs within these
objects, writing them to temporary files.

The output format of 'dump' is such that a simple 'load' in the
environment of the new DB can be used to import the data.

- Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to