GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Genezzo::Dict(3) User Contributed Perl Documentation Genezzo::Dict(3)

Genezzo::Dict.pm - The Genezzo data dictionary

 use Genezzo::Dict;
 # create a new dictionary
 my $dictobj = Genezzo::Dict->new(
                  gnz_home => $gnz_home, 
                  init_db => $init);
 
 # see if a table exists
 if ($dictobj->DictTableExists (
                   tname => $tablename,
                   silent_exists => 0,
                   silent_notexists => 1 )))...
 # create a new table
 $dictobj->DictTableCreate (
                   tname => $tablename,
                   tabdef => \%coldatatype,
                   tablespace => "SYSTEM");
 # drop a table
 $dictobj->DictTableDrop (tname => $tablename);
 # save the state of the dictionary to disk
 $dictobj->DictSave();
 my $colhash = 
     $dictobj->DictTableGetCols (tname => $tablename);
 $dictobj->RowInsert (tname => $tablename, 
                      rowval => \@rowarr );
 $dictobj->RowDelete (tname => $tablename, 
                      rid => $rid);
 $dictobj->RowUpdate (tname => $tablename, 
                      rid => $rid,
                      rowval => \@rowarr);
 # return the table as a tied hash
 my $tablehash = 
     $dictobj->DictTableGetTable (tname => $tablename) ;

The dictionary is a complete description of the Genezzo system, recording information on table structure and physical layout. It provides an interface to create, destroy, query, and manipulate tables.

The dictionary itself is just a set of tables stored in the system tablespace. Genezzo only uses six core tables to describe its basic dictionary. NOTE: Modifying any dictionary tables will framboozle your nimwits. You have been warned.

_pref1 -- a set of key/value pairs that describe the database configuration
_tspace -- the list of tablespaces for this Genezzo instance.
_tsfiles -- the list of files which compose each tablespace
_tab1 -- the list of tables and their associated tablespaces
_col1 -- the list of columns for each table

I want to reduce the interface to a simple tied hash, something like:

 my $errormsg;
 %args = (errormsg => \$errormsg );
 my $dicthash = DictGetDictHash(%args);

Checking for the existance of a table would be something like:

 my $tablename = "kitchentable";
 if (exists($dicthash->{tableinfo}->{$tablename}))
 {
    # do stuff...
 }
 else
 {
    # errormsg was reference in tie of dicthash, 
    # contains last error status
    print $errormsg;
 }

Jeffrey I. Cohen, jcohen@genezzo.com

perl(1).

Copyright (c) 2003, 2004, 2005, 2006 Jeffrey I Cohen. All rights reserved.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

Address bug reports and comments to: jcohen@genezzo.com

For more information, please visit the Genezzo homepage at <http://www.genezzo.com>

2007-06-26 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.