Closed nickmarx12345678 closed 9 years ago
DB
-- SQL Setup CREATE TABLE product_prototypes ( id bigserial PRIMARY KEY, name text NOT NULL );
Running (select with no results)
package main import "gopkg.in/mgutz/dat.v1/sqlx-runner" func main() { db := runner.NewDBFromString("postgres", "postgres://localhost/dat_test?sslmode=disable") b, err := db.SelectDoc("id, name").From("product_prototypes").QueryJSON() if err != nil { panic(err) } println(string(b)) }
returns a DB error ErrNoRows == errors.New("sql: no rows in result set") http://golang.org/pkg/database/sql/
Is this intentional? Would think you'd want to not perform the scan if the result set was empty
That is by design. It's consistent with the behavior of Go's sql package.
DB
Running (select with no results)
returns a DB error ErrNoRows == errors.New("sql: no rows in result set") http://golang.org/pkg/database/sql/
Is this intentional? Would think you'd want to not perform the scan if the result set was empty