On this Page
Table of Contents | ||||
---|---|---|---|---|
|
Overview
Snap type: | Read | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: | This Snap outputs a list of tables in a database. The Snap will connect to the database, read its metadata, and output a document for each table found in the database. The table names are output in a topological order so that tables with the fewest dependencies are output first. In other words, if table A has a foreign key reference to table B, then table B will be output before A. The ordering is intended to ease the process of replicating a group of tables from one database to another.
Replicating a Subset of TablesThe output of the Table List Snap can be directly used to replicate an entire database. However, if you are only interested in a subset of tables, you can use a Filter Snap to select the table names you are interested in as well as the tables that they reference. For example, given the following diamond-shaped table graph where A depends on B and C and they both depend on D:
The Table List will output the following documents:
So, if you wanted to copy just table 'A' and its dependencies, you can add a Filter Snap with the following expression:
The filter will then remove any extra tables that happen to be in the schema. | |||||||||||||
Prerequisites: |
The following commands enable minimum privileges in the Snowflake Console:
For more information on Snowflake privileges, refer to Access Control Privileges. | |||||||||||||
Internal SQL Commands | This Snap uses the Show Tables command internally. It enables you to list tables for the current or specified database or schema, or across your entire account.
| |||||||||||||
Support and limitations: | Works in Ultra Pipelines. | |||||||||||||
Account: | This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring Snowflake Accounts for information on setting up this type of account. | |||||||||||||
Views: |
| |||||||||||||
Settings | ||||||||||||||
Label Required. | The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | |||||||||||||
Schema name | The database schema name. In case it is not defined, then the suggestion for the table name will retrieve all tables names of all schemas. The property is suggestible and will retrieve available database schemas during suggest values.
Example: test Default value: [None] | |||||||||||||
Compute table graph | Computes the dependents among tables and returns each table with a list of tables it has foreign key references to. The ordering of outputted tables is from least dependent to most - dependent.
Default value: Not selected | |||||||||||||
|
|
Example
In the following example, the Snowflake Table List Snap retrieves all the tables under schema 'PUBLIC' and writes it to the output view.
Successful execution of the Snap gives the following output view:
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|