apm::package_version::attributes::store (private)

 apm::package_version::attributes::store -version_id version_id \
    -array array

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Store the dynamic attributes of a certain package version in the database.

Switches:
-version_id (required)
The id of the package version to store attribute values for
-array (required)
The name of the array in the callers scope containing the attribute values to store
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 apm_package_install_version apm_package_install_version (public) apm::package_version::attributes::store apm::package_version::attributes::store apm_package_install_version->apm::package_version::attributes::store apm_version_update apm_version_update (public) apm_version_update->apm::package_version::attributes::store apm::package_version::attributes::get_spec apm::package_version::attributes::get_spec (public) apm::package_version::attributes::store->apm::package_version::attributes::get_spec db_dml db_dml (public) apm::package_version::attributes::store->db_dml db_transaction db_transaction (public) apm::package_version::attributes::store->db_transaction

Testcases:
No testcase defined.
Source code:
    upvar $array attributes

    db_transaction {
        db_dml clear_old_attributes {
            delete from apm_package_version_attr
            where version_id = :version_id
        }

        array set dynamic_attributes [apm::package_version::attributes::get_spec]
        foreach attribute_name [array names dynamic_attributes] {
            if { [info exists attributes($attribute_name)] } {
                set attribute_value $attributes($attribute_name)

                db_dml insert_attribute {
                    insert into apm_package_version_attr
                    (attribute_name, attribute_value, version_id)
                    values (:attribute_name, :attribute_value, :version_id)
                }
            }
        }
    }
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: