Schema: meta

meta

Metadata related objects (application design)



Tables


app

App

Name Type Description
contact_mail character_varying
contact_provider_id integer

foreign key to general.email_provider.id

terms_of_service text
privacy_policy text
agreement text
id integer


data_type

Catalog of data types.

Name Type Description
name character_varying
id integer
default_width integer
default_col_editor_id integer
server_data_type character_varying
default_type boolean
js_data_type character_varying
time_modified timestamp_without_time_zone
default_format_id integer


error

Errors of auxiliary admin app.

Name Type Description
message character_varying
time_modified timestamp_without_time_zone
id uuid
lang_id integer
code integer


help

Catalog of help items.

Name Type Description
name character_varying
id integer


help_lang

Translations of help texts.

Name Type Description
value text
lang_id integer

foreign key to meta.lang.id

id integer
help_id integer

foreign key to meta.help.id


i18n

Catalog of i18n text items in app.

Name Type Description
id integer
key character_varying


i18n_lang

Translations of i18n text items in app.

Name Type Description
id integer
lang_id integer

foreign key to meta.lang.id

value character_varying
i18n_id integer

foreign key to meta.i18n.id


import_detail

Column descriptions for import from csv/excel.

Name Type Description
is_key boolean
target_table character_varying
target_schema character_varying
col_name character_varying
import_master_id integer

foreign key to meta.import_master.id

order_no integer
target_column character_varying
col_type character_varying
is_fk boolean
as_row boolean
target_column_list character_varying
source_column_list character_varying
joins character_varying
from_additional_join boolean
constant_value character_varying
ignore_in_master boolean
id integer
split boolean
ignore boolean
name_match character_varying


import_master

Items for import from csv/excel.

Name Type Description
preprocess character_varying
additional_column_list character_varying
additional_joins character_varying
table_name character_varying
id integer
sheet character_varying
import_name character_varying
data_date character_varying
constant_value character_varying
schema_name character_varying


lang

Catalog of app languages.

Name Type Description
name character_varying
id integer
short_tag character
time_modified timestamp_without_time_zone
tag character_varying


news

News items for display in app home page.

Name Type Description
name character_varying
time_modified timestamp_with_time_zone
user_modified_id integer

foreign key to auth.person.id

time_created timestamp_with_time_zone
id integer
active boolean


news_lang

Translations of news items for display in app home page.

Name Type Description
id integer
lang_id integer

foreign key to meta.lang.id

text character_varying
news_id integer

foreign key to meta.news.id

time_modified timestamp_with_time_zone
user_modified_id integer

foreign key to auth.person.id

title character_varying
time_created timestamp_with_time_zone
extended_text character_varying


route

Routes (menu items) with attributes for app.

Name Type Description
component character_varying
path character_varying
order_no integer
name character_varying
parent character_varying
title character_varying
locked boolean
active boolean
public boolean
offline boolean
props json
id integer
icon character_varying


safe_function

List of database functions that can be safely executed.

Name Type Description
id integer
name character_varying


table_ref_col

Column to be shown as label in dropdown (in not second column of a table).

Name Type Description
schema_name character_varying
table_name character_varying
ref_col character_varying
id integer


tableapi_props

Tableapi props

Name Type Description
props json
tableapi character_varying
colatts json
id integer


trace

Table to store manual debugging data.

Name Type Description
text character_varying
time_modified timestamp_without_time_zone
id integer


vw_ai4soilhealth_hierarchy

Menu item hierarchy of auxiliary admin app.

Name Type Description
proc character_varying
order_no integer
child character_varying
parent text


Functions

a_crud_temp

A crud temp

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
ForDetail boolean
MasterKey character_varying
WithOwnership boolean
ForIsA boolean
Source:
Returns:
Type
void

add_comment_to_procedure

Adds a first version of the comment to the procedure

Parameters:
Name Type Description
SchemaName character_varying

Name of the schema

ProcName character_varying

Name of the proc

Source:
Returns:
Type
json

add_i18n_keys

Add i18n keys found in code to the i18n table

Parameters:
Name Type Description
Keys character_varying
Source:
Returns:
Type
void

add_timestamp_column

Add time_modified timestamp column to table if it does not exist

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
Source:
Returns:
Type
void

add_triggers

Add triggers to a table to update time_modified and user_modified columns, if they exist.

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
Source:
Returns:
Type
void

add_update_time_modified_trigger

Add update time modified trigger

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
Source:
Returns:
Type
void

add_update_user_and_time_modified_trigger

Add update user and time modified trigger

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
Source:
Returns:
Type
void

add_user_and_timestamp_column

Add user and timestamp column to a table if they do not exist

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
Source:
Returns:
Type
void

analyze_file

Analyze file (detect columns and data types from JSON data and save to import_detail table)

Parameters:
Name Type Description
Id integer
JsonData text
Source:
Returns:
Type
void

camel_to_snake

Converts text in camel case to snake case

Parameters:
Name Type Description
input_text text
Source:
Returns:
Type
text

clean_table

Clean table (create a new table keeping the structure and foreign keys)

Parameters:
Name Type Description
v_schema_name text
v_table_name text
Source:
Returns:
Type
void

clean_value

Clean value for insertion into database table depending on type

Parameters:
Name Type Description
v character_varying
t character_varying
Source:
Returns:
Type
character_varying

create_route_for_dbfunction

Create route for dbfunction

Parameters:
Name Type Description
schema_name character_varying
procedure_name character_varying
Source:
Returns:
Type
void

crud

Crud

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
ForDetail boolean
MasterKey character_varying
WithOwnership boolean
ForIsA boolean
Source:
Returns:
Type
void

decrypt_varchar

Decrypt varchar

Parameters:
Name Type Description
value character_varying
Source:
Returns:
Type
character_varying

encrypt_varchar

Encrypt varchar

Parameters:
Name Type Description
value character_varying
Source:
Returns:
Type
character_varying

function_exists

Checks if a function exists

Parameters:
Name Type Description
schema_name character_varying
func_name character_varying
Source:
Returns:
Type
boolean

get_db_procedures

Get procedures from the database for documentation generation

Parameters:
Name Type Description
SchemaName character_varying
ProcName character_varying
Source:
Returns:
Type
json

get_db_schema

Get schema of database for documentation generation

Source:
Returns:
Type
json

get_for_translate

Properties:
Name Type Description
"Id" integer
TableName character_varying
ParentKeyName character_varying
Source:
Returns:
Type
character_varying

get_help

Get help for a given topic in a given language

Parameters:
Name Type Description
Name character_varying
LangId integer
Source:
Returns:
Type
json

get_i18n

Get i18n translation of i18n items in the app for the given language

Parameters:
Name Type Description
LangId integer
Source:
Returns:
Type
json

get_key

Get key

Source:
Returns:
Type
bytea

get_lang

Get languages fro locale selection for admin auxiliary app

Parameters:
Name Type Description
SearchValue character_varying
Key integer
Properties:
Name Type Description
id integer
name character_varying
short_tag character_varying
Source:
Returns:
Type
Object

get_locale_options

Get locale options for language selection in app

Source:
Returns:
Type
json

get_news

Get news

Parameters:
Name Type Description
LangId integer
Properties:
Name Type Description
id integer
title character_varying
text character_varying
extended_text character_varying
time_modified timestamp_without_time_zone
time_created timestamp_without_time_zone
user_modified character_varying
Source:
Returns:
Type
Object

get_policy

Get policy

Parameters:
Name Type Description
PolicyType character_varying
Source:
Returns:
Type
text

get_routes

Get routes (menu items with properties) for a person in a language

Parameters:
Name Type Description
PersonId integer
LangId integer
Source:
Returns:
Type
json

get_schema_name

Get schema name for the given table

Parameters:
Name Type Description
TableName text
Source:
Returns:
Type
text

get_schemas

Get schemas

Source:
Returns:

character_varying schema_namecharacter_varying table_name

Type
Object

get_table_cols

Get table columns and foreign keys for crud generation

Parameters:
Name Type Description
SchemaName character_varying
TableName character_varying
Properties:
Name Type Description
table_schema character_varying
table_name character_varying
column_name character_varying
referenced_schema_name character_varying
referenced_table_name character_varying
referenced_column_name character_varying
data_type character_varying
data_type_full character_varying
ordinal_number integer
max_length integer
numeric_precision integer
numeric_scale integer
is_identity boolean
is_fk boolean
is_computed boolean
default_value character_varying
referenced_display_column_name character_varying
allow_dbnull boolean
referenced_column_language_dependent boolean
Source:
Returns:
Type
Object

get_tableapi_props

Get tableapi props

Parameters:
Name Type Description
TableAPI character_varying
Source:
Returns:
Type
json

i18n_itrig_proc

I18n itrig procedure - adds a new i18n key to the i18n_lang table for each language in the lang table

Source:
Returns:
Type
trigger

import_detail_clone

Clone procedure for import_detail table

Parameters:
Name Type Description
Id character_varying
Source:
Returns:
Type
void

import_master_clone

Clone provided import_master and all associated import_detail records

Parameters:
Name Type Description
Id character_varying
Source:
Returns:
Type
void

import_proc_from_gl

Import procedure with given schema and procedure name with its definition from gl schema

Parameters:
Name Type Description
SchemaName character_varying
ProcName character_varying
Source:
Returns:
Type
void

is_function_safe

Returns if a function is safe to execute

Parameters:
Name Type Description
Function character_varying
Source:
Returns:
Type
boolean

list_procedures

List procedures

Parameters:
Name Type Description
Params text
PersonId integer
LangId integer
Source:
Returns:
Type
json

list_tables

List tables

Parameters:
Name Type Description
Params text
PersonId integer
LangId integer
Source:
Returns:

bigint idboolean for_detailcharacter_varying master_keyboolean for_isaboolean with_ownershipcharacter_varying table_schemacharacter_varying table_name

Type
Object

lookup

Create lookup procedure for a table

Parameters:
Name Type Description
"SchemaName" character_varying
"TableName" character_varying
"ReferencedColumnDisplayName" character_varying
"ReferencedColumnType" character_varying
Source:
Returns:
Type
void

meta_route_clone

Meta route clone

Parameters:
Name Type Description
Id integer
Source:
Returns:
Type
integer

prepare_import_proc

Prepare import procedure for a given import master id

Parameters:
Name Type Description
Id integer
Source:
Returns:
Type
void

prepare_joins

Prepare joins for import_detail table

Parameters:
Name Type Description
Id integer
Source:
Returns:
Type
void

raise_error

Raise a given error

Parameters:
Name Type Description
Code integer
Explanation character_varying
Source:
Returns:
Type
void

remove_quotes_from_table

Remove quotes from column names for a given table

Parameters:
Name Type Description
TableName character_varying
Source:
Returns:
Type
void

reorder_menu

Reorder menu

Parameters:
Name Type Description
SourceId integer
TargetId integer
Where character_varying
Source:
Returns:
Type
void

rmv

Refresh materialized views

Source:
Returns:
Type
void

route_itrig_proc

Route itrig proc (adds i18n key if not exists)

Source:
Returns:
Type
trigger

route_reorder

Reorder procedure for route table

Parameters:
Name Type Description
SourceId character_varying
ToIndex integer
Source:
Returns:
Type
void

set_help

Set help text for a given topic and language

Parameters:
Name Type Description
Name character_varying
LangId integer
Help text
Source:
Returns:
Type
void

set_locked

Set locked

Parameters:
Name Type Description
Id integer
Locked boolean
Source:
Returns:
Type
void

set_tableapi_props

Set tableapi props

Parameters:
Name Type Description
Tableapi character_varying
Json character_varying
Source:
Returns:
Type
void

snake_to_sentence

Snake to sentence

Parameters:
Name Type Description
s character_varying
Source:
Returns:
Type
character_varying

translate

Translate a field value in a table to a specific language

Parameters:
Name Type Description
Locale character_varying
TableName character_varying
KeyName character_varying
KeyValue character_varying
ParentKeyName character_varying
ParentKeyValue character_varying
FieldName character_varying
FieldValue character_varying
Source:
Returns:
Type
void

translate _overload

Translate a field value in a table to a specific language

Parameters:
Name Type Description
Locale character_varying
TableName character_varying
KeyName character_varying
KeyValue character_varying
ParentKeyName character_varying
ParentKeyValue character_varying
FieldName character_varying
FieldValue character_varying
Source:
Returns:
Type
void

update_backoffice_routes

Update backoffice routes in app from auxiliary admin app definition

Source:
Returns:
Type
void

update_i18n_lang

Update i18n lang table with new i18n keys and languages

Source:
Returns:
Type
void

update_time_modified

Update time modified

Source:
Returns:
Type
trigger

update_user_and_time_modified

Update user and time modified

Source:
Returns:
Type
trigger