Class ::xo::db::SQL (public)
::xotcl::Class ::xo::db::SQL![[i]](/resources/acs-subsite/ZoomIn16.gif)
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db {}
::nsf::object::alloc ::xotcl::Class ::xo::db::SQL {set :__default_metaclass ::xotcl::Class
set :__default_superclass ::xotcl::Object
array set :fallback_defaults {content_type__drop_type {
DROP_CHILDREN_P f DROP_TABLE_P f DROP_OBJECTS_P f
} content_item__new {
RELATION_TAG null DESCRIPTION null TEXT null
CREATION_IP null NLS_LANGUAGE null LOCALE null CONTEXT_ID null
DATA null TITLE null ITEM_ID null
CREATION_DATE now
ITEM_SUBTYPE content_item
CONTENT_TYPE content_revision
MIME_TYPE text/plain
IS_LIVE f
STORAGE_TYPE lob
} content_type__create_attribute {
DEFAULT_VALUE null SORT_ORDER null PRETTY_PLURAL null
} acs_object_type__create_type {
TYPE_EXTENSION_TABLE null NAME_METHOD null
} acs_attribute__create_attribute {
PRETTY_PLURAL null TABLE_NAME null COLUMN_NAME null
DEFAULT_VALUE null SORT_ORDER null DATABASE_TYPE null SIZE null
REFERENCES null CHECK_EXPR null COLUMN_SPEC null
}}}
::xo::db::SQL instproc select type {
if {![::xotcl::self isnextcall]} {
error "Abstract method select type called"
} else {::xotcl::next}
}
::xo::db::SQL instproc datatype_constraint {type table att} {return ""}
::xo::db::SQL instproc fix_function_args {function_args package_name object_name} {
if {![::xo::db::SQL exists fallback_defaults(${package_name}__$object_name)]} {
return $function_args
}
array set additional_defaults [::xo::db::SQL set fallback_defaults(${package_name}__$object_name)]
set result {}
foreach arg $function_args {
lassign $arg arg_name default_value
if {$default_value eq "" && [info exists additional_defaults($arg_name)]} {
lappend result [list $arg_name $additional_defaults($arg_name)]
} else {
lappend result [list $arg_name $default_value]
}
}
return $result
}
::xo::db::SQL instproc date_trunc type {
if {![::xotcl::self isnextcall]} {
error "Abstract method date_trunc type called"
} else {::xotcl::next}
}
::xo::db::SQL instproc map_datatype type {
return [::xo::dc get_value map "
select database_type from acs_datatypes
where datatype = :type" $type]
}
::xo::db::SQL instproc map_function_name sql {return $sql}
::xo::db::SQL instproc sql_arg_info {function_args package_name object_name} {
set defined {}
set psql_args [list]
set arg_order [list]
foreach arg $function_args {
lassign $arg arg_name default_value
lappend psql_args \$_$arg_name
lappend arg_order $arg_name
lappend defined $arg_name $default_value
}
return [list psql_args [join $psql_args ", "] arg_order $arg_order defined $defined function_args $function_args]
}
::xo::db::SQL instproc since_interval_condition {var interval} {
set since '[clock format [clock scan "-$interval"] -format "%Y-%m-%d %T"]'
return "$var > TO_TIMESTAMP($since,'YYYY-MM-DD HH24:MI:SS')"
}
::xo::db::SQL instproc interval interval {
return [clock format [clock scan "-$interval"] -format "%Y-%m-%d %T"]
}
::xo::db::SQL instproc date_trunc_expression type {
if {![::xotcl::self isnextcall]} {
error "Abstract method date_trunc_expression type called"
} else {::xotcl::next}
}
::xo::db::SQL instproc has_hstore {} {return 0}
::xo::db::SQL instproc mk_sql_constraint_name {table att suffix} {
return ${table}_${att}_$suffix
}
::xo::db::SQL instproc has_ltree {} {return 0}
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]