[ Table Of Contents | Keyword Index ]

serialize(n) 0.8.5 ral "Relation persistence"

NAME

serialize - Persistent storage for relations

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    SERIALIZATION FORMAT
    SEE ALSO
    KEYWORDS
    COPYRIGHT

SYNOPSIS

package require ral ?0.8.5?

::ral::serialize ?namespace?
::ral::serializeToFile fileName ?namespace?
::ral::deserialize serialization ?namespace?
::ral::deserializeFromFile fileName ?namespace?
::ral::storeToMk fileName ?namespace?
::ral::loadFromMk fileName ?namespace?
::ral::dump ?namespace?
::ral::dumpToFile fileName ?namespace?

DESCRIPTION

This manpage describes a set of commands that are used for saving the values of relvars on external storage. All of the commands below take an optional namespace argument. If present, then the command is applied to relvars from the given namespace. Otherwise by default all relvars are considered. Since TclRAL manages relvar names using namespace-like syntax, this may be used to manage distinct sets of relvars without risking naming conflicts.

COMMANDS

::ral::serialize ?namespace?
The serialize command returns a string that represents the values and constraints for all of the relvars contained within namespace. The string returned by serialize may be given to deserialize to restore the values of the relvars.

::ral::serializeToFile fileName ?namespace?
The serializeToFile command invokes serialize and places the resulting serialization string into the file given by fileName.

::ral::deserialize serialization ?namespace?
The deserialize command restores the values and constraints on a set of relvars. The serialization argument must be a value returned from the serialize command. If the namespace argument is given, then the relvars and constraints are placed in the given namespace which need not exist prior to invoking the command.

::ral::deserializeFromFile fileName ?namespace?
The deserializeFromFile command reads the file given by the fileName argument and invokes deserialize on its contents.

::ral::storeToMk fileName ?namespace?
The storeToMk command stores the state of a set of relvars into a metaKit database. Each relvar is stored in a separate metaKit view. Several additional views are created to hold system catalog information. The additional views have names that start with __ral. If fileName exists already, it is renamed to be fileName~ before a new file is created with the current state of the relvars.

::ral::loadFromMk fileName ?namespace?
The loadFromMk command restores the state of a set of relvars from the information contained in a metaKit database. That database must have been created using the storeToMk command.

::ral::dump ?namespace?
The dump command returns a Tcl script that when evaluated will restore the state of a set of relvars to be the same as when the dump command was executed. The dump command is another form of serialization for a set of relvars and is often useful when creating Tcl packages that create an empty schema of relvars.

::ral::dumpToFile fileName ?namespace?
The dumpToFile invokes the dump command and writes the resulting script to the file given by fileName.

SERIALIZATION FORMAT

The format used for serialization of a set of relvars consists of a Tcl list with four elements.

SEE ALSO

relation , relvar , tuple

KEYWORDS

relation , relvar , tuple

COPYRIGHT

Copyright © 2004, 2005, 2006, 2007 by G. Andrew Mangogna