Skip to content

Releases: doug-martin/goqu

v8.3.1

16 Aug 20:18
e4e4e25
Compare
Choose a tag to compare
  • [FIXED] InsertDataset.WithDialect return old dataset #126 - @chen56
  • Test clean up and more testing pattern consistency
    • Changed to use assertion methods off of suite
    • Updated Equals assertions to have expected output first
  • Increase overall test coverage.

v8.3.0

04 Aug 06:37
3237124
Compare
Choose a tag to compare
  • [Added] Support for DISTINCT ON clauses #119

v8.2.2

03 Aug 22:56
2137511
Compare
Choose a tag to compare
  • [FIX] Scanner errors on pointers to primitive values #122

v8.2.1

02 Aug 05:16
0ba9f96
Compare
Choose a tag to compare
  • Return an error when an empty identifier is encountered #115

v8.2.0

01 Aug 23:50
964b99c
Compare
Choose a tag to compare
  • [FIX] Fix reflection errors related to nil pointers and unexported fields #118
    • Unexported fields are ignored when creating a columnMap
    • Nil embedded pointers will no longer cause a panic
    • Fields on nil embedded pointers will be ignored when creating update or insert statements.
  • [ADDED] You can now ingore embedded structs and their fields by using db:"-" tag on the embedded struct.

v8.1.0

26 Jul 20:54
e59cc9e
Compare
Choose a tag to compare
  • [ADDED] Support column DEFAULT when inserting/updating via struct #27

v8.0.1

26 Jul 01:54
4a84b3e
Compare
Choose a tag to compare
  • [ADDED] Multi table update support for mysql and postgres #60
  • [ADDED] goqu.V so values can be used on the LHS of expressions #104

v8.0.0

25 Jul 03:44
f38b0e2
Compare
Choose a tag to compare

A major change the the API was made in v8 to seperate concerns between the different SQL statement types.

Why the change?

  1. There were feature requests that could not be cleanly implemented with everything in a single dataset.
  2. Too much functionality was encapsulated in a single datastructure.
    • It was unclear what methods could be used for each SQL statement type.
    • Changing a feature for one statement type had the possiblity of breaking another statement type.
    • Test coverage was decent but was almost solely concerned about SELECT statements, breaking them up allowed for focused testing on each statement type.
    • Most the SQL generation methods (ToInsertSQL, ToUpdateSQL etc.) took arguments which lead to an ugly API that was not uniform for each statement type, and proved to be inflexible.

What Changed

There are now five dataset types, SelectDataset, InsertDataset, UpdateDataset, DeleteDataset and TruncateDataset

Each dataset type has its own entry point.

  • goqu.From, Database#From, DialectWrapper#From - Create SELECT
  • goqu.Insert, Database#Insert, DialectWrapper#Insert - Create INSERT
  • goqu.Update, Database#db.Update, DialectWrapper#Update - Create UPDATE
  • goqu.Delete, Database#Delete, DialectWrapper#Delete - Create DELETE
  • goqu.Truncate, Database#Truncate, DialectWrapper#Truncate - Create TRUNCATE

ToInsertSQL, ToUpdateSQL, ToDeleteSQL, and ToTruncateSQL (and variations of them) methods have been removed from the SelectDataset. Instead use the ToSQL methods on each dataset type.

Each dataset type will have an Executor and ToSQL method so a common interface can be created for each type.

v7.4.0

24 Jul 20:16
4190746
Compare
Choose a tag to compare
  • [FIXED] literalTime use t.UTC() , This behavior is different from the original sql.DB #106 - @chen56
  • [ADDED] Add new method WithTx for Database #108 - @Xuyuanp

v7.3.1

12 Jul 21:40
c7d8e67
Compare
Choose a tag to compare
  • [ADDED] Exposed goqu.NewTx to allow creating a goqu tx directly from a sql.Tx instead of using goqu.Database#Begin #95
  • [ADDED] goqu.Database.BeginTx #98