fix(pkg/daemon): save measured values into postgres database if defined
This commit is contained in:
11
cmd/db/db.go
11
cmd/db/db.go
@ -5,7 +5,8 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/Masterminds/semver"
|
||||
database "github.com/go-flucky/flucky/pkg/db"
|
||||
"github.com/go-flucky/flucky/pkg/config"
|
||||
database "github.com/go-flucky/flucky/pkg/storage/db"
|
||||
"github.com/go-flucky/flucky/pkg/types"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@ -21,7 +22,13 @@ var dbCmd = &cobra.Command{
|
||||
Short: "Operates with the configured database",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
postgresDB, err := database.New(database.DBOTypePostgres, "localhost", "5432", "postgres", "postgres", "postgres")
|
||||
// read configuration
|
||||
cnf, err := config.Read(*configFile)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
postgresDB, err := database.New(cnf.DatabaseSettings)
|
||||
if err != nil {
|
||||
log.Fatalf("%v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user