0

In SnapLogic, is there a way to paramertize the database connection info so you can create a reusable pipeline that can pass the db connection info for the account of a select snap?

Bilesh Ganguly
  • 3,792
  • 3
  • 36
  • 58
peterlandis
  • 645
  • 1
  • 7
  • 17
  • i don't think its recommeded. The database credentials should be secured and set up using the Account feature. By desiring to make the account setup dynamic, you are most probably gonna end up with unsecured credentials. – Narendra Mar 07 '21 at 01:32

2 Answers2

0

In pipeline properties, add a parameter named "awsdb" and its value as the "Account Name". Now, in database access snaps, use the above created parameter to dynamically load the connection info based on parameter value.

enter image description here

varunsinghal
  • 329
  • 4
  • 12
0

The database connection information cannot be passed as parameters (and it should not be). You have to create separate accounts for each connection.

As per this answer here, you can pass the account name as a pipeline parameter and configure the database read snap to connect to whatever instance it is supposed to connect to.

A better way to do this is to have an expression library file that will contain the account information and pass the schema name and table name as pipeline parameters. In this way, you can use the same pipeline to extract data from different tables in various schema using the same connection. This can be done by dragging and dropping this pipeline wherever you need it or using pipeline execute to call it from a different pipeline. You can maintain multiple such expression library files configured to different accounts.

Creating a pipeline with schema name and table name passed as pipeline parameter and an expression library file containing the account information:

Pipeline configuration

Configuring the schema name and table name in the settings tab of the snap:

Settings

Getting the account information from the expression library file:

Account

The expression library file config.expr used in this example:

{
  "account": "../shared/TEST"
}

It works:

it works

Note: As you can see, I created a Generic Database Account named TEST in the shared folder of the project space I was working in. This account contains all the connection information.

Hope this helps :)

Bilesh Ganguly
  • 3,792
  • 3
  • 36
  • 58