Language structures support

This section provides information on the support for dependencies mapping for Snowflake SQL commands (DDL, DML, and query syntax).

The list of commands is not 100% complete, and we are constantly expanding the capabilities of our analysis.

Glossary

Script: used as a synonym for the source file.

Relationships

A relationship is the simplest relationship between objects, it represents a connection between them, there are different kinds of relationships

  • Script relationship: (Script)−action→(Object)

    The script relationship represents an "action" that is being executed inside the script towards an object.

    E.g.:

    UPDATE DB.SCH.T1 SET value1 = newValue;

    (file.sql)−UPDATE→(DB.SCH.T1)

  • Contains relationship: (Script)−contains→(Object)

    The contains relationship is defined by CREATE commands. This will generate elements known as Objects otherwise the Objects found are called Missing Objects.

    E.g.:

    CREATE TABLE DB.SCH.T1 (...

    (file.sql)−CONTAINS→(DB.SCH.T1)

Dependencies

A dependency is a strong link between two objects. Most of the time the dependent object needs that dependency relationship so it can work.

  • Reference: (Object1)−REFERENCES→(Object2)

    The reference relationship is defined by the use of an Object inside a command, each object that has a "parent" identified will have this relationship. The Missing Object type will be used when the usage of an object is found, but the creation statement for the object was not.

    E.g.:

    CREATE VIEW DB.SCH.V1 AS SELECT * FROM DB.SCH.T1;

    (DB.SCH.V1)−REFERENCES→(DB.SCH.T1)

DDL Commands

Most DDL commands generate dependencies (or simple relationships). The CREATE command is pretty unique given its nature of generating objects, so we will be adding a specific block for it.

CommandTypeSupport Status

ALTER <object>

Script relationship

COMMENT

Script relationship

DESCRIBE <object>

Script relationship

DROP <object>

Script relationship

SHOW <object>

Script relationship

USE <object>

Script relationship

CREATE <object>

This command can be used with Account and Database objects, which in turn gives it a lot of different variations, each with a specific syntax. Usually, the more complex syntax will be less likely that the scanner will identify it.

Create [Account objects]

CommandTypeSupport Status

CREATE CONNECTION

Contains relationship

CREATE NETWORK POLICY

Contains relationship

CREATE RESOURCE MONITOR

Contains relationship

CREATE SHARE

Contains relationship

CREATE ROLE

Contains relationship

CREATE USER

Contains relationship

CREATE WAREHOUSE

Contains relationship

CREATE DATABASE

Contains relationship

CREATE DATABASE … CLONE

Contains relationship

CREATE NOTIFICATION INTEGRATION

Contains relationship

CREATE SECURITY INTEGRATION

Contains relationship

CREATE SESSION POLICY

Contains relationship

CREATE STORAGE INTEGRATION

Contains relationship

Create [Database objects]

CommandTypeSupport Status

CREATE SCHEMA

Contains relationship

CREATE SCHEMA … CLONE

Contains relationship

CREATE TABLE

Contains relationship

CREATE TABLE … CLONE

Contains relationship

CREATE EXTERNAL TABLE

Contains relationship

CREATE VIEW

Contains relationship

CREATE MATERIALIZED VIEW

Contains relationship

CREATE MASKING POLICY

Contains relationship

CREATE ROW ACCESS POLICY

Contains relationship

CREATE SEQUENCE

Contains relationship

CREATE SEQUENCE … CLONE

Contains relationship

CREATE TAG

Contains relationship

CREATE FILE FORMAT

Contains relationship

CREATE FILE FORMAT … CLONE

Contains relationship

CREATE STAGE

Contains relationship

CREATE STAGE … CLONE

Contains relationship

CREATE PIPE

Contains relationship

CREATE STREAM

Contains relationship

CREATE STREAM … CLONE

Contains relationship

CREATE TASK

Contains relationship

CREATE TASK … CLONE

Contains relationship

CREATE FUNCTION

Contains relationship

CREATE EXTERNAL FUNCTION

Contains relationship

CREATE PROCEDURE

Contains relationship

DML

Currently, the DML commands alone are not generating any kind of dependencies.

TypeSupport Status

INSERT

Script relationship

INSERT (multi-table)

Script relationship

MERGE

Script relationship

UPDATE

Script relationship

DELETE

Script relationship

TRUNCATE TABLE

Script relationship

Last updated