phdata-logo Docs About phData
Import Procedure

Traverse Import Script #

The Traverse Import Script is a set of SQL statements and Stored procedures to push data from your Snowflake account into Traverse with a recurring task.

Included Data #

The data sent to Traverse is:

  • Database object names
  • Schema object names
  • User object names
  • Role object names
  • Privileges granted between the above objects

API Token #

When the import script is generated an API token is created that allows the script to authenticate with your Traverse Organization.

Script Privileges #

The script must be run as ACCOUNTADMIN. ACCOUNTADMIN is the only role with privileges to create API Integrations and External Functions. ACCOUNTADMIN also has privileges to list the necessary objects needed for the import, like databases and roles.

Diagram #

Import Architecture

Script Execution #

The objects created by the script need to run in a database and schema, and on a warehouse. By default the script will create the objects for you.

  • Databse: phdata
  • Schema: traverse
  • Warehouse: phdata

Script Components #

Task: The task TRAVERSE_EXPORT_TASK is created to keep data up-to-date. The default schedule is to import data every 2 hours.

Stored Procedure: TRAVERSE_EXPORT lists users, roles, databases, schemas, and privileges and collects them into a JSON objects. This JSON object is then sent to Traverse using the external function TRAVERSE_EXPORT_EXT

External Function: The external function TRAVERSE_EXPORT_EXT is called to import the JSON object (created above) into traverse. The external function sends the JSON data as chunks along with the API token used for authenticating with Traverse.

API Integration: An API Integration is created that will communicate with a pass-through endpoint in either Azure or AWS. It’s important when generating the script to choose the right provider, the API integrations for different cloud providers are not compatible.