- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::db::sql::util
::xo::db::sql::util create ...
Defined in
Class Relations
::xo::db::Class create ::xo::db::sql::util \ -superclass ::xotcl::ObjectMethods (to be applied on the object)
computehash (scripted, public)
xo::db::sql::util computehash [ -dbn dbn ] -value valueAutomatically generated method
- Switches:
- -dbn (optional)
- -value (required)
- Testcases:
- No testcase defined.
#function_args: {VALUE {}} foreach var [list VALUE] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__computehash($_VALUE) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }computehash_raw (scripted, public)
xo::db::sql::util computehash_raw [ -dbn dbn ] -arg argAutomatically generated method
- Switches:
- -dbn (optional)
- -arg (required)
- Testcases:
- No testcase defined.
#function_args: {ARG {}} foreach var [list ARG] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__computehash_raw($_ARG) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }foreign_key_exists (scripted, public)
xo::db::sql::util foreign_key_exists [ -dbn dbn ] \ -table_name table_name -column column -reftable reftable \ -refcolumn refcolumnAutomatically generated method
- Switches:
- -dbn (optional)
- -table_name (required)
- -column (required)
- -reftable (required)
- -refcolumn (required)
- Testcases:
- No testcase defined.
#function_args: {TABLE_NAME {}} {COLUMN {}} {REFTABLE {}} {REFCOLUMN {}} foreach var [list TABLE_NAME COLUMN REFTABLE REFCOLUMN] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__foreign_key_exists($_TABLE_NAME, $_COLUMN, $_REFTABLE, $_REFCOLUMN) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }get_default (scripted, public)
xo::db::sql::util get_default [ -dbn dbn ] -table_name table_name \ -column columnAutomatically generated method
- Switches:
- -dbn (optional)
- -table_name (required)
- -column (required)
- Testcases:
- No testcase defined.
#function_args: {TABLE_NAME {}} {COLUMN {}} foreach var [list TABLE_NAME COLUMN] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__get_default($_TABLE_NAME, $_COLUMN) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }get_primary_keys (scripted, public)
xo::db::sql::util get_primary_keys [ -dbn dbn ] \ -table_name table_nameAutomatically generated method
- Switches:
- -dbn (optional)
- -table_name (required)
- Testcases:
- No testcase defined.
#function_args: {TABLE_NAME {}} foreach var [list TABLE_NAME] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__get_primary_keys($_TABLE_NAME) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }index_exists (scripted, public)
xo::db::sql::util index_exists [ -dbn dbn ] -name nameAutomatically generated method
- Switches:
- -dbn (optional)
- -name (required)
- Testcases:
- No testcase defined.
#function_args: {NAME {}} foreach var [list NAME] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__index_exists($_NAME) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }logical_negation (scripted, public)
xo::db::sql::util logical_negation [ -dbn dbn ] \ -true_or_false true_or_falseAutomatically generated method
- Switches:
- -dbn (optional)
- -true_or_false (required)
- Testcases:
- No testcase defined.
#function_args: {TRUE_OR_FALSE {}} foreach var [list TRUE_OR_FALSE] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__logical_negation($_TRUE_OR_FALSE) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }multiple_nextval (scripted, public)
xo::db::sql::util multiple_nextval [ -dbn dbn ] \ -v_sequence_name v_sequence_name -v_count v_countAutomatically generated method
- Switches:
- -dbn (optional)
- -v_sequence_name (required)
- -v_count (required)
- Testcases:
- No testcase defined.
#function_args: {V_SEQUENCE_NAME {}} {V_COUNT {}} foreach var [list V_SEQUENCE_NAME V_COUNT] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__multiple_nextval($_V_SEQUENCE_NAME, $_V_COUNT) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }not_null_exists (scripted, public)
xo::db::sql::util not_null_exists [ -dbn dbn ] -table_name table_name \ -column columnAutomatically generated method
- Switches:
- -dbn (optional)
- -table_name (required)
- -column (required)
- Testcases:
- No testcase defined.
#function_args: {TABLE_NAME {}} {COLUMN {}} foreach var [list TABLE_NAME COLUMN] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__not_null_exists($_TABLE_NAME, $_COLUMN) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }primary_key_exists (scripted, public)
xo::db::sql::util primary_key_exists [ -dbn dbn ] \ -table_name table_name -column column [ -single_p single_p ]Automatically generated method
- Switches:
- -dbn (optional)
- -table_name (required)
- -column (required)
- -single_p (optional, defaults to
"true"
)- Testcases:
- No testcase defined.
#function_args: {TABLE_NAME {}} {COLUMN {}} {SINGLE_P true} foreach var [list TABLE_NAME COLUMN SINGLE_P] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__primary_key_exists($_TABLE_NAME, $_COLUMN, $_SINGLE_P) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }table_column_exists (scripted, public)
xo::db::sql::util table_column_exists [ -dbn dbn ] \ -table_name table_name -column columnAutomatically generated method
- Switches:
- -dbn (optional)
- -table_name (required)
- -column (required)
- Testcases:
- No testcase defined.
#function_args: {TABLE_NAME {}} {COLUMN {}} foreach var [list TABLE_NAME COLUMN] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__table_column_exists($_TABLE_NAME, $_COLUMN) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }table_exists (scripted, public)
xo::db::sql::util table_exists [ -dbn dbn ] -name nameAutomatically generated method
- Switches:
- -dbn (optional)
- -name (required)
- Testcases:
- No testcase defined.
#function_args: {NAME {}} foreach var [list NAME] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__table_exists($_NAME) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }unique_exists (scripted, public)
xo::db::sql::util unique_exists [ -dbn dbn ] -table table \ -column column [ -single_p single_p ]Automatically generated method
- Switches:
- -dbn (optional)
- -table (required)
- -column (required)
- -single_p (optional, defaults to
"true"
)- Testcases:
- No testcase defined.
#function_args: {TABLE {}} {COLUMN {}} {SINGLE_P true} foreach var [list TABLE COLUMN SINGLE_P] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__unique_exists($_TABLE, $_COLUMN, $_SINGLE_P) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }view_exists (scripted, public)
xo::db::sql::util view_exists [ -dbn dbn ] -name nameAutomatically generated method
- Switches:
- -dbn (optional)
- -name (required)
- Testcases:
- No testcase defined.
#function_args: {NAME {}} foreach var [list NAME] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select util__view_exists($_NAME) " db_with_handle -dbn $dbn db { #ns_log notice "--sql=$sql" return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ] }
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables