Skip to content

Releases: blockloop/scan

v2.5.0

Choose a tag to compare

@blockloop blockloop released this 31 Aug 21:14
4741cc8

What's Changed

  • Added support for custom columns names mapper functions by @mzahradnicek in #70

New Contributors

Full Changelog: v2.4.0...v2.5.0

v2.4.0

Choose a tag to compare

@blockloop blockloop released this 23 Aug 00:42
644ce11

What's Changed

  • fix: Columns and Values should recognize Slice values too by @max-stytch in #68

Full Changelog: v2.3.0...v2.4.0

v2.3.0

Choose a tag to compare

@blockloop blockloop released this 22 Aug 22:38
9c197bf

What's Changed

  • Bump golang.org/x/text from 0.9.0 to 0.12.0 by @dependabot in #64
  • Bump github.com/proullon/ramsql from 0.0.0-20181213202341-817cee58a244 to 0.0.1 by @dependabot in #58
  • fix: Columns and Values should recognize pointer values too by @taronish-stytch in #67

Full Changelog: v2.2.1...v2.3.0

v2.2.1

Choose a tag to compare

@blockloop blockloop released this 04 Aug 17:36
27488e2

What's Changed

New Contributors

Full Changelog: v2.2.0...v2.2.1

v2.2.0

Choose a tag to compare

@blockloop blockloop released this 27 Jul 21:49
3e43b34

What's Changed

  • fix: Use model.Type() as cache key instead of model itself by @max-stytch in #62

New Contributors

Full Changelog: v2.1.0...v2.2.0

v2.1.0 nested structs for columns and values

Choose a tag to compare

@blockloop blockloop released this 15 Jul 23:32
0eac140

What's Changed

New Contributors

Full Changelog: v2.0.1...v2.1.0

v2.0.1

Choose a tag to compare

@blockloop blockloop released this 31 Mar 01:48
4dd2896

Fixed an issue where AutoClose didn't close early enough and could have caused a leak

Nested Struct Scanning

Choose a tag to compare

@blockloop blockloop released this 01 Jun 17:39
e5bd08a

This release adds the ability to scan to a nested struct.

rows, err := db.Query(`
	SELECT person.id,person.name,company.name FROM person
	JOIN company on company.id = person.company_id
	LIMIT 1
`)

var person struct {
	ID      int    `db:"person.id"`
	Name    string `db:"person.name"`
	Company struct {
		Name string `db:"company.name"`
	}
}

err = scan.RowStrict(&person, rows)

err = json.NewEncoder(os.Stdout).Encode(&person)
// Output:
// {"ID":1,"Name":"brett","Company":{"Name":"costco"}}