7.1.7 Prepare Snowflake as Target Database

The “prepare” database command is used to configure Snowflake database as a Target. The command must be executed before running Apply Process. It creates the necessary database objects for any Apply Processes.

Note – In order to use the “prepare” database command the database user must have sufficient privileges.

REST API:

  • Endpoint: https://repstance_url/configure/database
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {
      "command":"prepare",
      "parameters":[
         ["database","target"],
         ["dbtype","snowflake"],
         ["account","account"],
         ["region","region"],
         ["warehouse","warehouse"],
         ["user","username"],
         ["password","password"],
         ["dbname","databaseName"]
      ]
    }

Server response:

  • HTTP Status – status of the command, possible codes are:
    • 200 – if no error occurs
    • 422 – if error occurs
  • Body:
    {
     "Status":"{Completed|Failed}",
     "Message":"The command execution details"
    }

CLI Syntax:

repcli prepare database=target dbtype=snowflake \
account=account region=region warehouse=warehouse \
user=username password=password \
dbname=databaseName

The input parameters are:

  • database – Database role, the only possible value is target – to insert Apply Process Objects
  • dbtype – Type of RDBMS, the correct value is snowflake
  • account – Snowflake Account name
  • region – Snowflake Region name
  • warehouse – Warehouse name
  • dbname – Database name to be connected to
  • user – Database User name
  • password – Database User password

Note – Account name and Region can be easily taken from the Snowflake URL:

Account name and Region