Skip to content

snowflake

etl_craft.dialects.warehouse.snowflake

Snowflake warehouse, ordinary tables.

SnowflakeWarehouse

Bases: WarehouseDialect

Snowflake, ordinary tables.

identity_table_ddl

identity_table_ddl(target: str, columns: str, params: Mapping[str, str]) -> str

Use an ordered native identity; inserts omit the managed key.

identity_replacement_ddl

identity_replacement_ddl(conn: Connection, target: str, candidate: str, columns: str, params: Mapping[str, str], *, existing: bool) -> tuple[str, str]

Clone a fully populated identity candidate, preserving the target's grants.

is_bigint_type

is_bigint_type(data_type: str) -> bool

Recognize native and Iceberg BIGINT's Snowflake numeric representations.

existing_table_format

existing_table_format(conn: Connection, target: str) -> TableFormat

Read Snowflake's native/Iceberg flag in the target's own database.

row_id_generated

row_id_generated(conn: Connection, target: str) -> bool

Recognize actual native identity metadata, including targets created before this run.

present

present(profile: ConnectionProfile, secret: str, url: WarehouseUrl) -> Presented

Name the connector's own authenticator for oauth, sso and sts.

timestamp_text

timestamp_text(value: str, kind: str) -> str

Format UTC instants and naive UTC values without session format defaults.

date_text

date_text(value: str) -> str

Ignore DATE_OUTPUT_FORMAT.

decimal_text

decimal_text(value: str, kind: str) -> str

Keep every declared fractional digit without integer padding.

replacement_ddl

replacement_ddl(conn: Connection, target: str, select_sql: str, params: Mapping[str, str], *, existing: bool) -> str

Preserve the existing table's declared properties in one CTAS replacement.

overwrite_statement

overwrite_statement(target: str, columns: str, select_sql: str) -> str

Commit deletion and insertion together, retaining the table definition.