snowflake.core.database.Database¶
- class snowflake.core.database.Database(name: str, created_on: datetime | None = None, kind: str | None = 'PERMANENT', is_default: bool | None = None, is_current: bool | None = None, origin: str | None = None, owner: str | None = None, comment: str | None = None, options: str | None = None, retention_time: int | None = None, dropped_on: datetime | None = None, budget: str | None = None, owner_role_type: str | None = None, data_retention_time_in_days: int | None = None, default_ddl_collation: str | None = None, log_level: str | None = None, max_data_extension_time_in_days: int | None = None, suspend_task_after_num_failures: int | None = None, trace_level: str | None = None, user_task_managed_initial_warehouse_size: str | None = None, user_task_timeout_ms: int | None = None)¶
Bases:
object
A model object representing the Database resource.
Constructs an object of type Database with the provided properties.
- Parameters:
name (str) – A Snowflake object identifier.
created_on (datetime, optional) – Date and time the database was created.
kind (str, default 'PERMANENT') – Database type, permanent (default) or transient.
is_default (bool, optional) – Whether the database is the default database for a user.
is_current (bool, optional) – Current database for the session.
origin (str, optional)
owner (str, optional) – Name of the role that owns the database.
comment (str, optional) – Optional comment in which to store information related to the database.
options (str, optional)
retention_time (int, optional) – Number of days that historical data is retained for Time Travel.
dropped_on (datetime, optional) – Date and time the database was dropped.
budget (str, optional) – Budget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects.
owner_role_type (str, optional) – Type of role that owns the object, either ROLE or DATABASE_ROLE
data_retention_time_in_days (int, optional) – Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the database, as well as specifying the default Time Travel retention time for all schemas created in the database.
default_ddl_collation (str, optional) – Default collation specification for all schemas and tables added to the database. You an override the default at the schema and individual table levels.
log_level (str, optional) – Severity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only TRACE, DEBUG, INFO, WARN, ERROR, FATAL and OFF.
max_data_extension_time_in_days (int, optional) – Maximum number of days for which Snowflake can extend the data retention period for tables in the database to prevent streams on the tables from becoming stale.
suspend_task_after_num_failures (int, optional) – Maximum number of consecutive failed task runs before the current task is suspended automatically.
trace_level (str, optional) – How trace events are ingested into the event table. Currently, Snowflake supports only ALWAYS, ON_EVENT, and OFF.
user_task_managed_initial_warehouse_size (str, optional) – Size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size.
user_task_timeout_ms (int, optional) – Time limit, in milliseconds, for a single run of the task before it times out.
Methods
- classmethod from_dict(obj: dict) DatabaseModel ¶
Creates an instance of Database from a dict.
This method constructs a Database object from a dictionary with the key-value pairs of its properties.
- Parameters:
obj (dict) – A dictionary whose keys and values correspond to the properties of the resource object.
- Returns:
A Database object created using the input dictionary; this will fail if the required properties are missing.
- Return type:
- to_dict()¶
Creates a dictionary of the properties from a Database.
This method constructs a dictionary with the key-value entries corresponding to the properties of the Database object.
- Returns:
A dictionary object created using the input model.
- Return type:
dict