Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
integration to pass mdbx.Accede flag (ledgerwatch#4719)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Jul 15, 2022
1 parent 759e77c commit f18a5b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/integration/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ledgerwatch/erigon/migrations"
"github.com/ledgerwatch/log/v3"
"github.com/spf13/cobra"
"github.com/torquem-ch/mdbx-go/mdbx"
)

var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -46,6 +47,9 @@ func dbCfg(label kv.Label, logger log.Logger, path string) kv2.MdbxOpts {
}

func openDB(opts kv2.MdbxOpts, applyMigrations bool) kv.RwDB {
// integration tool don't intent to create db, then easiest way to open db - it's pass mdbx.Accede flag, which allow
// to read all options from DB, instead of overriding them
opts = opts.Flags(func(f uint) uint { return f | mdbx.Accede })
db := opts.MustOpen()
if applyMigrations {
migrator := migrations.NewMigrator(opts.GetLabel())
Expand Down

0 comments on commit f18a5b0

Please sign in to comment.