Skip to content

Commit

Permalink
Default to MotherDuck provided refresh timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed Feb 11, 2025
1 parent 9fae3f3 commit 7783fb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pgduckdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int duckdb_motherduck_enabled = MotherDuckEnabled::MOTHERDUCK_AUTO;
char *duckdb_motherduck_token = strdup("");
char *duckdb_motherduck_postgres_database = strdup("postgres");
char *duckdb_motherduck_default_database = strdup("");
char *duckdb_motherduck_background_catalog_refresh_inactivity_timeout = strdup("5 minutes");
char *duckdb_motherduck_background_catalog_refresh_inactivity_timeout = strdup("");
char *duckdb_postgres_role = strdup("");

int duckdb_maximum_threads = -1;
Expand Down
3 changes: 2 additions & 1 deletion src/pgduckdb_duckdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ DuckDBManager::Initialize() {
pgduckdb::DuckDBQueryOrThrow(context, "ATTACH DATABASE 'pgduckdb' (TYPE pgduckdb)");
pgduckdb::DuckDBQueryOrThrow(context, "ATTACH DATABASE ':memory:' AS pg_temp;");

if (pgduckdb::IsMotherDuckEnabled()) {
if (pgduckdb::IsMotherDuckEnabled() &&
strlen(duckdb_motherduck_background_catalog_refresh_inactivity_timeout) > 0) {
pgduckdb::DuckDBQueryOrThrow(context, "SET motherduck_background_catalog_refresh_inactivity_timeout=" +
duckdb::KeywordHelper::WriteQuoted(
duckdb_motherduck_background_catalog_refresh_inactivity_timeout));
Expand Down

0 comments on commit 7783fb3

Please sign in to comment.