Class ::xo::db::sql::timespan

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

Class Relations

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

Methods (to be applied on the object)

  • copy (scripted, public)

     xo::db::sql::timespan[i] copy [ -dbn dbn ] -timespan_id timespan_id  \
        -offset offset 

    Automatically generated method

    Switches:
    -dbn (optional)
    -timespan_id (required)
    -offset (required)

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

     xo::db::sql::timespan[i] delete [ -dbn dbn ] -timespan_id timespan_id 

    Automatically generated method

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

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

     xo::db::sql::timespan[i] exists_p [ -dbn dbn ] -timespan_id timespan_id 

    Automatically generated method

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

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

     xo::db::sql::timespan[i] interval_delete [ -dbn dbn ] \
        -timespan_id timespan_id  -interval_id interval_id 

    Automatically generated method

    Switches:
    -dbn (optional)
    -timespan_id (required)
    -interval_id (required)

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

     xo::db::sql::timespan[i] join [ -dbn dbn ] -timespan_id timespan_id  \
        [ -start_date start_date ] [ -end_date end_date ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -timespan_id (required)
    -start_date (optional)
    -end_date (optional)

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

     xo::db::sql::timespan[i] join_interval [ -dbn dbn ] \
        -timespan_id timespan_id  -interval_id interval_id  \
        [ -copy_p copy_p ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -timespan_id (required)
    -interval_id (required)
    -copy_p (optional, defaults to "true")

    Testcases:
    No testcase defined.
    #function_args: {TIMESPAN_ID {}} {INTERVAL_ID {}} {COPY_P true}
    foreach var [list TIMESPAN_ID INTERVAL_ID COPY_P]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select timespan__join_interval($_TIMESPAN_ID$_INTERVAL_ID$_COPY_P) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • multi_interval_p (scripted, public)

     xo::db::sql::timespan[i] multi_interval_p [ -dbn dbn ] \
        -timespan_id timespan_id 

    Automatically generated method

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

    Testcases:
    No testcase defined.
    #function_args: {TIMESPAN_ID {}}
    foreach var [list TIMESPAN_ID]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select timespan__multi_interval_p($_TIMESPAN_ID) 
        "
    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::timespan[i] new [ -dbn dbn ] [ -start_date start_date ] \
        [ -end_date end_date ] [ -childof childof ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -start_date (optional)
    -end_date (optional)
    -childof (optional)

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

     xo::db::sql::timespan[i] overlaps_interval_p [ -dbn dbn ] \
        -timespan_id timespan_id  [ -interval_id interval_id ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -timespan_id (required)
    -interval_id (optional)

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

     xo::db::sql::timespan[i] overlaps_p [ -dbn dbn ] \
        -timespan_id timespan_id  [ -start_date start_date ] \
        [ -end_date end_date ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -timespan_id (required)
    -start_date (optional)
    -end_date (optional)

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