snowflake.core.FQNΒΆ

class snowflake.core.FQN(database: str | None, schema: str | None, name: str, signature: str | None = None)ΒΆ

Bases: object

Represents an object identifier, supporting fully qualified names.

The instance supports builder pattern that allows updating the identifier with database and schema from different sources.

Examples

>>> fqn = FQN.from_string("my_schema.object").using_connection(conn)
Copy
>>> fqn = FQN.from_string("my_name").set_database("db").set_schema("foo")
Copy

Attributes

databaseΒΆ
identifierΒΆ
nameΒΆ
prefixΒΆ

Methods

classmethod from_string(identifier: str) β†’ FQNΒΆ

Take in an object name in the form [[database.]schema.]name and return a new FQN instance.

Raises:

InvalidIdentifierError – If the object identifier does not meet identifier requirements.

set_database(database: str | None) β†’ FQNΒΆ
set_name(name: str) β†’ FQNΒΆ
set_schema(schema: str | None) β†’ FQNΒΆ
to_dict() β†’ dict[str, str | None]ΒΆ

Return the dictionary representation of the instance.

using_connection(conn: SnowflakeConnection) β†’ FQNΒΆ

Update the instance with database and schema from connection.