postgresql7.1
select apm_package__highest_version (
:package_key
);
select version_name
from apm_package_versions
where package_key = :package_key
and version_id = apm_package__highest_version(:package_key)
select apm_package__num_instances(
:package_key
);
select apm__register_parameter(
:parameter_id,
:package_key,
:parameter_name,
:description,
:scope,
:datatype,
:default_value,
:section_name,
:min_n_values,
:max_n_values
);
select apm__unregister_parameter(:parameter_id)
select apm_package_version__add_dependency(
:dependency_type,
:dependency_id,
:version_id,
:dependency_uri,
:dependency_version
);
select apm_package_version__remove_dependency(
:dependency_id
);
select apm_package_version__add_interface(
:interface_id,
:version_id,
:interface_uri,
:interface_version
);
select apm_package_version__remove_interface(
:interface_id
);
select case when count(*) = 0 then 0 else 1 end
from apm_package_versions
where package_key = :package_key
and version_name = :version_name
select apm_package__new(
:package_id,
:instance_name,
:package_key,
'apm_package',
now(),
null,
null,
:context_id
);
select apm_package__delete(:package_id);
select site_node__url(min(node_id))
from site_nodes
where object_id = :package_id
select package_key,
pretty_name
from apm_package_types
where not (apm_package__singleton_p(package_key) = 1 and
apm_package__num_instances(package_key) >= 1)
order by pretty_name
select apm_parameter_value__new(null, :package_id, ap.parameter_id, ap.default_value)
from apm_parameters ap
where ap.package_key = :new_package_key
and not exists (select 1
from apm_parameters ap2
where ap2.package_key = :old_package_key
and ap2.parameter_name = ap.parameter_name)