Skip to content

also add 's3_url_style' as env_var under DUCKDB_S3_URL_STYLE #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extension/httpfs/include/s3fs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct AWSEnvironmentCredentialsProvider {
static constexpr const char *DUCKDB_ENDPOINT_ENV_VAR = "DUCKDB_S3_ENDPOINT";
static constexpr const char *DUCKDB_USE_SSL_ENV_VAR = "DUCKDB_S3_USE_SSL";
static constexpr const char *DUCKDB_KMS_KEY_ID_ENV_VAR = "DUCKDB_S3_KMS_KEY_ID";
static constexpr const char *DUCKDB_URL_STYLE_ENV_VAR = "DUCKDB_S3_URL_STYLE";

explicit AWSEnvironmentCredentialsProvider(DBConfig &config) : config(config) {};

Expand Down
2 changes: 2 additions & 0 deletions extension/httpfs/s3fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void AWSEnvironmentCredentialsProvider::SetAll() {
this->SetExtensionOptionValue("s3_endpoint", DUCKDB_ENDPOINT_ENV_VAR);
this->SetExtensionOptionValue("s3_use_ssl", DUCKDB_USE_SSL_ENV_VAR);
this->SetExtensionOptionValue("s3_kms_key_id", DUCKDB_KMS_KEY_ID_ENV_VAR);
this->SetExtensionOptionValue("s3_url_style", DUCKDB_URL_STYLE_ENV_VAR);
}

S3AuthParams AWSEnvironmentCredentialsProvider::CreateParams() {
Expand All @@ -156,6 +157,7 @@ S3AuthParams AWSEnvironmentCredentialsProvider::CreateParams() {
params.endpoint = DUCKDB_ENDPOINT_ENV_VAR;
params.kms_key_id = DUCKDB_KMS_KEY_ID_ENV_VAR;
params.use_ssl = DUCKDB_USE_SSL_ENV_VAR;
params.url_style = DUCKDB_URL_STYLE_ENV_VAR;

return params;
}
Expand Down
5 changes: 5 additions & 0 deletions test/sql/secret/secret_aws.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ require-env DUCKDB_S3_ENDPOINT

require-env DUCKDB_S3_USE_SSL

require-env DUCKDB_S3_URL_STYLE

require httpfs

require parquet

statement ok
SET enable_logging=true

statement ok
set s3_url_style='${DUCKDB_S3_URL_STYLE}'

statement ok
set s3_use_ssl='${DUCKDB_S3_USE_SSL}'

Expand Down
5 changes: 5 additions & 0 deletions test/sql/secret/secret_refresh.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ require-env DUCKDB_S3_ENDPOINT

require-env DUCKDB_S3_USE_SSL

require-env DUCKDB_S3_URL_STYLE

require httpfs

require parquet

statement ok
SET enable_logging=true

statement ok
set s3_url_style='${DUCKDB_S3_URL_STYLE}'

statement ok
set s3_use_ssl='${DUCKDB_S3_USE_SSL}'

Expand Down
6 changes: 6 additions & 0 deletions test/sql/secret/secret_refresh_attach.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ require-env DUCKDB_S3_ENDPOINT

require-env DUCKDB_S3_USE_SSL

require-env DUCKDB_S3_URL_STYLE

require-env S3_ATTACH_DB

require httpfs
Expand All @@ -23,6 +25,9 @@ require parquet
statement ok
SET enable_logging=true

statement ok
set s3_url_style='${DUCKDB_S3_URL_STYLE}'

statement ok
set s3_use_ssl='${DUCKDB_S3_USE_SSL}'

Expand All @@ -36,6 +41,7 @@ CREATE SECRET uhuh_this_mah_sh (
REGION '${AWS_DEFAULT_REGION}',
ENDPOINT '${DUCKDB_S3_ENDPOINT}',
USE_SSL '${DUCKDB_S3_USE_SSL}',
URL_STYLE '${DUCKDB_S3_URL_STYLE}',
REFRESH 'auto'
)

Expand Down