From 277e3e70f5517ab9eec96b3a50c8bd4983c4f808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Nieto?= <jose.carlos@menteslibres.net> Date: Fri, 16 Dec 2016 18:38:31 +0000 Subject: [PATCH] Add CHANGELOG.md --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ README.md | 31 +------------------------------ 2 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..7b4d6fec --- /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 72d4b059..5165d36e 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 -- GitLab