Routines

Routines

Name Type Language Deterministic Return Type Security Restriction Comments
tdis_get_uploads_by_user FUNCTION SQL false SETOF tdis_uploads INVOKER

Retrieves the uploads for a given user.

select *
from tdis_get_uploads_by_user('pbuschow');
tdis_add_contact FUNCTION PLPGSQL false integer INVOKER

Creates a new contact. Returns the new contact ID.

select *
from tdis_update_contact('penumbra@penumbra.com', 'penumbraUpdated2',
                         'veil2', 2031, '555-555-1212', '555-555-1212',
                         'Otters are pretty silly but very cute2.');
tdis_get_artifacts_by_user_paginated FUNCTION PLPGSQL false SETOF tdis_artifacts INVOKER

select *
from tdis_get_artifacts_by_user_paginated('pbuschow', 1, 2);
tdis_get_model FUNCTION SQL false SETOF tdis_models INVOKER

select *
from tdis_get_model('TM-932cbc4e-9688-11ec-ba2a-59ebf1ac4488');
tdis_update_layer FUNCTION PLPGSQL false character varying INVOKER
tdis_get_models_by_user_paginated FUNCTION PLPGSQL false SETOF tdis_models INVOKER

select *
from tdis_get_models_by_user_paginated('pbuschow', 1, 2);
tdis_get_all_jurisdictions FUNCTION SQL false SETOF tdis_jurisdictions INVOKER

Retrieves all jurisdictions.

select * from tdis_get_all_jurisdictions();
tdis_get_models_by_user_with_ids FUNCTION SQL false SETOF tdis_models_ids INVOKER

select *
from tdis_get_models_by_user_with_ids('pbuschow');
tdis_update_contact FUNCTION PLPGSQL false integer INVOKER

Updates an existing contact.

select *
FROM tdis_update_contact('penumbra@penumbra.com', 'penumbraUpdated2',
                         'veil2', 2031, '555-555-1212', '555-555-1212',
                         'Otters are pretty silly but very cute2.');
tdis_add_agency FUNCTION PLPGSQL false integer INVOKER

Creates a new agency. Returns new agency ID.

select *
from tdis_add_agency('Texas Department of Volcanology', 'TDV');
tdis_get_models_by_user FUNCTION SQL false SETOF tdis_models INVOKER

select *
from tdis_get_models_by_user('pbuschow');
tdis_get_upload_conflicts_by_user FUNCTION SQL false SETOF tdis_upload_conflicts INVOKER

In cases for which an identical filename has been uploaded for the same model in the same path, a conflict will arise. This function returns a set of upload conflicts that may exist for a given user. Note that a synthetic column called conflict_number provides a grouping of conflict sets in the event that there are more than one.

select *
from tdis_get_upload_conflicts_by_user('pbuschow');
tdis_get_user_id_by_email FUNCTION PLPGSQL false integer INVOKER

Retrieves the ID of a user given the user’s email address.

select *
from tdis_get_user_id_by_email('paul@csr.utexas.edu');
tdis_get_intersecting_elements_experimental FUNCTION SQL false SETOF tdis_element_identifiers_geom INVOKER
tdis_add_user_to_project_role FUNCTION PLPGSQL false integer INVOKER

Adds and existing user to a project role

select * from tdis_add_user_to_role('bporter', 'RBFS', 'admin-basic');
tdis_get_jurisdiction FUNCTION PLPGSQL false SETOF tdis_project_jurisdictions INVOKER

Retrieves a jurisdiction for a given ID.

select * from tdis_get_jurisdiction('1');
tdis_update_collection FUNCTION PLPGSQL false character varying INVOKER

Updates a collection in the dB.

select *
from tdis_update_collection('TL-c36ee070-9dfe-11ed-a439-afd4c5252924', 4, '01', '{Chain,of,Custody}',
                    'Region 01 Collection', 'Lorem Ipsum', 'Lorem Ipsum',
                    '{{32,1},{37,6}}', null);
tdis_duplicate_model FUNCTION PLPGSQL false character varying INVOKER

Duplicates or clones an existing model creating a completely new record which is unconnected with the original. Returns the new model’s TDIS Identifier.

select *
from tdis_duplicate_model('TM-54de7176-98ea-11ec-ba2a-59ebf1ac4488');
tdis_add_user FUNCTION PLPGSQL false integer INVOKER

Creates a user. Returns the new user’s ID.

select * from tdis_add_user('turban', '123456', 'turban@tacc.utexas.edu', 'Urban', 'Tomislav',
                          'The University of Texas at Austin', null, '512-909-1086',
                          null);
tdis_get_uploads_by_model FUNCTION SQL false SETOF tdis_uploads INVOKER

Retrieves the uploads associated with a given model.

select *
from tdis_get_uploads_by_model('TM-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488');
tdis_add_layer_ids FUNCTION PLPGSQL false character varying INVOKER
tdis_search_artifacts FUNCTION SQL false SETOF tdis_artifacts INVOKER

Takes a standard web search sting, which can include logic like “and”, “or” and “not” and returns artifacts that match the search string in the title, description or purpose fields.

select * from tdis_search_artifacts('urban or weather');
tdis_get_verified_jurisdictions FUNCTION SQL false SETOF tdis_jurisdictions INVOKER

Retrieves verified jurisdictions.

select * from tdis_get_verified_jurisdictions();
tdis_get_vertical_datums FUNCTION SQL false SETOF tdis_vertical_datum INVOKER

Retrieves a list of all vertical datums.

select *
from tdis_get_vertical_datums();
tdis_get_layers_by_user_with_ids FUNCTION SQL false SETOF tdis_layers_ids INVOKER

select *
from tdis_get_layers_by_user_with_ids('pbuschow');
tdis_resolve_batch_conflict FUNCTION PLPGSQL false character varying INVOKER

Selects which conflicting files should be chosen as current from amongst multiple possible uploads. This function accepts a TDIS Identifier and the upload batch id which corresponds to the unique upload directory name into which the upload files have been saved. It then archives the files associated with the same TDIS Identifier, but not in that upload batch. It also makes sure that any previously archived files associated with the desired batch are unarchived.

select * from tdis_resolve_batch_conflict('TM-f1f68322-b09b-11ec-b386-256c9c6fe0cd', 'e8ddf3d1-0f35-4f56-9200-ca53450c7325');
tdis_associate_contact_with_model FUNCTION PLPGSQL false character varying INVOKER

select *
from tdis_associate_contact_with_model('TM-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488', 37, 7);
tdis_accept_models FUNCTION PLPGSQL false ARRAY INVOKER

Sets the status on a list of TDIS Identifiers to accepted.

select *
from tdis_accept_models('{TM-6e34e9ac-9f20-11ec-ba2a-59ebf1ac4488,TM-90bd467a-9d97-11ec-ba2a-59ebf1ac4488}', 'turban', 'Testing multiple model acceptance.');
tdis_add_model FUNCTION PLPGSQL false character varying INVOKER

Creates a new model. Returns the new model’s TDIS Identifier

select *
from tdis_add_model(6, 117, 'Flood Model 68970', '2022-12-13', '2020-07-11', 'Lorem Ipsum', 'Lorem Ipsum', 13,
                2, '{"Dallas|County","Dallas|Municipality"}', '{{6,7},{6,8}}', 'Jane D. Doe', '{TDEM,TxDOT,TNRIS}',
                5,
                1, 'https://web.site.net', 45, 'USGS', 'flood modeling, harvey, hydraulic, river reach',
                'GNU', '012333444555', '{Combined Riverine-Coastal,Hydraulic}', '{013555444}', 'REST', 'HEC-RAS',
                '1.0.2', 'Annually', '{"[2022-02-15, 2022-02-17)","[2022-02-03, 2022-02-09)"}', '{Public}');
tdis_delete_layer FUNCTION PLPGSQL false character varying INVOKER

select *
from tdis_delete_model('TL-54de7176-98ea-11ec-ba2a-59ebf1ac4488');
tdis_get_all_contacts FUNCTION SQL false SETOF tdis_contacts INVOKER

Retrieves all contacts.

select * from tdis_get_all_contacts();
tdis_get_artifact FUNCTION SQL false SETOF tdis_artifacts INVOKER

select *
from tdis_get_artifact('TA-932cbc4e-9688-11ec-ba2a-59ebf1ac4488');
tdis_duplicate_artifact FUNCTION PLPGSQL false character varying INVOKER

Duplicates or clones an existing artifact creating a completely new record which is unconnected with the original. Returns the new artifacts’s TDIS Identifier.

select *
from tdis_duplicate_artifact('TA-54de7176-98ea-11ec-ba2a-59ebf1ac4488');
tdis_get_contact_by_email FUNCTION SQL false SETOF tdis_contacts INVOKER

select *
from tdis_get_contact_by_email('bill.shatner@usgs.gov');
tdis_get_layers_by_user_paginated FUNCTION PLPGSQL false SETOF tdis_layers INVOKER

select *
from tdis_get_layers_by_user_paginated('pbuschow', 1, 2);
tdis_get_layers_by_user FUNCTION SQL false SETOF tdis_layers INVOKER

select *
from tdis_get_layers_by_user('pbuschow');
tdis_get_artifacts_by_user FUNCTION SQL false SETOF tdis_artifacts INVOKER

select *
from tdis_get_artifacts_by_user('pbuschow');
tdis_get_contact_roles FUNCTION SQL false SETOF tdis_contact_role INVOKER

select *
from tdis_get_contact_roles();
tdis_authenticate_user FUNCTION SQL false SETOF record INVOKER
tdis_delete_contact FUNCTION PLPGSQL false character varying INVOKER

select * from tdis_delete_contact('arne2@snaefell.is');
tdis_add_artifact_ids FUNCTION PLPGSQL false character varying INVOKER
tdis_get_archive_by_model FUNCTION SQL false SETOF tdis_uploads INVOKER

Retrieves the archive uploaded with a given model.

select *
from tdis_get_archive_by_model('TM-00a04348-e861-11ec-a632-8fba6188f5ad');
tdis_update_model_ids FUNCTION PLPGSQL false character varying INVOKER
tdis_get_contact_by_id FUNCTION SQL false SETOF tdis_contacts INVOKER

select *
from tdis_get_contact_by_id(32);
tdis_update_artifact FUNCTION PLPGSQL false character varying INVOKER

select *
from tdis_update_artifact('TA-cc9fbcd2-9dfe-11ed-a439-afd4c5252924', 6, 170, 'Test artifact', '2022-12-15',
                      '2020-07-11',
                      'artifact description. Updated.', 'artifact purpose.',
                      4, '{"Dallas|Municipality","Dallas|County"}',
                      '{{6,7},{6,8}}', 'Creator Name', '{TDEM,TxDOT,TNRIS}',
                      3, 2, 'https://url.org/1234', 120,
                      'GeoTIFF', 'USGS',
                      'Rainfall, Precipitation', 'GNU',
                      '2023-01-05',
                      'Process step description.', 2087,
                      'ArcGIS Web Service', 'HEC-RAS', '3.4.1',
                      'Daily', '{"[2022-02-15, 2022-02-17)","[2022-02-03, 2022-02-09)"}',
                      '{Public}');
tdis_get_all_models FUNCTION SQL false SETOF tdis_models INVOKER

Retrieves all models.

select * from tdis_get_all_models();
tdis_get_contact_id_by_email FUNCTION PLPGSQL false integer INVOKER

select *
from tdis_get_contact_id_by_email('bill.shatner@usgs.gov');
tdis_get_notifications_for_element FUNCTION SQL false SETOF tdis_notifications INVOKER

select *
from tdis_get_notifications_for_element('TL-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488');
tdis_update_model FUNCTION PLPGSQL false character varying INVOKER
tdis_get_upload_conflicts_by_model FUNCTION SQL false SETOF tdis_upload_conflicts INVOKER

In cases for which an identical filename has been uploaded for the same model in the same path, a conflict will arise. This function returns a set of upload conflicts that may exist for a given model. Note that a synthetic column called conflict_number provides a grouping of conflict sets in the event that there are more than one.

select *
from tdis_get_upload_conflicts_by_model('TM-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488');
tdis_search_layers FUNCTION SQL false SETOF tdis_layers INVOKER

Takes a standard web search sting, which can include logic like “and”, “or” and “not” and returns layers that match the search string in the title, description or purpose fields.

select * from tdis_search_layers('urban or weather');
tdis_get_horizontal_projections FUNCTION SQL false SETOF tdis_horizontal_projection INVOKER

Retrieves a list of all horizontal projections or coordinate systems.

select *
from tdis_get_horizontal_projections();
tdis_get_layer FUNCTION SQL false SETOF tdis_layers INVOKER

select *
from tdis_get_layer('TL-932cbc4e-9688-11ec-ba2a-59ebf1ac4488');
tdis_duplicate_layer FUNCTION PLPGSQL false character varying INVOKER

Duplicates or clones an existing layer creating a completely new record which is unconnected with the original. Returns the new layer’s TDIS Identifier.

select *
from tdis_duplicate_layer('TL-54de7176-98ea-11ec-ba2a-59ebf1ac4488');
tdis_resolve_conflict FUNCTION PLPGSQL false integer INVOKER

Archives any uploads with the same filename, associated object (e.g. Model, Layer or Artifact) and parent object (e.g. directory) as the upload indicated by the provided ID.

select * from tdis_resolve_conflict(856);
tdis_get_contacts_by_model FUNCTION SQL false SETOF tdis_element_contacts INVOKER

Retrieves all contacts associated with a model indicated by TDIS Identifier.

select *
from tdis_get_contacts_by_model('TM-932cbc4e-9688-11ec-ba2a-59ebf1ac4488');
tdis_get_collections FUNCTION SQL false SETOF tdis_collections INVOKER

select *
from tdis_get_collections();
tdis_remove_user_from_project_role FUNCTION PLPGSQL false integer INVOKER

Removes an existing user from a project role

select * from tdis_remove_user_from_project_role('bporter', 'RBFS', 'admin-basic');
tdis_get_artifacts_by_user_with_ids FUNCTION SQL false SETOF tdis_artifacts_ids INVOKER
tdis_get_history FUNCTION SQL false SETOF tdis_element_history INVOKER

select *
from tdis_get_history('TM-932cbc4e-9688-11ec-ba2a-59ebf1ac4488');
tdis_add_message FUNCTION PLPGSQL false integer INVOKER

Sends a message regarding a model given by TDIS Identifier from the provided user.

select *
from tdis_add_message('TM-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488', 'turban', 'This is a test message.');
tdis_get_jurisdictions_by_project FUNCTION PLPGSQL false SETOF tdis_project_jurisdictions INVOKER

Retrieves all jurisdictions for a given project name.

select * from tdis_get_jurisdictions_by_project('MS2');
tdis_get_messages_for_element FUNCTION SQL false SETOF tdis_messages INVOKER

select *
from tdis_get_messages_for_element('TM-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488');
tdis_get_all_layers FUNCTION SQL false SETOF tdis_layers INVOKER

Retrieves all layers.

select * from tdis_get_all_layers();
tdis_get_artifact_with_ids FUNCTION SQL false tdis_artifacts_ids INVOKER
select *
from tdis_get_artifact_with_ids(''TA-932cbc4e-9688-11ec-ba2a-59ebf1ac4488'');'
tdis_authorize_user FUNCTION PLPGSQL false jsonb INVOKER

Returns project roles for user if token is valid and current.

select *
from tdis_authorize_user('spierce', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NiwiaWF0IjoxNjc1NzE3MTMyLCJleHAiOjE2NzU3NDU5MzJ9.Z3PKugfBx_OOWmAz9WTu2csrVsyAbEa_LXgyKzFVWuU');
tdis_add_project FUNCTION PLPGSQL false integer INVOKER

Adds a new project to the dB.

select *
from tdis_add_project('My New Project');
tdis_get_layer_with_ids FUNCTION SQL false tdis_layers_ids INVOKER

select *
from tdis_get_layer_with_ids(''TL-932cbc4e-9688-11ec-ba2a-59ebf1ac4488'');
tdis_add_notification FUNCTION PLPGSQL false integer INVOKER

Sends a notification regarding a model given by TDIS Identifier from the provided user. May include a status change as well.

select *
from tdis_add_notification('TM-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488', 'turban', 'pending',
                           'This is a test notification.');
tdis_get_unverified_jurisdictions FUNCTION SQL false SETOF tdis_jurisdictions INVOKER

Retrieves unverified jurisdictions.

select * from tdis_get_unverified_jurisdictions();
tdis_set_status FUNCTION PLPGSQL false integer INVOKER

Use this function to change the status on an existing model.

select *
from tdis_set_status('TM-9f36cc8a-93e2-11ec-ba2a-59ebf1ac4488', 'Accepted', 'turban', null);
tdis_delete_artifact FUNCTION PLPGSQL false character varying INVOKER

select *
from tdis_delete_model('TA-54de7176-98ea-11ec-ba2a-59ebf1ac4488');
tdis_reset_password FUNCTION PLPGSQL false integer INVOKER

Resets an existing user’s password.

select *
FROM tdis_reset_password('bporter', '098urt8934ut0893vun0t9uc40589tmu03');
tdis_get_vertical_projections FUNCTION SQL false SETOF tdis_vertical_projection INVOKER

Retrieves a list of all vertical projections or coordinate systems.

select *
from tdis_get_vertical_projections();
tdis_clean_sessions FUNCTION PLPGSQL false void INVOKER

Deletes any expired sessions that have not been elegantly deleted by logout.

select * from tdis_clean_sessions();
tdis_get_collection FUNCTION SQL false SETOF tdis_collections INVOKER

select *
from tdis_get_collection('TC-c86e508c-8ec3-11ec-ba2a-59ebf1ac4488');
tdis_get_vendor_contacts FUNCTION PLPGSQL false SETOF tdis_contacts INVOKER

This function retrieves all of the contacts associated with any of the models that the requested user is the creator of. This is intended to function as a sort of get_vendor_contacts until such time as we have a vendor entity.

select * from tdis_get_vendor_contacts('pbuschow');
tdis_get_jurisdiction_types FUNCTION SQL false SETOF tdis_jurisdiction_type INVOKER

select * from tdis_get_jurisdiction_types();
tdis_add_artifact FUNCTION PLPGSQL false character varying INVOKER

select *
from tdis_add_artifact(6, 170, 'Test artifact', '2022-12-15',
                      '2020-07-11',
                      'artifact description', 'artifact purpose.',
                      4, '{"Dallas|Municipality","Dallas|County"}',
                      '{{6,7},{6,8}}', 'Creator Name', '{TDEM,TxDOT,TNRIS}',
                      3, 2, 'https://url.org/1234', 120,
                      'GeoTIFF', 'USGS',
                      'Rainfall, Precipitation', 'GNU',
                      '2023-01-05',
                      'Process step description.', 2087,
                      'ArcGIS Web Service', 'HEC-RAS', '3.4.1',
                      'Daily', '{"[2022-02-15, 2022-02-17)","[2022-02-03, 2022-02-09)"}',
                      '{Public}');
tdis_add_layer FUNCTION PLPGSQL false character varying INVOKER
tdis_invalidate_session FUNCTION PLPGSQL false integer INVOKER

select * from tdis_invalidate_session('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NiwiaWF0IjoxNjc1NzE3MTMyLCJleHAiOjE2NzU3NDU5MzJ9.Z3PKugfBx_OOWmAz9WTu2csrVsyAbEa_LXgyKzFVWuU');
tdis_update_artifact_ids FUNCTION PLPGSQL false character varying INVOKER
tdis_remove_contact_from_element FUNCTION PLPGSQL false character varying INVOKER
tdis_delete_model FUNCTION PLPGSQL false character varying INVOKER

select *
from tdis_delete_model('TM-54de7176-98ea-11ec-ba2a-59ebf1ac4488');
tdis_add_model_ids FUNCTION PLPGSQL false character varying INVOKER
tdis_get_users FUNCTION SQL false SETOF tdis_users INVOKER

Retrieves all users from the dB. Note that users are not equivalent to contacts. All users are contacts, but not all contacts are users. Users have a login and can access the system.

select *
from tdis_get_users();
tdis_get_projects FUNCTION SQL false SETOF tdis_project INVOKER

select *
from tdis_get_projects();
tdis_get_software_list FUNCTION SQL false SETOF tdis_software INVOKER

Retrieves a list of all software.

select *
from tdis_get_software_list();
tdis_get_model_with_ids FUNCTION SQL false tdis_models_ids INVOKER

select *
from tdis_get_model_with_ids('TM-932cbc4e-9688-11ec-ba2a-59ebf1ac4488');
tdis_update_layer_ids FUNCTION PLPGSQL false character varying INVOKER
tdis_get_horizontal_datums FUNCTION SQL false SETOF tdis_horizontal_datum INVOKER

Retrieves a list of all horizontal datums.

select *
from tdis_get_horizontal_datums();
tdis_initialize_session FUNCTION PLPGSQL false jsonb INVOKER

Creates a new session for an authenticated user. Returns the new session ID.

select *
from tdis_initialize_session('spierce', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NiwiaWF0IjoxNjc1NzE3MTMyLCJleHAiOjE2NzU3NDU5MzJ9.Z3PKugfBx_OOWmAz9WTu2csrVsyAbEa_LXgyKzFVWuU',
                         '2023-01-08 16:05:06');
tdis_add_collection FUNCTION PLPGSQL false character varying INVOKER

Adds a new collection to the dB.

select *
from tdis_add_collection(4, '01', '{Chain,of,Custody}',
                    'Region 01 Collection', 'Lorem Ipsum', 'Lorem Ipsum',
                    '{{32,1},{37,6}}', null);
tdis_search_models FUNCTION SQL false SETOF tdis_models INVOKER

Takes a standard web search sting, which can include logic like “and”, “or” and “not” and returns models that match the search string in the title, description or purpose fields.

select * from tdis_search_models('urban or weather');
tdis_get_agencies FUNCTION SQL false SETOF tdis_agency INVOKER

select * from tdis_get_agencies();