Routines
Name | Type | Language | Deterministic | Return Type | Security Restriction | Comments |
---|---|---|---|---|---|---|
generate_comments_apiview_column(p_view_config ms_syst_priv.comments_config_apiview, p_column_config ms_syst_priv.comments_config_apiview_column) | FUNCTION | plpgsql | false | void | INVOKER | Generates API View Column comments based on the passed comment configurations. Parameters
General Usage While optional, if the targeted API View Column is identified as being closely related to an underlying Data Table Column, this function will attempt to extract descriptive texts from the Data Table Column comments so that these descriptions don’t need to be duplicated manually for the API View; this behavior may be overridden in the passed comment configuration. |
generate_comments_table_column(p_table_schema text, p_table_name text, p_comments_config ms_syst_priv.comments_config_table_column) | FUNCTION | plpgsql | false | void | INVOKER | Generates table column comments in a standardized format. The comments themselves are defined using a configuration type containing the column documentation and comment related configurations. Parameters
|
initialize_enum(IN p_enum_def jsonb) | PROCEDURE | plpgsql | false | INVOKER | Based on a specially formatted JSON object passed as a parameter, this function will create a new enumeration along with its optional functional types and starting value records. |
|
nonstandard_decode(p_base integer, p_tokens text, p_value text) | FUNCTION | plpgsql | true | bigint | INVOKER | Performs a decode to decimal operation, similar to the standard decode function, but for non-standard decoding schemes such as Base32 or Base36. Parameters
|
get_applied_network_rule(p_host_addr inet, p_instance_id uuid DEFAULT NULL::uuid, p_instance_owner_id uuid DEFAULT NULL::uuid) | FUNCTION | sql | false | TABLE(precedence text, network_rule_id uuid, functional_type text, ip_host_or_network inet, ip_host_range_lower inet, ip_host_range_upper inet) | INVOKER | Applies all of the applicable network rules for a host and returns the governing record for the identified host. The returned rule is chosen by identifying which rules apply to the host based on the provided Instance related parameters and then limiting the return to the rule with the highest precedence. Currently the precedence is defined as:
Parameters
General Usage This function returns the best matching rule for the provided parameters. This means that when Providing only |
generate_comments_apiview_common_columns(p_view_config ms_syst_priv.comments_config_apiview) | FUNCTION | plpgsql | false | void | INVOKER | Provides boilerplate API View Column comment configurations and generates the comments for columns which appear in many places across the applications and where standardized descriptions are likely to apply. Parameters
General Usage This function expects that a there is a closely associated Data Table defined. The Data Table columns provide the descriptive texts for the related API View columns. If the API View is not closely associated with an underlying Data Table, common columns should be configured manually as regular API View Columns and passed directly to either |
decode_base36(p_value text) | FUNCTION | plpgsql | true | bigint | INVOKER | Decodes integers represented in Base36 notation back to decimal form. Parameters
|
generate_comments_copy_function(p_source_schema text, p_source_name text, p_target_schema text, p_target_name text, p_supplemental text DEFAULT NULL::text) | FUNCTION | plpgsql | false | void | INVOKER | Copies the comments of a source function to be the comments of a different target function. Parameters
General Usage The use case for this function is many Public API functions are just wrappers exposing functions defined in the private logic. In these cases the private function logic will generally apply to the Public API wrapper and the private function can serve as a single source of the documentation. Note that this function current doesn’t work with overloaded functions. |
is_parent_record_referenced(p_table_schema text, p_table_name text, p_parent_record_id uuid, p_excluded_relations regclass[] DEFAULT '{}'::regclass[]) | FUNCTION | plpgsql | false | boolean | INVOKER | Tests if a specific parent record is referenced in a foreign key relationship. Parameters
General Usage The parent table is identified by the On execution, the function will then look up all relations (children) with foreign key references to the parent table and its There are several assumptions to be aware of when making use of this function. The function assumes that any foreign key reference to the parent relation is a simple, single column relationship to the parent relation’s |
generate_comments_table_common_columns(p_table_schema text, p_table_name text) | FUNCTION | plpgsql | false | void | INVOKER | Provides boilerplate column comment configurations for columns which are common to many columns and applies these comment configurations to any table columns which are found to be in the set of common columns. Parameters
General Usage Note that if there are customizations or overrides desired when documenting these common columns for a given table, such overrides should appear in the columns list passed to |
trig_b_iu_set_diagnostic_columns() | FUNCTION | plpgsql | false | trigger | INVOKER | Automatically maintains the common table diagnostic columns whenever data is inserted or updated. Trigger Function Details:
General Usage For To use this trigger, the targeted table must have the following columns / types defined:
|
generate_comments_table(p_comments_config ms_syst_priv.comments_config_table) | FUNCTION | plpgsql | false | void | INVOKER | Generates table comments, and optionally associated column comments, in a standardized format. Parameters
General Usage The comments themselves are defined using an object of type |
encode_base36(p_value bigint) | FUNCTION | sql | true | text | INVOKER | Encodes integers into a Base36 representation. Parameters
|
trig_a_iu_enum_item_check() | FUNCTION | plpgsql | false | trigger | INVOKER | A constraint trigger function to provide foreign key like validation of columns which reference syst_enum_items. Trigger Function Details:
Parameters
General Usage This relationship requires the additional check that only values from the desired enumeration are used in assigning to records. |
encode_base32(p_value bigint) | FUNCTION | sql | true | text | INVOKER | Encodes a big integer value into Base32 representation. The representation here is that designed by Douglas Crockford (https://www.crockford.com/base32.html). Parameters
|
generate_comments_apiview(p_comments_config ms_syst_priv.comments_config_apiview) | FUNCTION | plpgsql | false | void | INVOKER | Generates API View comments as well as comments for any requested columns. API Views are typically closely associated with specific Data Tables. While this function does not require Data Table to API View parity of columns, types, etc. it does assume that a substantial amount of Data Table to API View parity exists. Given this, the descriptive texts of the API View and its columns are extracted from the Data Table comments and applied to the API View. Additional information that is specific for the API View is then added using the configurations passed in the Parameters
|
decode_base32(p_value text) | FUNCTION | plpgsql | true | bigint | INVOKER | Decodes integers represented in Base32. The representation here is that designed by Douglas Crockford (https://www.crockford.com/base32.html). Parameters
|
get_random_string(p_length integer, p_tokens text DEFAULT '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'::text) | FUNCTION | sql | false | text | INVOKER | Returns a random text string, by default consisting of alpha-numeric symbols, of the requested length. An arbitrary set of characters from which to draw the random string may be provided my the caller. Parameters
|
get_greatest_rights_scope(p_scopes text[]) | FUNCTION | plpgsql | true | text | INVOKER | Given an array of Permission Right Scopes, returns the most expansive scope found in the array. Parameters
General Usage If the array is NULL the returned value is ‘deny’. |
generate_comments_function(p_comments_config ms_syst_priv.comments_config_function) | FUNCTION | plpgsql | false | void | INVOKER | Generates comments for functions, procedures, and trigger functions. Parameters
General Usage If the default value of a documented function is longer than ~40 characters, it may be better to set the |
nonstandard_encode(p_base integer, p_tokens text, p_value bigint) | FUNCTION | plpgsql | true | text | INVOKER | Performs an encode operation, similar to the standard encode function, but for non-standard encoding schemes such as Base32 or Base36. Parameters
|
get_exception_details(p_proc_schema text, p_proc_name text, p_exception_name text, p_errcode text, p_param_data jsonb, p_context_data jsonb) | FUNCTION | sql | false | text | INVOKER | Returns exception details based on the passed parameters represented as a pretty-printed JSON object. The returned value is intended to standardize the details related to Parameters
|