%3 ::xo::db::DB-oracle ::xo::db::DB-oracle ::xo::db::DB ::xo::db::DB transaction ::xo::db::DB-oracle->::xo::db::DB ::xo::db::oracle ::xo::db::oracle ::xo::db::DB-oracle->::xo::db::oracle ::xo::db::DB-postgresql ::xo::db::DB-postgresql 0or1row 1row dml generate_psql get_value insert-view-operation list list_of_lists row_lock ::xo::db::DB-postgresql->::xo::db::DB ::xo::db::postgresql ::xo::db::postgresql ::xo::db::DB-postgresql->::xo::db::postgresql ::xo::db::DBI-postgresql ::xo::db::DBI-postgresql ::xo::db::DBI-postgresql->::xo::db::postgresql ::xo::db::DBI ::xo::db::DBI ::xo::db::DBI-postgresql->::xo::db::DBI ::xo::db::Driver ::xo::db::Driver ::xo::db::DB->::xo::db::Driver ::xotcl::Object ::xotcl::Object ::xo::db::Driver->::xotcl::Object

Class ::xo::db::DB-postgresql

::xo::db::DB-postgresql[i] create ...

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xo::db::DB[i], ::xo::db::postgresql[i]
::xotcl::Class create ::xo::db::DB-postgresql \
     -superclass {::xo::db::DB ::xo::db::postgresql}

Methods (to be applied on instances)

  • 0or1row (scripted)

     <instance of xo::db::DB-postgresql[i]> 0or1row

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::DB-postgresql instproc 0or1row xo::db::DB-postgresql instproc 0or1row test_test_cr_items->xo::db::DB-postgresql instproc 0or1row test_test_xo_db_object test_xo_db_object (test ) test_test_xo_db_object->xo::db::DB-postgresql instproc 0or1row test_xotcl-core xotcl-core (test ) test_xotcl-core->xo::db::DB-postgresql instproc 0or1row test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::db::DB-postgresql instproc 0or1row

    Testcases:
    test_xo_db_object, xotcl-core, test_cr_items, xowiki_test_cases
    if {$sql eq ""} {set sql [:get_sql $qn]}
    set prepOpt [expr {[info exists prepare] ? [list -prepare $prepare] : ""}]
    set answers [uplevel [list [self] exec_0or1row {*}$prepOpt -bind $bind $sql]]
    if {$answers ne ""} {
      foreach {att val} [ns_set array $answers] { uplevel [list set $att $val] }
      ns_set free $answers
      return 1
    }
    return 0
  • 1row (scripted)

     <instance of xo::db::DB-postgresql[i]> 1row

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::DB-postgresql instproc 1row xo::db::DB-postgresql instproc 1row test_test_cr_items->xo::db::DB-postgresql instproc 1row test_test_xo_db_object test_xo_db_object (test xotcl-core) test_test_xo_db_object->xo::db::DB-postgresql instproc 1row test_xotcl-core xotcl-core (test ) test_xotcl-core->xo::db::DB-postgresql instproc 1row test_xotcl_core_tutorial_3 xotcl_core_tutorial_3 (test ) test_xotcl_core_tutorial_3->xo::db::DB-postgresql instproc 1row

    Testcases:
    xotcl_core_tutorial_3, xotcl-core, test_xo_db_object, test_cr_items
    if {$sql eq ""} {set sql [:get_sql $qn]}
    set prepOpt [expr {[info exists prepare] ? [list -prepare $prepare] : ""}]
    set answers [uplevel [list [self] exec_0or1row {*}$prepOpt -bind $bind $sql]]
    if {$answers ne ""} {
      foreach {att val} [ns_set array $answers] { uplevel [list set $att $val] }
      ns_set free $answers
      return 1
    }
    error "query $sql did not return an answer"
  • dml (scripted)

     <instance of xo::db::DB-postgresql[i]> dml

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_slot_interactions slot_interactions (test xowiki) xo::db::DB-postgresql instproc dml xo::db::DB-postgresql instproc dml test_slot_interactions->xo::db::DB-postgresql instproc dml test_test_cr_items test_cr_items (test xotcl-core) test_test_cr_items->xo::db::DB-postgresql instproc dml test_xotcl-core xotcl-core (test ) test_xotcl-core->xo::db::DB-postgresql instproc dml test_xotcl_core_tutorial_2 xotcl_core_tutorial_2 (test ) test_xotcl_core_tutorial_2->xo::db::DB-postgresql instproc dml test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) test_xotcl_core_tutorial_4->xo::db::DB-postgresql instproc dml db_exec db_exec (public) xo::db::DB-postgresql instproc dml->db_exec db_resultrows db_resultrows (public) xo::db::DB-postgresql instproc dml->db_resultrows db_with_handle db_with_handle (public) xo::db::DB-postgresql instproc dml->db_with_handle

    Testcases:
    xotcl_core_tutorial_2, xotcl-core, xotcl_core_tutorial_4, test_cr_items, xowiki_test_cases, slot_interactions
    if {$sql eq ""} {set sql [:get_sql $qn]}
    if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""}
    set bind $bindOpt
    db_with_handle -dbn $dbn db {
      if {[info exists prepare]} {set sql [:prepare -handle $db -argtypes $prepare $sql]}
      ::db_exec dml $db [uplevel [list [self] qn $qn]] $sql 2
    }
    return [db_resultrows]
  • generate_psql (scripted)

     <instance of xo::db::DB-postgresql[i]> generate_psql

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_xotcl-core xotcl-core (test ) xo::db::DB-postgresql instproc generate_psql xo::db::DB-postgresql instproc generate_psql test_xotcl-core->xo::db::DB-postgresql instproc generate_psql test_xotcl_core_tutorial_2 xotcl_core_tutorial_2 (test ) test_xotcl_core_tutorial_2->xo::db::DB-postgresql instproc generate_psql db_with_handle db_with_handle (public) xo::db::DB-postgresql instproc generate_psql->db_with_handle

    Testcases:
    xotcl_core_tutorial_2, xotcl-core
    set function_args [:get_function_args $package_name $object_name]
    set function_args [:fix_function_args $function_args $package_name $object_name]
    set sql_info [:sql_arg_info $function_args $package_name $object_name]
    #ns_log notice "-- select ${package_name}__${object_name} ($psql_args)"
    set sql_suffix [:psql_statement_suffix ${package_name} ${object_name}]
    set sql [subst {
      select ${package_name}__${object_name}([dict get $sql_info psql_args]) $sql_suffix
    }]
    set sql_cmd {ns_set value [ns_pg_bind 0or1row $db $sql] 0}
    dict set sql_info body [subst {
      #function_args: $function_args
      foreach var \[list [dict get $sql_info arg_order]\]  {
        set varname \[string tolower \$var\]
        if {\[info exists \$varname\]} {
          set \$var \[set \$varname\]
          set _\$var :\$var
        } else {
          set _\$var null
        }
      }
      set sql "$sql"
      db_with_handle -dbn \$dbn db {
        #ns_log notice "--sql=\$sql"
        return \[ $sql_cmd \]
      }
    }]
    return $sql_info
  • get_value (scripted)

     <instance of xo::db::DB-postgresql[i]> get_value

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_path_resolve path_resolve (test xowiki) xo::db::DB-postgresql instproc get_value xo::db::DB-postgresql instproc get_value test_path_resolve->xo::db::DB-postgresql instproc get_value test_test_cr_items test_cr_items (test xotcl-core) test_test_cr_items->xo::db::DB-postgresql instproc get_value test_test_xo_db_object test_xo_db_object (test xotcl-core) test_test_xo_db_object->xo::db::DB-postgresql instproc get_value test_xotcl-core xotcl-core (test ) test_xotcl-core->xo::db::DB-postgresql instproc get_value test_xotcl_core_tutorial_1 xotcl_core_tutorial_1 (test ) test_xotcl_core_tutorial_1->xo::db::DB-postgresql instproc get_value

    Testcases:
    xotcl_core_tutorial_1, xotcl-core, xotcl_core_tutorial_2, xotcl_core_tutorial_4, test_xo_db_object, test_cr_items, xowiki_test_cases, path_resolve
    if {$sql eq ""} {set sql [:get_sql $qn]}
    set prepOpt [expr {[info exists prepare] ? [list -prepare $prepare] : ""}]
    set answers [uplevel [list [self] exec_0or1row {*}$prepOpt -bind $bind $sql]]
    if {$answers ne ""} {
      set result [ns_set value $answers 0]
      ns_set free $answers
      return $result
    }
    return $default
  • insert-view-operation (scripted)

     <instance of xo::db::DB-postgresql[i]> insert-view-operation

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::DB-postgresql instproc insert-view-operation xo::db::DB-postgresql instproc insert-view-operation test_test_cr_items->xo::db::DB-postgresql instproc insert-view-operation test_xotcl-core xotcl-core (test ) test_xotcl-core->xo::db::DB-postgresql instproc insert-view-operation test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test ) test_xotcl_core_tutorial_4->xo::db::DB-postgresql instproc insert-view-operation

    Testcases:
    xotcl_core_tutorial_4, xotcl-core, test_cr_items
    return 0or1row
  • list (scripted)

     <instance of xo::db::DB-postgresql[i]> list

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_xotcl-core xotcl-core (test ) xo::db::DB-postgresql instproc list xo::db::DB-postgresql instproc list test_xotcl-core->xo::db::DB-postgresql instproc list test_xotcl_core_tutorial_2 xotcl_core_tutorial_2 (test ) test_xotcl_core_tutorial_2->xo::db::DB-postgresql instproc list test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::db::DB-postgresql instproc list db_getrow db_getrow (private) xo::db::DB-postgresql instproc list->db_getrow db_with_handle db_with_handle (public) xo::db::DB-postgresql instproc list->db_with_handle

    Testcases:
    xotcl_core_tutorial_2, xotcl-core, xowiki_test_cases
    if {$sql eq ""} {set sql [:get_sql $qn]}
    if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""}
    db_with_handle db {
      if {[info exists prepare]} {set sql [:prepare -handle $db -argtypes $prepare $sql]}
      set result {}
      set answers [uplevel [list ns_pg_bind select $db {*}$bindOpt $sql]]
      while { [::db_getrow $db $answers] } {
        lappend result [ns_set value $answers 0]
      }
      ns_set free $answers
    }
    return $result
  • list_of_lists (scripted)

     <instance of xo::db::DB-postgresql[i]> list_of_lists

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_xotcl-core xotcl-core (test ) xo::db::DB-postgresql instproc list_of_lists xo::db::DB-postgresql instproc list_of_lists test_xotcl-core->xo::db::DB-postgresql instproc list_of_lists test_xotcl_core_tutorial_2 xotcl_core_tutorial_2 (test ) test_xotcl_core_tutorial_2->xo::db::DB-postgresql instproc list_of_lists test_xotcl_core_tutorial_3 xotcl_core_tutorial_3 (test xotcl-core) test_xotcl_core_tutorial_3->xo::db::DB-postgresql instproc list_of_lists acs::icanuse acs::icanuse (public) xo::db::DB-postgresql instproc list_of_lists->acs::icanuse db_getrow db_getrow (private) xo::db::DB-postgresql instproc list_of_lists->db_getrow db_with_handle db_with_handle (public) xo::db::DB-postgresql instproc list_of_lists->db_with_handle

    Testcases:
    xotcl_core_tutorial_2, xotcl-core, xotcl_core_tutorial_3
    if {$sql eq ""} {set sql [:get_sql $qn]}
    if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""}
    db_with_handle db {
      if {[info exists prepare]} {set sql [:prepare -handle $db -argtypes $prepare $sql]}
      set result {}
      set answers [uplevel [list ns_pg_bind select $db {*}$bindOpt $sql]]
      if {$with_headers} {
        if {[acs::icanuse "ns_set keys"]} {
          set headers [ns_set keys $answers]
        } else {
          set headers [dict keys [ns_set array $answers]]
        }
        set result [list $headers]
      }
      while { [db_getrow $db $answers] } {
        set row [list]
        foreach {att value} [ns_set array $answers] {lappend row $value}
        lappend result $row
      }
      ns_set free $answers
    }
    return $result
  • row_lock (scripted)

     <instance of xo::db::DB-postgresql[i]> row_lock

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::DB-postgresql instproc row_lock xo::db::DB-postgresql instproc row_lock test_test_cr_items->xo::db::DB-postgresql instproc row_lock test_xotcl-core xotcl-core (test ) test_xotcl-core->xo::db::DB-postgresql instproc row_lock test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test ) test_xotcl_core_tutorial_4->xo::db::DB-postgresql instproc row_lock

    Testcases:
    xotcl_core_tutorial_4, xotcl-core, test_cr_items
    set prepareOpt [expr {[info exists prepare] ? [list -prepare $prepare] : ""}]
    :uplevel [list ::xo::dc list -dbn $dbn -bind $bind {*}$prepareOpt $qn "$sql FOR $for"]