Lux::IO - A Perl Interface to Lux IO


Lux-IO documentation  | view source Contained in the Lux-IO distribution.

Index


NAME

Top

Lux::IO - A Perl Interface to Lux IO

SYNOPSIS

Top

  use Lux::IO;
  use Lux::IO::Btree;

  my $bt = Lux::IO::Btree->new(Lux::IO::CLUSTER);
  $bt->open('test', Lux::IO::DB_CREAT);
  $bt->put('key', 'value', Lux::IO::OVERWRITE); #=> true
  $bt->get('key');                              #=> 'value'
  $bt->del('key');                              #=> true
  $bt->get('key');                              #-> false
  $bt->close;

DESCRIPTION

Top

Lux IO is a yet another database manager. Lux::IO provides a Perl interface to it. You must note that it supports only B+ Tree-based database so far, though Lux IO supports also array-based database.

CAVEAT

Top

Lux::IO now supports Lux IO library above version 0.2.1. You must install it before trying to install this module.

METHODS

Top

new ( $index_type )

  my $bt = Lux::IO::Btree->new(Lux::IO::CLUSTER);

Creates and returns a new Lux::IO::Btree object. $insert_type can be one of the types below:

* Lux::IO::CLUSTER
* Lux::IO::NONCLUSTER

open ( $filename, $oflags )

  $bt->open($filename, Lux::IO::DB_CREAT);

Opens a database specified by $filename. $oflags can be one of or a combination of the flags below:

* Lux::IO::DB_RDONLY
* Lux::IO::DB_RDWR
* Lux::IO::DB_CREAT
* Lux::IO::DB_TRUNC

close ()

  $bt->close();

Closes the database.

get ( $key )

  $bt->get($key);

Retrieves a value which is correspondent to the $key from the database.

put ( $key, $value, $insert_mode )

  $bt->put($key, $value, Lux::IO::OVERWRITE);

Stores the key-value pair into the database. $insert_mode can be one of the modes below:

* Lux::IO::OVERWRITE
* Lux::IO::NOOVERWRITE
* Lux::IO::APPEND

del ( $key )

  $bt->del($key);

Deletes the value which is correspondent to the $key.

SEE ALSO

Top

* Lux IO

http://luxio.sourceforge.net/

AUTHOR

Top

ACKNOWLEDGMENT

Top

COPYRIGHT AND LICENSE

Top


Lux-IO documentation  | view source Contained in the Lux-IO distribution.