Bot::Cobalt::DB::Term - Bot::Cobalt::DB terminal interface
$ cobalt2-dbterm ## Or via Perl: Bot::Cobalt::DB::Term->new->interactive;
A simple Term::UI-based interface allowing interaction with Bot::Cobalt::DB databases.
Also allows interaction with Bot::Cobalt::Serializer via "thaw" and "freeze".
(For complete functionality you'll probably want Term::ReadLine::Gnu, or at least Term::ReadLine::Perl.)
Command arguments can be quoted.
Retrieve command line help.
Exit.
Open a specified database.
Required prior to specifying commands.
The database is opened to make sure it is valid, then unlocked again.
All other operations take place against whatever database was last opened via open.
open
Create and open a new database at the specified location.
Display the path to the currently-selected database.
List or search database keys.
If no arguments are specified, the entire list of keys will be returned.
A regular expression can be specified as an argument.
Get the raw value for a specified key.
Display the deserialiazed reference for a specified key.
Bot::Cobalt::DB databases usually store values as serialized references; getref will use Data::Dumper to display the data structure that would be created by deserializing.
getref
put KEY DATA ...
Add raw data to the specified key.
(You can, of course, horribly break your database this way, if you like.)
putref KEY PERLDATA ...
Add a serialized reference to the specified key.
For example:
putref MyKey { Some => 'Hash', Array => [ ] } putref MyArr [ 'A', 'B', 'C' ]
Deletes the specified key.
Freezes a Perl data structure via Bot::Cobalt::Serializer.
freeze { Some => 'Hash' }
Defaults to JSON. A Bot::Cobalt::Serializer format can optionally be specified:
freeze --yaml { Some => 'Hash' } freeze --xml { Some => 'Hash' }
Thaws a serialized data structure and displays it via Data::Dumper.
Jon Portnoy <avenj@cobaltirc.org>
http://www.cobaltirc.org
To install Bot::Cobalt::DB::Term, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::Cobalt::DB::Term
CPAN shell
perl -MCPAN -e shell install Bot::Cobalt::DB::Term
For more information on module installation, please visit the detailed CPAN module installation guide.