Datasource configurations are set in the Data/Datasource panel of the Domino UI. You can update it there for any permanent change.
Some configuration attributes can be overridden locally in the API. Each datasource type config is described in the Classes section below.
You can create a configuration override with any of the config classes and update your datasource entity:
from domino.data_sources import DataSourceClient, SnowflakeConfig
snowflake = DataSourceClient().get_datasource("snowflake-prod")
# Build a override config with a different warehouse than configured in Domino
config_xxl = SnowflakeConfig(warehouse="compute-xxl")
# Local update with no permanent change
snowflake.update(config=config_xxl)
res = snowflake.query("SELECT COUNT(*) FROM very_large_table")
# Override can also be used for temporary credentials
snowflake.update(config=SnowflakeConfig(username="admin", password="<password>"))
res = snowflake.query("SELECT secret_data FROM secret_table LIMIT 10")
To remove the configuration override, simply reset it:
from domino.data_sources import DataSourceClient, SnowflakeConfig
snowflake = DataSourceClient().get_datasource("snowflake-prod")
# Update to dev database
snowflake.update(SnowflakeConfig(database="dev"))
# Reset to default values
snowflake.reset_config()
res = snowflake.query("SELECT * FROM prod_table")
GenericS3
class domino_data.data_sources.GenericS3Config(*, bucket=None, host=None, region=None, aws_access_key_id=None, aws_secret_access_key=None)[source]
Generic S3 datasource configuration.
-
aws_access_key_id
: Optional[str] -
aws_secret_access_key
: Optional[str] -
bucket
: Optional[str] -
host
: Optional[str] -
region
: Optional[str]
MySQL
class domino_data.data_sources.MySQLConfig(*, database=None, password=None, username=None, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None)[source]
MySQL datasource configuration.
-
aws_access_key_id
: Optional[str] -
aws_secret_access_key
: Optional[str] -
aws_session_token
: Optional[str] -
database
: Optional[str] -
password
: Optional[str] -
username
: Optional[str]
PostgreSQL
class domino_data.data_sources.PostgreSQLConfig(*, database=None, password=None, username=None, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None)[source]
PostgreSQL datasource configuration.
-
aws_access_key_id
: Optional[str] -
aws_secret_access_key
: Optional[str] -
aws_session_token
: Optional[str] -
database
: Optional[str] -
password
: Optional[str] -
username
: Optional[str]
Redshift
class domino_data.data_sources.RedshiftConfig(*, database=None, password=None, username=None, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None)[source]
Redshift datasource configuration.
-
aws_access_key_id
: Optional[str] -
aws_secret_access_key
: Optional[str] -
aws_session_token
: Optional[str] -
database
: Optional[str] -
password
: Optional[str] -
username
: Optional[str]
S3
classd omino_data.data_sources.S3Config(profile=None, *, bucket=None, region=None, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None)[source]
-
S3 datasource configuration.
-
aws_access_key_id
: Optional[str] -
aws_secret_access_key
: Optional[str] -
aws_session_token
: Optional[str] -
bucket
: Optional[str] -
profile
: Optional[str] -
region
: Optional[str]
Snowflake
class domino_data.data_sources.SnowflakeConfig(*, database=None, schema=None, warehouse=None, role=None, password=None, username=None, token=None)[source]
Snowflake datasource configuration.
-
database
: Optional[str] -
password
: Optional[str] -
role
: Optional[str] -
schema
: Optional[str] -
token
: Optional[str] -
username
: Optional[str] -
warehouse
: Optional[str]