NAME

Yote::SQLiteIO - A SQLite persistance engine for Yote.

DESCRIPTION

This can be installed as a singleton of Yote::ObjProvider and does the actual storage and retreival of Yote objects.

The interaction the developer will have with this may be specifying its intialization arguments.

CONFIGURATION

The package name is used as an argument to the Yote::ObjProvider package which also takes the configuration parameters for Yote::SQLiteIO.

Yote::ObjProvider::init( datastore => 'Yote::SQLiteIO', db => 'yote_db', uname => 'yote_db_user', pword => 'yote_db_password' );

PUBLIC METHODS

client

Return the mongo client object

commit_transaction( )
database( )

Provides a database handle. Used only in testing.

disconnect( )
ensure_datastore( )

Makes sure that the datastore has the correct table structure set up and in place.

fetch( id )

Returns a hash representation of a yote object, hash ref or array ref by id. The values of the object are in an internal storage format and used by Yote::ObjProvider to build the object.

first_id( id )

Returns the id of the first object in the system, the YoteRoot.

get_id( obj )

Returns the id for the given hash ref, array ref or yote object. If the argument does not have an id assigned, a new id will be assigned.

has_path_to_root( obj_id )

Returns true if the object specified by the id can trace a path back to the root yote object.

max_id( )

Returns the max ID in the yote system. Used for testing.

new
paginate_xpath( path, start, length )

This method returns a paginated portion of an object that is attached to the xpath given, as internal yote values.

paginate_xpath_list( parth, start, length )

This method returns a paginated portion of a list that is attached to the xpath given.

path_to_root( object )

Returns the xpath of the given object tracing back a path to the root. This is not guaranteed to be the shortest path to root.

paths_to_root( object )

Returns the a list of all valid xpaths of the given object tracing back a path to the root.

recycle_object( obj_id )

Sets the available for recycle mark on the object entry in the database by object id and removes its data.

recycle_objects( start_id, end_id )

Recycles all objects in the range given if they cannot trace back a path to root.

start_transaction( )
stow( id, class, data )

Stores the object of class class encoded in the internal data format into the data store.

stow_all( )

Stows all objects that are marked as dirty. This is called automatically by the application server and need not be explicitly called.

xpath( path )

Given a path designator, returns the object data at the end of it, starting in the root. The notation is /foo/bar/baz where foo, bar and baz are field names.

xpath_count( path )

Given a path designator, returns the number of fields of the object at the end of it, starting in the root. The notation is /foo/bar/baz where foo, bar and baz are field names. This is useful for counting how many things are in a list.

xpath_delete( path )

Deletes the entry specified by the path.

xpath_insert( path, item )

Inserts the item at the given xpath, overwriting anything that had existed previously.

xpath_list_insert( path, item )

Appends the item to the list located at the given xpath.

AUTHOR

Eric Wolf

LICENSE AND COPYRIGHT

Copyright (C) 2011 Eric Wolf

This module is free software; it can be used under the same terms as perl itself.