func TestCount_Cases(t *testing.T) {
	cases := []struct {
		where string
		args  []interface{}
		count int
	}{
		{
			"id=?",
			[]interface{}{999},
			0,
		},
		{
			"id=?",
			[]interface{}{1},
			1,
		},
		{
			"",
			[]interface{}{},
			2,
		},
	}
	for _, c := range cases {
		t.Run(strconv.Itoa(c.count), func(t *testing.T) {
			tx := newTxForCount(t)
			count, err := query.Count(tx, "test", c.where, c.args...)
			if err != nil {
				t.Errorf("expected err to be nil: %v", err)
			}
			if expected, actual := c.count, count; expected != actual {
				t.Errorf("expected: %v, actual: %v", expected, actual)
			}
		})
	}
}
Count returns the current number of rows.
package query_test
import (
	"database/sql"
	"strconv"
	"testing"
	"github.com/spoke-d/thermionic/internal/db/database"
	"github.com/spoke-d/thermionic/internal/db/query"
)