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.

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]

Create [Database objects]

DML

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

Last updated