xo::db::postgresql instproc get_all_package_functions

 <instance of xo::db::postgresql[i]> get_all_package_functions

Defined in

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

Testcases:
xotcl_core_tutorial_2, xotcl-core
Source code:
#
# Load definitions in one step from function args; only for
# those definitions where we do not have function args, we parse
# the function arg aliases.
#
set definitions [::xo::dc list_of_lists get_all_package_functions0 {
  select
  args.function,
  args.arg_name,
  args.arg_default
  from acs_function_args args
  order by function, arg_seq
}]
set last_function ""
set function_args {}
foreach definition $definitions {
  lassign $definition function arg_name default
  if {$last_function ne "" && $last_function ne $function} {
    set ::xo::db::fnargs($last_function$function_args
    #puts stderr "$last_function [list $function_args]"
    set function_args {}
  }
  lappend function_args [list $arg_name $default]
  set last_function $function
}
set ::xo::db::fnargs($last_function$function_args
#puts stderr "$last_function [list $function_args]"
ns_log notice "loaded [array size ::xo::db::fnargs] definitions from function args"
#ns_log notice "... [lsort [array names ::xo::db::fnargs *__*]]"

#
# Get all package functions (package name, object name) from PostgreSQL
# system catalogs.
#
return [::xo::dc list_of_lists [self proc] {
  select distinct
  upper(substring(proname from 0 for position('__' in proname))) as package_name,
  upper(substring(proname from position('__' in proname)+2)) as object_name
  from pg_proc
  where strpos(proname,'__') > 1
}]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: