Changes

Jump to navigation Jump to search
315 bytes added ,  09:12, 12 August 2015
Line 67: Line 67:     
               my $config = esmith::ConfigDB->create($new_config_file);
 
               my $config = esmith::ConfigDB->create($new_config_file);
 +
 +
example for creating and using a custom database in one line:
 +
 +
my $customDB = esmith::ConfigDB->open('YOUR_DATABASE_NAME') || esmith::ConfigDB->create('YOUR_DATABASE_NAME');
    
==== checking if a record exists ====
 
==== checking if a record exists ====
Line 102: Line 106:  
               my $rec = $config->get($key) ││
 
               my $rec = $config->get($key) ││
 
                         $config->new_record($key);
 
                         $config->new_record($key);
 +
 +
for example (if it doesn't exist we create it)
 +
    my $rec = $DB->get('roundcube') || $DB->new_record('roundcube', {type => 'service'});
    
==== getting a value ====
 
==== getting a value ====

Navigation menu