GitPedia
Home/upper/db/Changelog
upper

upper/db

Data Access Layer (DAL) for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.

30 Releases
Latest: 1y ago
v4.10.0Latest
xiamxiam·1y ago·March 9, 2025
GitHub

📋 What's Changed

  • migrate mongodb driver by @xiam in https://github.com/upper/db/pull/724
  • upgrade depencencies by @xiam in https://github.com/upper/db/pull/725
  • Full Changelog: https://github.com/upper/db/compare/v4.9.0...v4.10.0
v4.9.0
xiamxiam·1y ago·September 8, 2024
GitHub

📋 What's Changed

  • upgrade to pgx/v5 by @xiam in https://github.com/upper/db/pull/715
  • Full Changelog: https://github.com/upper/db/compare/v4.8.0...v4.9.0
v4.8.0
xiamxiam·1y ago·June 23, 2024
GitHub

📋 What's Changed

  • cockroachdb: fix tests with DELETE and LIMIT by @xiam in https://github.com/upper/db/pull/701
  • test suite maintenance by @xiam in https://github.com/upper/db/pull/713
  • Full Changelog: https://github.com/upper/db/compare/v4.7.0...v4.8.0
v4.7.0
xiamxiam·2y ago·November 5, 2023
GitHub

Maintenance release with dependency upgrades.

Release v4.6.0-rc1v4.6.0-rc1
xiamxiam·3y ago·August 30, 2022
GitHub

This release includes memory and speed optimizations.

Release v4.6.0v4.6.0
xiamxiam·3y ago·September 4, 2022
GitHub

This release includes memory and speed optimizations.

Release v4.5.4v4.5.4
xiamxiam·3y ago·June 25, 2022
GitHub
Release v4.5.3v4.5.3
xiamxiam·4y ago·June 17, 2022
GitHub
Release v4.5.2v4.5.2
xiamxiam·4y ago·March 8, 2022
GitHub
v4.5.0
xiamxiam·4y ago·January 3, 2022
GitHub

📦 Upgrading your codebase

  • For instance, if your struct looks like this:
  • ```go
  • type Foo struct {
  • ID uint64 `db:"id"`
  • Names *[]string `db:"names"`
  • }
  • ```
  • you'll have to convert it into:
  • + 60 more

📋 What's Changed

  • Replace lib/pq with pgx by @xiam in https://github.com/upper/db/pull/627
  • Fix sqlite.New panic by @sdvcrx in https://github.com/upper/db/pull/635
  • Fix condition that forced the statement cache to be skipped by @xiam in https://github.com/upper/db/pull/638

New Contributors

  • @sdvcrx made their first contribution in https://github.com/upper/db/pull/635

📦 Acknowledgements

  • Special thanks to @pkieltyka and [Horizon Blockchain Games](https://horizon.io/) for their continuos support over the years! Thank you very much
  • Full Changelog: https://github.com/upper/db/compare/v4.2.1...v4.5.0
v4.5.0-rc3Pre-release
xiamxiam·4y ago·January 3, 2022
GitHub
v4.5.0-rc2Pre-release
xiamxiam·4y ago·January 3, 2022
GitHub
v4.2.1
xiamxiam·4y ago·July 13, 2021
GitHub

Added `db.AnyOf` and `db.NotAnyOf`, which work like `db.In` and `db.NotIn`, except they accept a slice of any type.

v4.2.0
xiamxiam·4y ago·June 29, 2021
GitHub

The most relevant change for this release is the behaviour of `Save()`: it will attempt to update a record if and only if the record exists, otherwise it will attempt to create a record.

v4.0.0
xiamxiam·5y ago·August 29, 2020
GitHub

See: [What's new in v4](https://upper.io/blog/2020/08/29/whats-new-on-upper-v4)

v3.7.1
xiamxiam·6y ago·May 19, 2020
GitHub
v3.7
xiamxiam·6y ago·May 19, 2020
GitHub
v3.6.4
xiamxiam·6y ago·February 26, 2020
GitHub

📋 Changes

  • Fixing some linter warnings
  • Minor refactors
v3.6.2
xiamxiam·6y ago·August 18, 2019
GitHub
v3.6
xiamxiam·6y ago·August 14, 2019
GitHub

📋 Changes

  • Updated the source of the QL driver to the new maintained location.
  • Refactor test suite.
v3.5.7
xiamxiam·7y ago·December 27, 2018
GitHub

Fixes problems with MSSQL adapter and LastInsertId.

v3.5.6, A bugfix releasev3.5.6
VojtechVitekVojtechVitek·7y ago·December 10, 2018
GitHub

Fixes #474, an error in `fetchRows()` was ignored

v3.5.5
xiamxiam·7y ago·September 25, 2018
GitHub

Fixes a problem with `InsertReturning()` and tables with varchar/string primary keys.

v3.5.4
VojtechVitekVojtechVitek·7y ago·August 29, 2018
GitHub

minor release, fixes a deadlock

v3.5.0
xiamxiam·8y ago·October 2, 2017
GitHub

📦 Support for comparison operations

  • Starting on 3.5.0 you'll be able to use comparison operators that are compatible across different database engines, see some examples:
  • ```go
  • // foo = "bar"
  • db.Cond{
  • "foo": db.Eq("bar")
  • }
  • // foo <= 15
  • db.Cond{
  • + 46 more

📦 Thanks

  • Thank you for using upper-db!
v3.4.0
xiamxiam·8y ago·August 19, 2017
GitHub

📦 Allow escaping `?` marks inside queries

  • You can now escape `?` marks inside queries by using `??`:
  • ```go
  • // ...WHERE someColumn ? "Some Value"
  • col.Find().Where(`someColumn ?? ?`, "Some Value")
  • ```

📦 PostgreSQL: jsonb tag and JSONB values

  • Fields tagged with `jsonb` will still emit an error when used, no matter what their type is they all need to satisfy `sql.Scanner` and `driver.Valuer` (or `sqlbuilder.ScannerValuer`).

📦 Structs

  • If your struct looks like:
  • ```go
  • type MyModel struct {
  • ...
  • MyField CustomStruct `db:"my_field,jsonb"`
  • }
  • type CustomStruct struct {
  • Foo string `db:"foo"`
  • + 20 more

📦 Maps

  • If your struct looks like:
  • ```go
  • type MyModel struct {
  • ...
  • MyField map[string]interface{} `db:"my_field,jsonb"`
  • }
  • ```
  • Change it into:
  • + 9 more

📦 Interfaces

  • If your struct looks like:
  • ```go
  • type MyModel struct {
  • ...
  • MyField interface{} `db:"my_field,jsonb"`
  • }
  • ```
  • Change it into:
  • + 10 more

📦 Arrays

  • If your struct looks like:
  • ```go
  • type MyModel struct {
  • ...
  • MyField CustomStructArray `db:"my_field,jsonb"`
  • }
  • type CustomStructArray []CustomStruct
  • ```
  • + 18 more

📦 Other types

  • Some types are going to be converted automatically to a proper type:
  • | Go type | PostgreSQL type |
  • | --- | --- |
  • |`[]string`|`TEXT[]`|
  • |`[]int64`|`INTEGER[]`|
  • |`[]bool`|`BOOLEAN[]`|
  • |`[]float64`|`DOUBLE PRECISION[]`|
  • |`map[string]interface{}`|`JSONB`|
  • + 17 more

📦 Thanks

  • Thanks for using upper-db. Feel free to [open a ticket](https://github.com/upper/db/issues) if you need help.
v3.3.0
xiamxiam·8y ago·July 22, 2017
GitHub

📦 Pagination

  • The new pagination API lets you split the results of a query into chunks containing a fixed number of items.

📦 Simple pagination for db.Result

  • ```go
  • res = sess.Collection("posts").Paginate(20) // 20 results per page
  • err = res.All(&posts) // First 20 results of the query
  • err = res.Page(2).All(&posts) // Results from page 2 (limit 20, offset 40)
  • ```

📦 Simple pagination for SQL builder

  • ```go
  • q = sess.SelectFrom("posts").Paginate(20)
  • err = res.All(&posts) // First 20 results of the query
  • err = res.Page(2).All(&posts) // Results from page 2 (limit 20, offset 40)
  • ```

📦 Cursor based pagination (both for db.Result and SQL Builder)

  • ```go
  • res = sess.Collection("posts").
  • Paginate(20). // 20 results per page
  • Cursor("id") // using id as cursor
  • err = res.All(&posts) // First 20 results of the query
  • // Get the next 20 results starting from the last item of the previous query.
  • res = res.NextPage(posts[len(posts)-1].ID)
  • err = res.All(&posts) // Results from page 1, limit 20, offset 20
  • + 1 more

📦 Other commonly used pagination tools

  • ```go
  • res = res.Paginate(23)
  • totalNumberOfEntries, err = res.TotalEntries()
  • totalNumberOfPages, err = res.TotalPages()
  • ```

📦 Support for binary and text mode (PostgreSQL)

  • pgbouncer requires binary mode (`binary_parameters="yes"`) to be enabled, but all of the auto-fields that were working with text mode started failing with binary mode.
  • Starting with v3.3.0 upper-db supports binary mode. This is how you can enable binary mode in your PostgreSQL session:
  • ```go
  • settings = postgresql.ConnectionURL {
  • ...
  • Options: map[string]string{
  • "binary_parameters": "yes",
  • },
  • + 55 more
v3.2.1
xiamxiam·8y ago·July 2, 2017
GitHub

📋 Changes

  • https://github.com/upper/db/issues/383
  • https://github.com/upper/db/issues/381
  • https://github.com/upper/db/issues/380
v3.2.0
xiamxiam·9y ago·June 17, 2017
GitHub

📋 Changes

  • Multiple Where() calls append conditions instead of overwriting previous ones. See: https://github.com/upper/db/issues/357
  • Support for UUID in `InsertReturning` and `UpdateReturning`. See: https://github.com/upper/db/issues/370
  • Added `postgresql.JSONB`, `postgresql.StringArray` and `postgresql.Int64Array` custom types for PostgreSQL, which will deprecate optional tags `int64array`, `stringarray` and `jsonb` while providing full support for their Scanners and Valuers.
v3.1.0
xiamxiam·9y ago·May 7, 2017
GitHub

# Changelog The most important feature in this release is support for SQL Server via https://github.com/denisenkom/go-mssqldb.