mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-11 10:33:08 -06:00
Un-feature-gate branch-qualified connection strings
This commit is contained in:
@@ -247,7 +247,7 @@ func getDbStates(ctx context.Context, mrEnv env.MultiRepoEnv, dbs []dsqle.Databa
|
||||
return false, nil
|
||||
})
|
||||
|
||||
if dEnv == nil && dsqle.DbRevisionsEnabled() {
|
||||
if dEnv == nil {
|
||||
init, err := pro.RevisionDbState(ctx, db.Name())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -16,7 +16,6 @@ package sqle
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -30,25 +29,8 @@ import (
|
||||
|
||||
const (
|
||||
dbRevisionDelimiter = "/"
|
||||
|
||||
enableDbRevisionsEnvKey = "DOLT_ENABLE_DB_REVISIONS"
|
||||
)
|
||||
|
||||
var dbRevisionsEnabled = true
|
||||
|
||||
func init() {
|
||||
val, ok := os.LookupEnv(enableDbRevisionsEnvKey)
|
||||
if ok {
|
||||
if strings.ToLower(val) == "true" {
|
||||
dbRevisionsEnabled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func DbRevisionsEnabled() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type DoltDatabaseProvider struct {
|
||||
databases map[string]sql.Database
|
||||
mu *sync.RWMutex
|
||||
@@ -79,18 +61,16 @@ func (p DoltDatabaseProvider) Database(name string) (db sql.Database, err error)
|
||||
return db, nil
|
||||
}
|
||||
|
||||
if dbRevisionsEnabled { // feature flagged
|
||||
db, ok, err = p.databaseForRevision(context.Background(), name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if ok {
|
||||
p.mu.Lock()
|
||||
defer p.mu.Unlock()
|
||||
db, ok, err = p.databaseForRevision(context.Background(), name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if ok {
|
||||
p.mu.Lock()
|
||||
defer p.mu.Unlock()
|
||||
|
||||
p.databases[name] = db
|
||||
return db, nil
|
||||
}
|
||||
p.databases[name] = db
|
||||
return db, nil
|
||||
}
|
||||
|
||||
return nil, sql.ErrDatabaseNotFound.New(name)
|
||||
|
||||
Reference in New Issue
Block a user