Showing 1 of 2 files from the diff.
Other files ignored by Codecov
cmd/root.go has changed.

@@ -4,6 +4,7 @@
Loading
4 4
	"database/sql"
5 5
	"encoding/csv"
6 6
	"encoding/json"
7 +
	"fmt"
7 8
	"io"
8 9
9 10
	"github.com/olekukonko/tablewriter"
@@ -12,6 +13,11 @@
Loading
12 13
func DisplayDB(rows *sql.Rows, w io.Writer, format string) error {
13 14
14 15
	switch format {
16 +
	case "single":
17 +
		err := single(rows, w)
18 +
		if err != nil {
19 +
			return err
20 +
		}
15 21
	case "csv":
16 22
		err := csvDisplay(rows, ',', w)
17 23
		if err != nil {
@@ -37,6 +43,35 @@
Loading
37 43
	}
38 44
	return nil
39 45
}
46 +
func single(rows *sql.Rows, write io.Writer) error {
47 +
48 +
	columns, err := rows.Columns()
49 +
	if err != nil {
50 +
		return err
51 +
	}
52 +
	pointers := make([]interface{}, len(columns))
53 +
	container := make([]sql.NullString, len(columns))
54 +
55 +
	for i := range pointers {
56 +
		pointers[i] = &container[i]
57 +
	}
58 +
	rows.Next()
59 +
	err = rows.Scan(pointers...)
60 +
	if err != nil {
61 +
		return err
62 +
	}
63 +
64 +
	r := make([]string, len(columns))
65 +
	for i, c := range container {
66 +
		if c.Valid {
67 +
			r[i] = c.String
68 +
		}
69 +
	}
70 +
71 +
	fmt.Println(r[0])
72 +
73 +
	return nil
74 +
}
40 75
41 76
func csvDisplay(rows *sql.Rows, commaChar rune, write io.Writer) error {
42 77
@@ -127,7 +162,6 @@
Loading
127 162
	table := tablewriter.NewWriter(write)
128 163
	table.SetHeader(columns)
129 164
	for rows.Next() {
130 -
131 165
		err := rows.Scan(pointers...)
132 166
		if err != nil {
133 167
			return err
@@ -147,6 +181,7 @@
Loading
147 181
			return err
148 182
		}
149 183
	}
184 +
150 185
	table.Render()
151 186
	return nil
152 187
}
Files Coverage
pkg 67.08%
Project Totals (9 files) 67.08%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading