diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..7b4d6fec33004bd49fa4e52f11b066b74214b813 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,31 @@ +## Changelog + +Dec 15th, 2016: On `db.v2`, upper-db produced queries that mutated themselves: + +``` +q := sess.SelectFrom("users") + +q.Where(...) // This method modified q's internal state. +``` + +Starting on `db.v3` this is no longer valid, if you want to use values to +represent queries you'll have to reassign them, like this: + +``` +q := sess.SelectFrom("users") + +q = q.Where(...) + +q.And(...) // Nothing happens, the Where() method does not affect q. +``` + +This applies to all query builder methods, `db.Result`, `db.And` and `db.Or`. + +If you want to check your code for statatements that might rely on the old +behaviour and could cause you trouble use `dbcheck`: + +``` +go get -u github.com/upper/cmd/dbcheck + +dbcheck github.com/my/package/... +``` diff --git a/README.md b/README.md index 72d4b05998fab65db50ec5eec1b91197113d4f41..5165d36e1ec856e5559a19e79daf34381586559d 100644 --- a/README.md +++ b/README.md @@ -88,36 +88,7 @@ go run _examples/booktown-books/main.go ## Changelog -Dec 15th, 2016: Before `2.0.0-rc8`, upper-db produced queries that mutated -themselves: - -``` -q := sess.SelectFrom("users") - -q.Where(...) // This method modified q's internal state. -``` - -Starting on `2.0.0-rc8` this is no longer valid, if you want to use values to -represent queries you'll have to reassign them, like this: - -``` -q := sess.SelectFrom("users") - -q = q.Where(...) - -q.And(...) // Nothing happens, the Where() method does not affect q. -``` - -This applies to all query builder methods, `db.Result`, `db.And` and `db.Or`. - -If you want to check your code for statatements that might rely on the old -behaviour and could cause you trouble use `dbcheck`: - -``` -go get -u github.com/upper/cmd/dbcheck - -dbcheck github.com/my/package/... -``` +See [CHANGELOG.md][https://github.com/upper/db/blob/master/CHANGELOG.md]. ## License