- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::db::DB
::xo::db::DB create ...
Defined in
Class Relations
- class: ::xotcl::Class
- superclass: ::xo::db::Driver
- subclass: ::xo::db::DB-oracle, ::xo::db::DB-postgresql
::xotcl::Class create ::xo::db::DB \ -superclass ::xo::db::DriverMethods (to be applied on instances)
0or1row (scripted)
if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} uplevel [list ::db_0or1row [uplevel [list [self] qn $qn]] $sql {*}$bindOpt]1row (scripted)
if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} uplevel [list ::db_1row [uplevel [list [self] qn $qn]] $sql {*}$bindOpt]dml (scripted)
if {$sql eq ""} {set sql [:get_sql $qn]} if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} if {$blobs ne ""} {lappend bindOpt -blobs $blobs} if {$clobs ne ""} {lappend bindOpt -clobs $clobs} uplevel [list ::db_dml [uplevel [list [self] qn $qn]] $sql {*}$bindOpt] return [db_resultrows]exec_0or1row (scripted)
# Helper, used from several postgres-specific one-tuple queries if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} ::db_with_handle -dbn [:map_default_dbn $dbn] h { if {[info exists prepare]} {set sql [:prepare -handle $h -argtypes $prepare $sql]} return [uplevel [list ns_pg_bind 0or1row $h {*}$bindOpt $sql]] }foreach (scripted)
#if {$sql eq ""} {set sql [:get_sql $qn]} if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} set qn [uplevel [list [self] qn $qn]] # # The prepare statement in the next line works probably only with # inline SQL statements. # #if {[info exists prepare]} {set sql [:prepare -dbn $dbn -argtypes $prepare $sql]} #ns_log notice "### [list ::db_foreach -dbn $dbn $qn $sql $body {*}$bindOpt]" uplevel [list ::db_foreach -dbn $dbn $qn $sql $body {*}$bindOpt]get_value (scripted)
if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} uplevel [list ::db_string -dbn $dbn [uplevel [list [self] qn $qn]] $sql -default $default {*}$bindOpt]list (scripted)
if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} uplevel [list ::db_list -dbn $dbn [uplevel [list [self] qn $qn]] $sql {*}$bindOpt]list_of_lists (scripted)
if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} set with_headers [expr {$with_headers ? "-with_headers" : ""}] uplevel [list ::db_list_of_lists -dbn $dbn {*}$with_headers [uplevel [list [self] qn $qn]] $sql {*}$bindOpt]multirow (scripted)
if {$bind ne ""} {set bindOpt [list -bind $bind]} {set bindOpt ""} set qn [uplevel [list [self] qn $qn]] set local [expr {$local ? "-local" : ""}] uplevel [list ::db_multirow -dbn $dbn {*}$local -append -upvar_level $upvar_level -extend $extend $var_name $qn $sql $body {*}$bindOpt]prepare (scripted)
return $sqlprofile (scripted)
# built-in
psql_statement_suffix (scripted)
set key ::xo::db::sql_suffix(${:dialect},$package_name,$object_name) return [expr {[info exists $key] ? [set $key] : ""}]row_lock (scripted)
# # PostgreSQL has several variants of row-level lock modes (the # "for" part), but other database systems just support only "FOR # UPDATE", which should work always. Therefore, ignore for other # DB-systems the specified value and use just "FOR UPDATE". # :uplevel [list ::xo::dc list -dbn $dbn -bind $bind $qn "$sql FOR UPDATE"]transaction (scripted)
<instance of xo::db::DB> transactionreturn [:uplevel [list ::db_transaction -dbn $dbn $script {*}$args]]
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables