Remove _full methods
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index 4bd7513bd3e23e7c6206b007931ca3277f0610b8..559ae623f2bc2c4a7d68d4b00b96939d86825d26 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 
 use parent qw/Exporter/;
 our $VERSION = '5999.000_013';
-our @EXPORT = qw/purge db user_list user_entry problem_list problem_entry problem_full contest_list contest_entry contest_full contest_has_problem job_list job_entry job_full create_job standings update_status rerun_job take_job finish_job/; ## no critic (ProhibitAutomaticExportation)
+our @EXPORT = qw/purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job take_job finish_job/; ## no critic (ProhibitAutomaticExportation)
 
 use JSON::MaybeXS qw/decode_json/;
 use HTTP::Tiny;
@@ -27,18 +27,15 @@ my %statements = (
 
        contest_list_sth => 'SELECT * FROM contest_entry',
        contest_entry_sth => 'SELECT * FROM contest_entry WHERE id = ?',
-       contest_full_sth => 'SELECT * FROM contests WHERE id = ?',
        contest_problems_sth => 'SELECT problem FROM contest_problems JOIN problems pb ON problem=pb.id WHERE contest = ? ORDER BY pb.value',
        contest_has_problem_sth => 'SELECT EXISTS(SELECT 1 FROM contest_problems WHERE contest = ? AND problem = ?)',
        opens_sth => 'SELECT problem,owner,time FROM opens WHERE contest = ?',
 
        problem_entry_sth => 'SELECT ' . (join ',', @{PROBLEM_PUBLIC_COLUMNS()}, 'statement', 'solution') . ' FROM problems WHERE id = ?',
-       problem_full_sth => 'SELECT * FROM problems WHERE id = ?',
        limits_sth => 'SELECT format,timeout FROM limits WHERE problem = ?',
        problem_values_sth => 'SELECT id,value FROM problems',
 
        job_entry_sth => 'SELECT * FROM job_entry WHERE id = ?',
-       job_full_sth => 'SELECT * FROM jobs WHERE id = ?',
 
        rerun_job_sth => 'UPDATE jobs SET daemon=NULL,result=-2,result_text=NULL,results=NULL,errors=NULL WHERE id = ?',
        take_job_sth => 'UPDATE jobs SET daemon=? WHERE id = (SELECT id FROM jobs WHERE daemon IS NULL LIMIT 1 FOR UPDATE) RETURNING id',
@@ -130,14 +127,10 @@ sub problem_entry {
        $ret
 }
 
-sub problem_full { scalar query(problem_full_sth => $_[0])->hash }
-
 sub contest_list { add_names query('contest_list_sth')->hashes }
 
 sub contest_entry { add_names query(contest_entry_sth => $_[0])->hash }
 
-sub contest_full { scalar query(contest_full_sth => $_[0])->hash }
-
 sub contest_has_problem { query('contest_has_problem_sth', @_[0, 1])->flat }
 
 sub job_list {
@@ -170,8 +163,6 @@ sub job_entry {
        $ret
 }
 
-sub job_full { scalar query(job_full_sth => $_[0])->hash }
-
 sub create_job {
        my (%args) = @_;
        $db->update('users', {lastjob => time}, {id => $args{owner}});
@@ -266,7 +257,7 @@ sub rerun_job {
 sub take_job {
        my ($daemon) = @_;
        my $id = query(take_job_sth => $daemon)->list;
-       return $id ? job_full $id : undef;
+       return $id ? db->select(jobs => '*', {id => $id})->hash : undef;
 }
 
 sub finish_job {
This page took 0.010728 seconds and 4 git commands to generate.