NAME
ObjStore::Table3 - RDBMS Style Tables
SYNOPSIS
cd table-test ObjStore::Table3::Database
DESCRIPTION
Unstructured perl databases are probably under-constrained for most applications. Tables standardize the interface for storing a bunch of records and their associated indices.
A table is no more than a collection of indices (as opposed to a some sort of heavy-weight object). Think of it like an event manager for indices.
Be aware that index cursors may only be used by one thread at a time. Therefore, it is not particularly useful to store pre-created cursors in a database. It's probably faster just to create them transiently when needed.
API
$t->primary()
Returns the primary index.
$t->anyx
Returns a non-empty index.
$t->add($e)
Adds $e to all table indices.
$t->remove($e)
Removes $e from all table indices.
$t->index($index_name)
Returns the index named $index_name.
$t->fetch($index_name, @keys)
Returns the record resulting from looking up @keys in the index named $index_name.
$t->add_index($name, $index)
Adds an index. The index can be a closure if your not sure if it already exists.
$t->remove_index($index)
$t->map_indices($coderef)
Calls $coderef->($index) on each index.
Representation Independent API
A database can be seen as table, and/or tables can be stored within a database. The implementation is only slightly different in either case. To smooth things over, an accessor method is provided that always returns the top-level hash of the table.
$t->table
Returns the top-level hash.
MIGRATION
Expand migration options?
TODO
INTERFACE
The interface will evolve as perl supports more overload-type features.
AUTHOR
Copyright © 1997-1998 Joshua Nathaniel Pritikin. All rights reserved.
This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 246:
Non-ASCII character seen before =encoding in '©'. Assuming CP1252