Skip to content

Commit

Permalink
certain db level settings in duckdb can't be set again (#6439)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anshul authored Jan 16, 2025
1 parent d2ac620 commit c3b9bef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
6 changes: 1 addition & 5 deletions runtime/drivers/duckdb/duckdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"log/slog"
"net/url"
"path/filepath"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -500,10 +499,7 @@ func (c *connection) reopenDB(ctx context.Context) error {
// We want to set preserve_insertion_order=false in hosted environments only (where source data is never viewed directly). Setting it reduces batch data ingestion time by ~40%.
// Hack: Using AllowHostAccess as a proxy indicator for a hosted environment.
if !c.config.AllowHostAccess {
bootQueries = append(bootQueries,
"SET preserve_insertion_order TO false",
fmt.Sprintf("SET secret_directory = %s", safeSQLString(filepath.Join(dataDir, ".duckdb", "secrets"))),
)
bootQueries = append(bootQueries, "SET preserve_insertion_order TO false")
}

// Add init SQL if provided
Expand Down
7 changes: 0 additions & 7 deletions runtime/pkg/rduckdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,6 @@ func (d *db) openDBAndAttach(ctx context.Context, uri, ignoreTable string, read
return err
}
}
if !read {
// disable any more configuration changes on the write handle via init queries
_, err = execer.ExecContext(ctx, "SET lock_configuration TO true", nil)
if err != nil {
return err
}
}
return nil
})
if err != nil {
Expand Down

0 comments on commit c3b9bef

Please sign in to comment.