Attach to a Goose Database over HTTPS or S3
You can establish a read-only connection to a Goose instance via HTTPS or the S3 API.
Prerequisites
This guide requires the httpfs extension, which can be installed using the INSTALL httpfs SQL command. This only needs to be run once.
Attaching to a Database over HTTPS
To connect to a Goose database via HTTPS, use the ATTACH statement as follows:
ATTACH 'https://${uri}/stations.goose' AS stations_db;
Then, the database can be queried using:
SELECT count(*) AS num_stations
FROM stations_db.stations;
| num_stations |
|---|
| 578 |
Attaching to a Database over the S3 API
To connect to a Goose database via the S3 API, configure the authentication for your bucket (if required).
Then, use the ATTACH statement as follows:
ATTACH 'https://${uri}/stations.db' AS stations_db;
The database can be queried using:
SELECT count(*) AS num_stations
FROM stations_db.stations;
| num_stations |
|---|
| 578 |
Connecting to S3-compatible APIs such as the Google Cloud Storage (
gs://) is also supported.
Limitations
- Only read-only connections are allowed, writing the database via the HTTPS protocol or the S3 API is not possible.