Skip to main content

CREATE CONNECTION

Introduced or updated: v1.2.339

Creates a connection to external storage.

Syntax

CREATE [ OR REPLACE ] CONNECTION [ IF NOT EXISTS ] <connection_name> 
STORAGE_TYPE = '<type>'
[ <storage_params> ]

ParameterDescription
STORAGE_TYPEType of storage service. Possible values include: s3, azblob, gcs, oss, cos, hdfs, and webhdfs.
storage_paramsVary based on storage type and authentication method. See Connection Parameters for details.

Examples

This example creates a connection to Amazon S3 named 'toronto' and establishes an external stage named 'my_s3_stage' linked to the 's3://databend-toronto' URL, using the 'toronto' connection. For more practical examples about connection, see Usage Examples.

CREATE CONNECTION toronto 
STORAGE_TYPE = 's3'
SECRET_ACCESS_KEY = '<your-secret-access-key>'
ACCESS_KEY_ID = '<your-access-key-id>';

CREATE STAGE my_s3_stage
URL = 's3://databend-toronto'
CONNECTION = (CONNECTION_NAME = 'toronto');
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today