Commit 64553882 authored by Leo Gordon's avatar Leo Gordon
Browse files

sqlite has views but not procedures

parent 85cc4260
......@@ -97,6 +97,7 @@ sub pipeline_create_commands {
? [
# standard eHive tables and unique/non-unique indices:
$self->db_connect_command($db_conn).' <'.$self->o('ensembl_cvs_root_dir').'/ensembl-hive/sql/tables.sqlite',
$self->db_connect_command($db_conn).' <'.$self->o('ensembl_cvs_root_dir').'/ensembl-hive/sql/procedures.sqlite',
]
: [
'mysql '.$self->dbconn_2_mysql($db_conn, 0)." -e 'CREATE DATABASE ".$self->o('pipeline_db', '-dbname')."'",
......
-- ------------------------------------------------------------------------------------------------------
--
-- Some stored functions, views and procedures used in hive:
--
-- --- show hive progress for analyses (turned into a view to give extra flexibility) -------------------
--
-- Thanks to Greg Jordan for the idea and the original version
--
-- Usage:
-- select * from progress; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from progress where logic_name like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where retry_count>1; # only show jobs that have been tried more than once
CREATE VIEW IF NOT EXISTS progress AS
SELECT a.logic_name || '(' || a.analysis_id || ')' analysis_name_and_id, j.status, j.retry_count, count(*) cnt, job_id example_job_id
FROM analysis a LEFT JOIN job j USING (analysis_id)
GROUP BY a.analysis_id, j.status, j.retry_count
ORDER BY a.analysis_id, j.status;
-- a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name ------------
--
-- Usage:
-- select * from msg;
-- select * from msg where analysis_id=18;
-- select * from msg where logic_name like 'family_blast%';
CREATE VIEW IF NOT EXISTS msg AS
SELECT a.analysis_id, a.logic_name, m.*
FROM job_message m
JOIN job j USING (job_id)
JOIN analysis a USING (analysis_id);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment