Skip to content

Releases: blockloop/scan

v2.5.0

31 Aug 21:14
4741cc8
Compare
Choose a tag to compare

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

23 Aug 00:42
644ce11
Compare
Choose a tag to compare

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

22 Aug 22:38
9c197bf
Compare
Choose a tag to compare

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

04 Aug 17:36
27488e2
Compare
Choose a tag to compare

What's Changed

New Contributors

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

v2.2.0

27 Jul 21:49
3e43b34
Compare
Choose a tag to compare

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

15 Jul 23:32
0eac140
Compare
Choose a tag to compare

What's Changed

New Contributors

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

v2.0.1

31 Mar 01:48
4dd2896
Compare
Choose a tag to compare

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

Nested Struct Scanning

01 Jun 17:39
e5bd08a
Compare
Choose a tag to compare

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"}}