snowflake.core.Identifier¶
- class snowflake.core.Identifier(value: Identifier | IdentifierString | str)¶
Bases:
objectRepresents a Snowflake object identifier.
The original spelling is preserved, while equality and hashing follow Snowflake’s identifier rules. Unlike
IdentifierString, instances representing the same Snowflake object compare equal.- Raises:
ValueError – If value is not a valid SQL identifier.
TypeError – If value is not an
IdentifierLike.
Methods
- classmethod from_canonical_name(name: CanonicalName) Identifier¶
Build an
Identifierthat resolves to name.- Parameters:
name (CanonicalName) – Canonical (case-sensitive, unquoted) Snowflake object name.
- Returns:
An identifier whose spelling resolves to name.
- Return type:
- to_identifier_string() IdentifierString¶
Return this identifier’s current spelling as an
IdentifierString.Unlike
Identifierequality, the result compares character-for-character. Equivalent spellings of the same Snowflake object (for examplefoo,FOO, and"FOO") are distinct values.- Returns:
The current spelling as a plain
strat runtime but with a distinct type for linting.- Return type:
IdentifierString
- with_normalized_spelling() Identifier¶
Return an
Identifierwhose spelling is a normalized form.Normalized here means the spelling for two logically equivalent identifiers is the same. Identity is unchanged.
- Returns:
An identifier with normalized spelling.
- Return type:
- with_quoted_spelling() Identifier¶
Return an
Identifierwhose spelling is quoted.Unquoted identifiers are quoted with
quote_name(). Already quoted identifiers keep their existing spelling. Identity is unchanged.- Returns:
An identifier whose original spelling is a double-quoted Snowflake identifier.
- Return type: