1
0
Fork 0

Remove explicit control of FK constraints

It's not clear whether it's the right thing to do, and FK constraints
can still be controlled via PRAGMA commands.
master
Philip O'Toole 8 years ago
parent 9ffa309f69
commit 39ebf50cb7

@ -80,7 +80,6 @@ var pprofEnabled bool
var dsn string
var onDisk bool
var noVerifySelect bool
var noFKCheck bool
var raftSnapThreshold uint64
var raftHeartbeatTimeout string
var showVersion bool
@ -104,7 +103,6 @@ func init() {
flag.StringVar(&dsn, "dsn", "", `SQLite DSN parameters. E.g. "cache=shared&mode=memory"`)
flag.BoolVar(&onDisk, "ondisk", false, "Use an on-disk SQLite database")
flag.BoolVar(&noVerifySelect, "nosel", false, "Don't verify that all queries begin with SELECT")
flag.BoolVar(&noFKCheck, "nofk", false, "Don't enforce foreign key constraints")
flag.BoolVar(&showVersion, "version", false, "Show version information and exit")
flag.StringVar(&raftHeartbeatTimeout, "rafttimeout", "1s", "Raft heartbeat timeout")
flag.Uint64Var(&raftSnapThreshold, "raftsnap", 8192, "Number of outstanding log entries that trigger snapshot")
@ -168,7 +166,6 @@ func main() {
log.Fatalf("failed to determine absolute data path: %s", err.Error())
}
dbConf := store.NewDBConfig(dsn, !onDisk)
dbConf.NoFK = noFKCheck
store := store.New(dbConf, dataPath, raftTn)
if err := store.Open(joinAddr == ""); err != nil {

@ -139,7 +139,6 @@ func (c *clusterMeta) AddrForPeer(addr string) string {
type DBConfig struct {
DSN string // Any custom DSN
Memory bool // Whether the database is in-memory only.
NoFK bool // Disable foreign key constraints
}
// NewDBConfig returns a new DB config instance.
@ -195,12 +194,6 @@ func (s *Store) Open(enableSingle bool) error {
}
s.db = db
// Configure foreign key constraints.
if err := s.db.EnableFKConstraints(!s.dbConf.NoFK); err != nil {
return err
}
s.logger.Printf("SQLite foreign key constraints %s", enabledFromBool(!s.dbConf.NoFK))
// Get the Raft configuration for this store.
config := s.raftConfig()

Loading…
Cancel
Save