Simplify db.Open name
This commit is contained in:
parent
96b4d05330
commit
334431418e
3 changed files with 5 additions and 5 deletions
|
|
@ -71,15 +71,15 @@ func main() {
|
|||
case "init":
|
||||
db.Init(cfg, *tripleFile)
|
||||
case "load":
|
||||
ts = db.OpenTSFrom(cfg)
|
||||
ts = db.Open(cfg)
|
||||
db.Load(ts, cfg, *tripleFile, false)
|
||||
ts.Close()
|
||||
case "repl":
|
||||
ts = db.OpenTSFrom(cfg)
|
||||
ts = db.Open(cfg)
|
||||
db.Repl(ts, *queryLanguage, cfg)
|
||||
ts.Close()
|
||||
case "http":
|
||||
ts = db.OpenTSFrom(cfg)
|
||||
ts = db.Open(cfg)
|
||||
http.Serve(ts, cfg)
|
||||
ts.Close()
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ func Init(cfg *config.Config, triplePath string) bool {
|
|||
return true
|
||||
}
|
||||
if created && triplePath != "" {
|
||||
ts := OpenTSFrom(cfg)
|
||||
ts := Open(cfg)
|
||||
Load(ts, cfg, triplePath, true)
|
||||
ts.Close()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
"github.com/google/cayley/graph/mongo"
|
||||
)
|
||||
|
||||
func OpenTSFrom(cfg *config.Config) graph.TripleStore {
|
||||
func Open(cfg *config.Config) graph.TripleStore {
|
||||
glog.Infof("Opening database \"%s\" at %s", cfg.DatabaseType, cfg.DatabasePath)
|
||||
switch cfg.DatabaseType {
|
||||
case "mongo", "mongodb":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue