MCPcopy
hub / github.com/jmoiron/sqlx / TestSelectSliceMapTime

Function TestSelectSliceMapTime

sqlx_test.go:545–572  ·  sqlx_test.go::TestSelectSliceMapTime
(t *testing.T)

Source from the content-addressed store, hash-verified

543}
544
545func TestSelectSliceMapTime(t *testing.T) {
546 RunWithSchema(defaultSchema, t, func(db *DB, t *testing.T, now string) {
547 loadDefaultFixture(db, t)
548 rows, err := db.Queryx("SELECT * FROM person")
549 if err != nil {
550 t.Fatal(err)
551 }
552 for rows.Next() {
553 _, err := rows.SliceScan()
554 if err != nil {
555 t.Error(err)
556 }
557 }
558
559 rows, err = db.Queryx("SELECT * FROM person")
560 if err != nil {
561 t.Fatal(err)
562 }
563 for rows.Next() {
564 m := map[string]interface{}{}
565 err := rows.MapScan(m)
566 if err != nil {
567 t.Error(err)
568 }
569 }
570
571 })
572}
573
574func TestNilReceiver(t *testing.T) {
575 RunWithSchema(defaultSchema, t, func(db *DB, t *testing.T, now string) {

Callers

nothing calls this directly

Calls 7

RunWithSchemaFunction · 0.85
loadDefaultFixtureFunction · 0.85
NextMethod · 0.80
ErrorMethod · 0.80
QueryxMethod · 0.65
SliceScanMethod · 0.45
MapScanMethod · 0.45

Tested by

no test coverage detected