namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::apm_package_version {set :__default_metaclass ::xotcl::Class
set :__default_superclass ::xotcl::Object
set :abstract_p f
set :auto_save false
set :name_method {}
set :object_type ::xo::db::sql::apm_package_version
set :security_inherit_p t
set :sql_package_name apm_package_version
set :supertype acs_object
set :with_table true}
::xo::db::sql::apm_package_version proc sortable_version_name {{-dbn {}} -version_name:required} {
foreach var [list VERSION_NAME] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__sortable_version_name($_VERSION_NAME)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc add_interface {{-dbn {}} -interface_id -version_id:required -interface_uri:required -interface_version:required} {
foreach var [list INTERFACE_ID VERSION_ID INTERFACE_URI INTERFACE_VERSION] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__add_interface($_INTERFACE_ID, $_VERSION_ID, $_INTERFACE_URI, $_INTERFACE_VERSION)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc new {{-dbn {}} -version_id -package_key:required -version_name -version_uri:required -summary:required -description_format:required -description:required -release_date:required -vendor:required -vendor_uri:required -auto_mount:required {-installed_p f} {-data_model_loaded_p f} -childof} {
foreach var [list VERSION_ID PACKAGE_KEY VERSION_NAME VERSION_URI SUMMARY DESCRIPTION_FORMAT DESCRIPTION RELEASE_DATE VENDOR VENDOR_URI AUTO_MOUNT INSTALLED_P DATA_MODEL_LOADED_P] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__new($_VERSION_ID, $_PACKAGE_KEY, $_VERSION_NAME, $_VERSION_URI, $_SUMMARY, $_DESCRIPTION_FORMAT, $_DESCRIPTION, $_RELEASE_DATE, $_VENDOR, $_VENDOR_URI, $_AUTO_MOUNT, $_INSTALLED_P, $_DATA_MODEL_LOADED_P)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc copy {{-dbn {}} -version_id:required -new_version_id -new_version_name:required -new_version_uri:required -copy_owners_p:required} {
foreach var [list VERSION_ID NEW_VERSION_ID NEW_VERSION_NAME NEW_VERSION_URI COPY_OWNERS_P] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__copy($_VERSION_ID, $_NEW_VERSION_ID, $_NEW_VERSION_NAME, $_NEW_VERSION_URI, $_COPY_OWNERS_P)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc delete {{-dbn {}} -version_id:required} {
foreach var [list VERSION_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__delete($_VERSION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc disable {{-dbn {}} -version_id:required} {
foreach var [list VERSION_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__disable($_VERSION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc remove_dependency {{-dbn {}} -dependency_uri:required -dependency_version:required -version_id:required} {
foreach var [list DEPENDENCY_URI DEPENDENCY_VERSION VERSION_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__remove_dependency($_DEPENDENCY_URI, $_DEPENDENCY_VERSION, $_VERSION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc edit {{-dbn {}} -new_version_id -version_id:required -version_name -version_uri:required -summary:required -description_format:required -description:required -release_date:required -vendor:required -vendor_uri:required -auto_mount:required {-installed_p f} {-data_model_loaded_p f}} {
foreach var [list NEW_VERSION_ID VERSION_ID VERSION_NAME VERSION_URI SUMMARY DESCRIPTION_FORMAT DESCRIPTION RELEASE_DATE VENDOR VENDOR_URI AUTO_MOUNT INSTALLED_P DATA_MODEL_LOADED_P] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__edit($_NEW_VERSION_ID, $_VERSION_ID, $_VERSION_NAME, $_VERSION_URI, $_SUMMARY, $_DESCRIPTION_FORMAT, $_DESCRIPTION, $_RELEASE_DATE, $_VENDOR, $_VENDOR_URI, $_AUTO_MOUNT, $_INSTALLED_P, $_DATA_MODEL_LOADED_P)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc version_name_greater {{-dbn {}} -version_name_one:required -version_name_two:required} {
foreach var [list VERSION_NAME_ONE VERSION_NAME_TWO] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__version_name_greater($_VERSION_NAME_ONE, $_VERSION_NAME_TWO)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc enable {{-dbn {}} -version_id:required} {
foreach var [list VERSION_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__enable($_VERSION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc upgrade {{-dbn {}} -version_id:required} {
foreach var [list VERSION_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__upgrade($_VERSION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc remove_interface {{-dbn {}} -interface_uri:required -interface_version:required -version_id:required} {
foreach var [list INTERFACE_URI INTERFACE_VERSION VERSION_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__remove_interface($_INTERFACE_URI, $_INTERFACE_VERSION, $_VERSION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc upgrade_p {{-dbn {}} -path:required -initial_version_name:required -final_version_name:required} {
foreach var [list PATH INITIAL_VERSION_NAME FINAL_VERSION_NAME] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__upgrade_p($_PATH, $_INITIAL_VERSION_NAME, $_FINAL_VERSION_NAME)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::apm_package_version proc add_dependency {{-dbn {}} -dependency_type:required -dependency_id -version_id:required -dependency_uri:required -dependency_version:required} {
foreach var [list DEPENDENCY_TYPE DEPENDENCY_ID VERSION_ID DEPENDENCY_URI DEPENDENCY_VERSION] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select apm_package_version__add_dependency($_DEPENDENCY_TYPE, $_DEPENDENCY_ID, $_VERSION_ID, $_DEPENDENCY_URI, $_DEPENDENCY_VERSION)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}