Class ::xo::db::sql::rel_constraint

::xo::db::sql::rel_constraint[i] create ...

Defined in

Class Relations

  • class: ::xo::db::Class[i]
  • superclass: ::xotcl::Object[i]
::xo::db::Class create ::xo::db::sql::rel_constraint \
     -superclass ::xotcl::Object

Methods (to be applied on the object)

  • delete (scripted, public)

     xo::db::sql::rel_constraint[i] delete [ -dbn dbn ] \
        -constraint_id constraint_id 

    Automatically generated method

    Switches:
    -dbn (optional)
    -constraint_id (required)

    Testcases:
    No testcase defined.
    #function_args: {CONSTRAINT_ID {}}
    foreach var [list CONSTRAINT_ID]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select rel_constraint__delete($_CONSTRAINT_ID) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • get_constraint_id (scripted, public)

     xo::db::sql::rel_constraint[i] get_constraint_id [ -dbn dbn ] \
        -rel_segment rel_segment  -rel_side rel_side  \
        -required_rel_segment required_rel_segment 

    Automatically generated method

    Switches:
    -dbn (optional)
    -rel_segment (required)
    -rel_side (required)
    -required_rel_segment (required)

    Testcases:
    No testcase defined.
    #function_args: {REL_SEGMENT {}} {REL_SIDE {}} {REQUIRED_REL_SEGMENT {}}
    foreach var [list REL_SEGMENT REL_SIDE REQUIRED_REL_SEGMENT]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select rel_constraint__get_constraint_id($_REL_SEGMENT$_REL_SIDE$_REQUIRED_REL_SEGMENT) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • new (scripted, public)

     xo::db::sql::rel_constraint[i] new [ -dbn dbn ] \
        [ -constraint_id constraint_id ] \
        [ -constraint_type constraint_type ] \
        -constraint_name constraint_name  -rel_segment rel_segment  \
        [ -rel_side rel_side ] -required_rel_segment required_rel_segment  \
        [ -context_id context_id ] [ -creation_user creation_user ] \
        [ -creation_ip creation_ip ] [ -childof childof ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -constraint_id (optional)
    -constraint_type (optional, defaults to "rel_constraint")
    -constraint_name (required)
    -rel_segment (required)
    -rel_side (optional, defaults to "two")
    -required_rel_segment (required)
    -context_id (optional)
    -creation_user (optional)
    -creation_ip (optional)
    -childof (optional)

    Testcases:
    No testcase defined.
    #function_args: {CONSTRAINT_ID null} {CONSTRAINT_TYPE rel_constraint} {CONSTRAINT_NAME {}} {REL_SEGMENT {}} {REL_SIDE two} {REQUIRED_REL_SEGMENT {}} {CONTEXT_ID null} {CREATION_USER null} {CREATION_IP null}
    foreach var [list CONSTRAINT_ID CONSTRAINT_TYPE CONSTRAINT_NAME REL_SEGMENT REL_SIDE REQUIRED_REL_SEGMENT CONTEXT_ID CREATION_USER CREATION_IP]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select rel_constraint__new($_CONSTRAINT_ID$_CONSTRAINT_TYPE$_CONSTRAINT_NAME$_REL_SEGMENT$_REL_SIDE$_REQUIRED_REL_SEGMENT$_CONTEXT_ID$_CREATION_USER$_CREATION_IP) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • violation (scripted, public)

     xo::db::sql::rel_constraint[i] violation [ -dbn dbn ] -rel_id rel_id 

    Automatically generated method

    Switches:
    -dbn (optional)
    -rel_id (required)

    Testcases:
    No testcase defined.
    #function_args: {REL_ID {}}
    foreach var [list REL_ID]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select rel_constraint__violation($_REL_ID) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • violation_if_re (scripted, public)

     xo::db::sql::rel_constraint[i] violation_if_re [ -dbn dbn ] \
        -rel_id rel_id 

    Automatically generated method

    Switches:
    -dbn (optional)
    -rel_id (required)

    Testcases:
    No testcase defined.
    #function_args: {REL_ID {}}
    foreach var [list REL_ID]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select rel_constraint__violation_if_re($_REL_ID) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • violation_if_removed (scripted, public)

     xo::db::sql::rel_constraint[i] violation_if_removed [ -dbn dbn ] \
        -rel_id rel_id 

    Automatically generated method

    Switches:
    -dbn (optional)
    -rel_id (required)

    Testcases:
    No testcase defined.
    #function_args: {REL_ID {}}
    foreach var [list REL_ID]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select rel_constraint__violation_if_removed($_REL_ID) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }