Skip to main content

Snowflake

Library of functions for accessing Snowflake database.

Functions

InferAndQuery

Performs a query in a Snowflake database with schema detection (inference).

Syntax:
Snowflake.InferAndQuery(database: string, query: string, accountID: optional string, username: optional string, password: optional string, options: optional list)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • query: The query to execute in the database.

  • accountID: The Snowflake account identifier e.g. JC12345.eu-west-1. For more information on account identifiers check Snowflake documentation.

  • username: The database user name. Can only to be used together with 'accountID' argument.

  • password: The database user password. Can only to be used together with 'accountID' and 'username' arguments.

  • options: Extra connection options, e.g. [{"timezone", "UTC"}].

Returns
  • collection: A table with the data read from the Snowflake table.
Example:
Snowflake.InferAndQuery("database", "SELECT * FROM schema.table", options=[{"timezone", "UTC"}])

InferAndRead

Reads a Snowflake table with schema detection (inference).

Syntax:
Snowflake.InferAndRead(database: string, schema: string, table: string, accountID: optional string, username: optional string, password: optional string, options: optional list)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • schema: The database schema name.

  • table: The name of the table.

  • accountID: The Snowflake account identifier e.g. JC12345.eu-west-1. For more information on account identifiers check Snowflake documentation.

  • username: The database user name. Can only to be used together with 'accountID' argument.

  • password: The database user password. Can only to be used together with 'accountID' and 'username' arguments.

  • options: Extra connection options, e.g. [{"timezone", "UTC"}].

Returns
  • collection: A table with the data read from the Snowflake table.
Example:
Snowflake.InferAndRead("database", "schema", "table", options=[{"timezone", "UTC"}])

Query

Performs a query in a Snowflake database.

Syntax:
Snowflake.Query(database: string, query: string, type: type, accountID: optional string, username: optional string, password: optional string, options: optional list)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • query: The query to execute in the database.

  • type: The type of the query result.

  • accountID: The Snowflake account identifier e.g. JC12345.eu-west-1. For more on information account identifiers check Snowflake documentation.

  • username: The database user name. Can only to be used together with 'accountID' argument.

  • password: The database user password. Can only to be used together with 'accountID' and 'username' arguments.

  • options: Extra connection options, e.g. [{"timezone", "UTC"}].

Returns
  • collection: A table with the data read from the Snowflake table.
Example:
Snowflake.Query("database", "SELECT a, b FROM schema.table", type collection(record(a: int, b: string)))

Read

Reads a Snowflake table.

Syntax:
Snowflake.Read(database: string, schema: string, table: string, type: type, accountID: optional string, username: optional string, password: optional string, options: optional list)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • schema: The database schema name.

  • table: The name of the table.

  • type: The type of the table.

  • accountID: The Snowflake account identifier e.g. JC12345.eu-west-1. For more information on account identifiers check Snowflake documentation.

  • username: The database user name. Can only to be used together with 'accountID' argument.

  • password: The database user password. Can only to be used together with 'accountID' and 'username' arguments.

  • options: Extra connection options, e.g. [{"timezone", "UTC"}].

Returns
  • collection: A table with the data read from the Snowflake table.
Example:
Snowflake.Read("database", "schema", "table", type record(id: int, name: string, salary: double))