<commit_before>package RSGet::DB;
# This file is an integral part of rsget.pl downloader.
#
# 2010 (c) <NAME> <<EMAIL>>
#		This program is free software,
# you may distribute it under GPL v2 or newer.

use strict;
use warnings;
use RSGet::Common;
use RSGet::Config;

def_settings(
	database => {
		desc => "Place where rsget.pl can store all information.",
		default => "dbi:SQLite:dbname=rsget.db",
	}
);


my $dbh;
sub init
{
	$dbh = DBI->connect( setting( "database" ), "", "" );
}

sub get
{
	my $table = shift;
	my $keys = shift;
	my $where = shift;

	return unless $dbh;

	# TODO
}
<commit_msg>- added some options<commit_after>package RSGet::DB;
# This file is an integral part of rsget.pl downloader.
#
# 2010 (c) <NAME> <<EMAIL>>
#		This program is free software,
# you may distribute it under GPL v2 or newer.

use strict;
use warnings;
use RSGet::Common;
use RSGet::Config;

def_settings(
	db => {
		desc => "Place where rsget.pl can store all information."
			. " Must be DBI compatible name.",
		default => "dbi:SQLite:dbname=%{configdir}/rsget.db",
	},
	db_user => {
		desc => "Database user.",
		default => "",
	},
	db_pass => {
		desc => "Database password.",
		default => "",
	},
	db_prefix => {
		desc => "Table prefix, like schema (with prefix 'rsget.' tables will be"
			. "	called 'rsget.tablename').",
		default => "rsget_",
	},
);


my $dbh;
sub init
{
	$dbh = DBI->connect(
		setting( "db" ),
		setting( "db_user" ),
		setting( "db_pass" ),
	);
}

sub END
{
	$dbh->disconnect()
		if $dbh;
}

sub get
{
	my $table = shift;
	my $keys = shift;
	my $where = shift;

	return unless $dbh;

	# TODO
}

{'fraction_non_alphanumeric': 0.1619283065512979, 'fraction_numerical': 0.006180469715698393, 'mean_word_length': 3.5097493036211698, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1939052', 'n_tokens_mistral': 648, 'n_tokens_neox': 606, 'n_words': 187}