From 6922e299ab8ed9f459aaeebb1af9f5b1a31ea178 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Sat, 7 Oct 2023 23:35:24 +0900 Subject: [PATCH] `coverage` command support loading schema.json --- cmd/coverage.go | 3 +-- cmd/ls.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/coverage.go b/cmd/coverage.go index 90e4c1f3..5ae7c93d 100644 --- a/cmd/coverage.go +++ b/cmd/coverage.go @@ -29,7 +29,6 @@ import ( "github.com/k1LoW/tbls/cmdutil" "github.com/k1LoW/tbls/config" "github.com/k1LoW/tbls/coverage" - "github.com/k1LoW/tbls/datasource" "github.com/labstack/gommon/color" "github.com/mattn/go-runewidth" "github.com/pkg/errors" @@ -65,7 +64,7 @@ var coverageCmd = &cobra.Command{ return err } - s, err := datasource.Analyze(c.DSN) + s, err := getSchemaFromJSONorDSN(c) if err != nil { return err } diff --git a/cmd/ls.go b/cmd/ls.go index f1666efc..443eae3d 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -57,7 +57,7 @@ var lsCmd = &cobra.Command{ s, err := getSchemaFromJSONorDSN(c) if err != nil { - return nil + return err } table := tablewriter.NewWriter(os.Stdout)