Class ::acs::db::nsdb

::acs::db::nsdb[i] create ... \
           [ -backend backend ] \
           [ -dbn (default "") ] \
           [ -driver driver ]

Database interface based on the nsdb driver of NaviServer
Defined in packages/acs-tcl/tcl/acs-db-00-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::acs::db::Driver[i]
  • subclass: ::acs::db::nsdb-postgresql[i], ::acs::db::nsdb-oracle[i]
::nx::Class create ::acs::db::nsdb \
     -superclass ::acs::db::Driver

Methods (to be applied on instances)

  • list (scripted, public)

     <instance of acs::db::nsdb[i]> list [ -dbn dbn ] [ -bind bind ] \
        [ -prepare prepare ] qn sql

    Return a Tcl list, where each element contains just the first the column values of the tuples returned by the provided SQL query.

    Switches:
    -dbn (optional)
    database identifier
    -bind (optional)
    optional bind variables for the SQL query
    -prepare (optional)
    type information for the bind variables in the prepared statement
    Parameters:
    qn (required)
    name of the SQL query
    sql (required)
    SQL query

    Testcases:
    No testcase defined.
    set bindOpt [expr {$bind ne "" ? [list -bind $bind] : ""}]
    if {$sql eq ""} {
        set qn [uplevel [list [self] qn $qn]]
    }
    uplevel [list ::db_list -dbn [:map_default_dbn $dbn$qn $sql {*}$bindOpt]
  • list_of_lists (scripted, public)

     <instance of acs::db::nsdb[i]> list_of_lists [ -dbn dbn ] \
        [ -bind bind ] [ -prepare prepare ] qn sql

    Return a Tcl list, where each element consists of a list of the column values corresponding to the values of the tuples returned by the provided SQL query.

    Switches:
    -dbn (optional)
    database identifier
    -bind (optional)
    optional bind variables for the SQL query
    -prepare (optional)
    type information for the bind variables in the prepared statement
    Parameters:
    qn (required)
    name of the SQL query
    sql (required)
    SQL query

    Testcases:
    No testcase defined.
    set bindOpt [expr {$bind ne "" ? [list -bind $bind] : ""}]
    if {$sql eq ""} {
        set qn [uplevel [list [self] qn $qn]]
    }
    return [:uplevel [list ::db_list_of_lists -dbn [:map_default_dbn $dbn$qn $sql {*}$bindOpt]]