Skip to main content
Version: Next

DatabaseRestApi.post

allow_ctasboolean

Allow CREATE TABLE AS option in SQL Lab

allow_cvasboolean

Allow CREATE VIEW AS option in SQL Lab

allow_dmlboolean

Allow users to run non-SELECT statements (UPDATE, DELETE, CREATE, ...) in SQL Lab

allow_file_uploadboolean

Allow to upload CSV file data into this databaseIf selected, please set the schemas allowed for csv upload in Extra.

allow_run_asyncboolean

Operate the database in asynchronous mode, meaning that the queries are executed on remote workers as opposed to on the web server itself. This assumes that you have a Celery worker setup as well as a results backend. Refer to the installation docs for more information.

cache_timeoutintegernullable

Duration (in seconds) of the caching timeout for charts of this database. A timeout of 0 indicates that the cache never expires. Note this defaults to the global timeout if undefined.

configuration_method

Configuration_method is used on the frontend to inform the backend whether to explode parameters or to provide only a sqlalchemy_uri.

Possible values: [sqlalchemy_form, dynamic_form]

Default value: sqlalchemy_form
database_namestringrequired

A database name to identify this connection.

Possible values: non-empty and <= 250 characters

driverstringnullable

SQLAlchemy driver to use

enginestringnullable

SQLAlchemy engine to use

expose_in_sqllabboolean

Expose this database to SQLLab

external_urlstringnullable
extrastring

JSON string containing extra configuration elements.
1. The engine_params object gets unpacked into the sqlalchemy.create_engine call, while the metadata_params gets unpacked into the sqlalchemy.MetaData call.
2. The metadata_cache_timeout is a cache timeout setting in seconds for metadata fetch of this database. Specify it as "metadata_cache_timeout": {"schema_cache_timeout": 600, "table_cache_timeout": 600}. If unset, cache will not be enabled for the functionality. A timeout of 0 indicates that the cache never expires.
3. The schemas_allowed_for_file_upload is a comma separated list of schemas that CSVs are allowed to upload to. Specify it as "schemas_allowed_for_file_upload": ["public", "csv_upload"]. If database flavor does not support schema or any schema is allowed to be accessed, just leave the list empty
4. The version field is a string specifying the this db's version. This should be used with Presto DBs so that the syntax is correct
5. The allows_virtual_table_explore field is a boolean specifying whether or not the Explore button in SQL Lab results is shown.
6. The disable_data_preview field is a boolean specifying whether or not data preview queries will be run when fetching table metadata in SQL Lab.7. The disable_drill_to_detail field is a boolean specifying whether or notdrill to detail is disabled for the database.8. The allow_multi_catalog indicates if the database allows changing the default catalog when running queries and creating datasets.

force_ctas_schemastringnullable

When allowing CREATE TABLE AS option in SQL Lab, this option forces the table to be created in this schema

Possible values: <= 250 characters

impersonate_userboolean

If Presto, all the queries in SQL Lab are going to be executed as the currently logged on user who must have permission to run them.
If Hive and hive.server2.enable.doAs is enabled, will run the queries as service account, but impersonate the currently logged on user via hive.server2.proxy.user property.

is_managed_externallybooleannullable
masked_encrypted_extrastringnullable

JSON string containing additional connection configuration.
This is used to provide connection information for systems like Hive, Presto, and BigQuery, which do not conform to the username:password syntax normally used by SQLAlchemy.

parameters object

DB-specific parameters for configuration

property name*any

DB-specific parameters for configuration

server_certstringnullable

Optional CA_BUNDLE contents to validate HTTPS requests. Only available on certain database engines.

sqlalchemy_uristring

Refer to the SqlAlchemy docs for more information on how to structure your URI.

Possible values: non-empty and <= 1024 characters

ssh_tunnel objectnullable
idintegernullable

SSH Tunnel ID (for updates)

passwordstring
private_keystring
private_key_passwordstring
server_addressstring
server_portinteger
usernamestring
uuidstring
DatabaseRestApi.post
{
"allow_ctas": true,
"allow_cvas": true,
"allow_dml": true,
"allow_file_upload": true,
"allow_run_async": true,
"cache_timeout": 0,
"database_name": "string",
"driver": "string",
"engine": "string",
"expose_in_sqllab": true,
"external_url": "string",
"extra": "string",
"force_ctas_schema": "string",
"impersonate_user": true,
"is_managed_externally": true,
"masked_encrypted_extra": "string",
"parameters": {},
"server_cert": "string",
"sqlalchemy_uri": "string",
"ssh_tunnel": {
"id": 0,
"password": "string",
"private_key": "string",
"private_key_password": "string",
"server_address": "string",
"server_port": 0,
"username": "string"
},
"uuid": "string"
}