xo::db::sql::content_type proc register_relation_type (public)

 xo::db::sql::content_type[i] register_relation_type [ -dbn dbn ] \
    -content_type content_type  -target_type target_type  \
    [ -relation_tag relation_tag ] [ -min_n min_n ] [ -max_n max_n ]

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

Automatically generated method

Switches:
-dbn
(optional)
-content_type
(required)
-target_type
(required)
-relation_tag
(defaults to "generic") (optional)
-min_n
(defaults to "0") (optional)
-max_n
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 db_with_handle db_with_handle (public) xo::db::sql::content_type proc register_relation_type xo::db::sql::content_type proc register_relation_type xo::db::sql::content_type proc register_relation_type->db_with_handle

Testcases:
No testcase defined.
Source code:
#function_args: {CONTENT_TYPE {}} {TARGET_TYPE {}} {RELATION_TAG generic} {MIN_N 0} {MAX_N null}
foreach var [list CONTENT_TYPE TARGET_TYPE RELATION_TAG MIN_N MAX_N]  {
  set varname [string tolower $var]
  if {[info exists $varname]} {
    set $var [set $varname]
    set _$var :$var
  } else {
    set _$var null
  }
}
set sql "
select content_type__register_relation_type($_CONTENT_TYPE$_TARGET_TYPE$_RELATION_TAG$_MIN_N$_MAX_N) 
    "
db_with_handle -dbn $dbn db {
  #ns_log notice "--sql=$sql"
  return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: