Skip to main content

Google Cloud Storage Import

SereneDB can read and write Google Cloud Storage (GCS) over HTTP(S) directly.

Credentials and Configuration​

You need to create HMAC keys and declare them:

Query
CREATE SECRET (    TYPE gcs,    KEY_ID '⟨AKIAIOSFODNN7EXAMPLE⟩',    SECRET '⟨wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY⟩');

Querying​

After setting up the GCS credentials, you can query the GCS data using:

Query
SELECT *FROM read_parquet('gs://⟨gcs_bucket⟩/⟨file.parquet⟩');
Result
 id | name  | value----+-------+-------  1 | alpha |    10  2 | beta  |    20

Attaching to a Database​

You can attach to a database file in read-only mode:

Query
ATTACH 'gs://⟨gcs_bucket⟩/⟨file.duckdb⟩' AS ⟨duckdb_database⟩ (READ_ONLY);

Databases in Google Cloud Storage can only be attached in read-only mode.