select repository_id, title, description, help_text
from download_repository_obj
where parent_id = :package_id
select count(*) from download_archive_types
where repository_id = :repository_id
select choice_id, label
from download_metadata_choices
where metadata_id = :metadata_id
order by sort_order
select count(*) from download_downloads
where download_id = :download_id
select count(*) from cr_mime_types
where mime_type = :mime_type
insert into cr_mime_types
(mime_type, file_extension)
values
(:mime_type, :extension)
select
dam.metadata_id,
dam.pretty_name,
dam.data_type,
dam.required_p
from download_archive_metadata dam
where dam.repository_id = :repository_id and
dam.computed_p = 'f' and
(dam.archive_type_id = :archive_type_id or
dam.archive_type_id is null)
order by sort_key
select
dam.metadata_id,
dam.data_type
from download_archive_metadata dam
where dam.repository_id = :repository_id and
dam.computed_p = 'f' and
(dam.archive_type_id = :archive_type_id or
dam.archive_type_id is null)
order by sort_key
insert into download_revision_data
(revision_id, metadata_id, $answer_column)
values
( :revision_id, :metadata_id, :response )