Skip to main content

Snowflake

This page provides information for connecting your application to your Snowflake database and using queries to manage its content.

Connect Snowflake

important

To connect to Snowflake, you must whitelist the IP addresses 18.223.74.85 and 3.131.104.27 of the Appsmith deployment, as well as your own machine's IP address. See Snowflake's Network Policies docs for more details.

Connection parameters

The following section is a reference guide that provides a complete description of all the parameters to connect to a Snowflake database.

Configuring a Snowflake datasource.
Configuring a Snowflake datasource.

Account Name

This field expects an identifier for your Snowflake account. This consists of your organization name and your account name separated by a hyphen: orgName-accountName. You can find your organization name and account name on the Snowflake dashboard at the bottom-left of the page; click the string next to the Snowflake logo to open an information box with your details.
Find your account name on the Snowflake dashboard at the bottom-left of the page.
Find your account name on the Snowflake dashboard at the bottom-left of the page.

Warehouse

Specifies the virtual warehouse to use once connected.

Database

Specifies the database to use once connected.

Default Schema

Sets which database schema structure should appear as a preview in the Appsmith sidebar; when this is configured, you can see the tables and columns available under the specified schema. The field does not limit which schemas you are able to query.

Role

The role to use for performing queries.

Username

The username for your Snowflake account.

Password

The password for your Snowflake account.

Query Snowflake

The following section provides examples of creating basic CRUD queries for Snowflake.

Fetch data

SELECT * FROM customer
OFFSET {{ CustomerTable.pageOffset }} ROWS
FETCH NEXT {{ CustomerTable.pageSize }} ROWS ONLY;

In the above example, CustomerTable is the name of the Table widget used to display the data using server-side pagination to control how much data is queried at once.

Insert data

INSERT INTO customer
(id, name, address, email)
VALUES
(
DEFAULT,
{{ NameInput.text }},
{{ AddressInput.text }},
{{ EmailInput.text }}
);

In the above example, NameInput, AddressInput, and EmailInput are the names of the widgets used to capture input from the user for name, address, and email fields, respectively.

Update data

UPDATE customer
SET email = {{ EmailInput.text }}
WHERE id = {{ CustomerTable.selectedRow.id }};

In the above example, EmailInput is the name of the Input widget used to capture the email entered by the user. CustomerTable is the Table widget where the user selects the row to update the user's email.

Delete data

DELETE FROM customer WHERE id = {{ CustomerTable.selectedRow.id }};

In the above example, CustomerTable is the name of the Table widget where the user selects the row for deletion.

Troubleshooting

If you are experiencing difficulties, you can refer to the Datasource troubleshooting guide or contact the support team using the chat widget at the bottom right of this page.