<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
This proposed solution is just what I was imagining (only better described.)<BR>
Certainly, whether we use it or not, 0.6.0 should start attaching a version<BR>
to a store. <BR>
<BR>
On Tue, 2006-03-07 at 14:12 -0500, Ian Eslick wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Probably we need to add a way to store simple database metadata (list</FONT>
<FONT COLOR="#000000">structure as a registry with strings, symbols and numbers) that contains</FONT>
<FONT COLOR="#000000">version and other information. Upon opening we can look up version</FONT>
<FONT COLOR="#000000">specific upgrade code if the elephant version is higher than the</FONT>
<FONT COLOR="#000000">database version and upgrade upon open, prompting the user for a target</FONT>
<FONT COLOR="#000000">spec if upgrade-by-copy or in-place. The easiest way to do this is to</FONT>
<FONT COLOR="#000000">reserve some keywords in the root by using a reserved value such as</FONT>
<FONT COLOR="#000000">'elephant::*elephant-metadata*.</FONT>
<FONT COLOR="#000000">In fact I recommend we agree on a standard for this and ensure that</FONT>
<FONT COLOR="#000000">0.6.0 contains this metadata so we can at least recognize 0.6.0+ db's</FONT>
<FONT COLOR="#000000">when they are opened. I apologizing if I'm repeating earlier</FONT>
<FONT COLOR="#000000">discussions. I've been effectively offline for the past week and a half.</FONT>
<FONT COLOR="#000000">Proposal:</FONT>
<FONT COLOR="#000000">(add-to-root 'elephant::*elephant-metadata*</FONT>
<FONT COLOR="#000000"> '((version 0 6 0) ;; format (version major minor sub1 ... subN)</FONT>
<FONT COLOR="#000000"> (spec :bdb "foo") ;; format (spec <spec as list>)</FONT>
<FONT COLOR="#000000"> (lisp . :sbcl))) ;; format (lisp . <lisp-type>)</FONT>
<FONT COLOR="#000000">In fact we might do the following as well:</FONT>
<FONT COLOR="#000000">1) assert an error when add-to-root is used by the user to write</FONT>
<FONT COLOR="#000000">elephant::*elephant-metadata*</FONT>
<FONT COLOR="#000000">2) create a simple interface around add-to-root which provides metadata</FONT>
<FONT COLOR="#000000">access</FONT>
<FONT COLOR="#000000">(defmethod get-metadata (tag &optional (sc *store-controller*))</FONT>
<FONT COLOR="#000000"> (let ((entry (assoc tag (get-from-root *elephant-metadata*)))</FONT>
<FONT COLOR="#000000"> (when entry</FONT>
<FONT COLOR="#000000"> (cdr entry))))</FONT>
<FONT COLOR="#000000">(defmethod set-metadata (tag value &optional (sc *store-controller*))</FONT>
<FONT COLOR="#000000"> (unless (reserved-metadata-tags tag)</FONT>
<FONT COLOR="#000000"> ...))</FONT>
<FONT COLOR="#000000">This way we make sure the user cannot shoot themselves in the foot by</FONT>
<FONT COLOR="#000000">overwriting reserved</FONT>
<FONT COLOR="#000000">metadata tags or the reserved root keyword. Migration should handle the</FONT>
<FONT COLOR="#000000">reserved keyword</FONT>
<FONT COLOR="#000000">specially by not migrating reserved tags but migrating any user-defined</FONT>
<FONT COLOR="#000000">tags.</FONT>
<FONT COLOR="#000000">This might be overkill as users may only need access to</FONT>
<FONT COLOR="#000000">system-maintained metadata rather</FONT>
<FONT COLOR="#000000">than yet another namespace for storing data as the root should function</FONT>
<FONT COLOR="#000000">equally well...</FONT>
<FONT COLOR="#000000">Thoughts?</FONT>
<FONT COLOR="#000000">Ian</FONT>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">elephant-devel site list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</A></FONT>
<FONT COLOR="#000000"><A HREF="http://common-lisp.net/mailman/listinfo/elephant-devel">http://common-lisp.net/mailman/listinfo/elephant-devel</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>