<commit_before>use strict;
use warnings;

use lib 'lib/perl/DBEngine/';
use DBEngine;
use Data::Dumper;

my $db_engine = DBEngine::new($ARGV[0]);

$db_engine->CreateDatabase('my_test');
$db_engine->Connect('my_test');
$db_engine->CreateTable('simple_text', [ {name => "ab", type => 1}, {name => 'bb', type => 2}]);
$db_engine->InsertInto('simple_text', {ab => 2, bb => 'stan'});
$db_engine->InsertInto('simple_text', {ab => 3, bb => 'kyle'});

print Dumper $db_engine->GetEntriesByValue('simple_text', [ {column_name => 'ab', desired_value => 3, compare_by => '=='}]);
#print Dumper $db_engine->GetEntriesByValue('simple_text', [{column_name => 'ab', desired_value => 3}, {column_name => 'ab', desired_value => 2}]);
print Dumper $db_engine->GetEntriesByValue('simple_text');
$db_engine->DeleteEntireTable('simple_text');
#$db_engine->DropTable('simple_text');
$db_engine->DropDatabase('my_db');
$db_engine->Disconnect();


<commit_msg>updated with newer api<commit_after>use strict;
use warnings;

use lib 'lib/perl/DBEngine/';
use DBEngine;
use Data::Dumper;

my $db_engine = DBEngine::new($ARGV[0]);

#$db_engine->CreateDatabase('my_test3');
$db_engine->Connect('my_test3');
#$db_engine->CreateTable('simple_text', [ {name => "a", type => 1},
#{name => 'b', type => 1},{name => 'c', type=> 2}, {name => 'd', type => 2}, {name => 'e', type => 2}]);
my $time = time;

#$db_engine->InsertInto('simple_text', {ab => 4, bb => '12312312'});

$db_engine->MapEntries('simple_text', 'update', [{column_name => 'a', desired_value => 50, compare_by => '=='}], {new_row => {a => 3, b => 3, c => 3, d =>3, e=>3}});
#$db_engine->MapEntries('simple_text', 'update', [{column_name => 'a', desired_value => 50, compare_by => '=='}], {new_row => {a => 4, b => 4, c => 4, d=>4, e =>4}});
#$db_engine->DeleteRows('simple_text', [{column_name => 'ab', desired_value => 10, compare_by => '>'}]);
#$db_engine->MapEntries('simple_text', 'select');
#print Dumper $db_engine->GetEntriesByValue('simple_text', [ {column_name => 'ab', desired_value => 6, compare_by => '<'}]);
#print Dumper $db_engine->GetEntriesByValue('simple_text', [{column_name => 'ab', desired_value => 3}, {column_name => 'ab', desired_value => 2}]);
#print Dumper $db_engine->GetEntriesByValue('simple_text');
#$db_engine->TruncateTable('simple_text');
#$db_engine->DropTable('simple_text');
#$db_engine->DropDatabase('my_db');
#

print "total time:  ", time - $time, "\n";

$db_engine->Disconnect();
{'fraction_non_alphanumeric': 0.2383673469387755, 'fraction_numerical': 0.017959183673469388, 'mean_word_length': 7.280405405405405, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 86, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6286026', 'n_tokens_mistral': 926, 'n_tokens_neox': 887, 'n_words': 182}