xo::db::Attribute method db_attribute_defined (public)

 <instance of xo::db::Attribute[i]> db_attribute_defined \
    [ -object_type object_type ] [ -attribute_name attribute_name ]

Defined in packages/xotcl-core/tcl/05-db-procs.tcl

One could try caching this, but be aware that this also requires proper flushing, this value cannot be considered immutable, not even per request. ns_log notice "GN: db_attribute_defined name $attribute_name type $object_type" ::xo::dc 0or1row -prepare text,text check_att { select 1 from acs_attributes where attribute_name = :attribute_name and object_type = :object_type }

Switches:
-object_type (optional)
-attribute_name (optional)

Testcases:
No testcase defined.
Source code:
if {![nsv_get acs_attributes acs_attributes list]} {
  #ns_log notice "GN: fetch all db_attributes"
  set list [xo::dc list get_all_attributes {
    select object_type || '-' || attribute_name from acs_attributes
  }]
  nsv_set acs_attributes acs_attributes $list
}
set key $object_type-$attribute_name
#ns_log notice "GN: check is $object_type $attribute_name in list? [expr {$key in $list}]"
expr {$key in $list}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: