1.0.13 (2021-10-17)
- pgdriver: enable TLS by default with InsecureSkipVerify=true (15ec635)
1.0.12 (2021-10-14)
- add InsertQuery.ColumnExpr to specify columns (60ffe29)
- bundebug: change WithVerbose to accept a bool flag (b2f8b91)
- pgdialect: fix bytea[] handling (a5ca013)
- pgdriver: rename DriverOption to Option (51c1702)
- support allowzero on the soft delete field (d0abec7)
- bundebug: allow to configure the hook using env var, for example, BUNDEBUG={0,1,2} (ce92852)
- bunotel: report DBStats metrics (b9b1575)
- pgdriver: add Error.StatementTimeout (8a7934d)
- pgdriver: allow setting Network in config (b24b5d8)
1.0.11 (2021-10-05)
- mysqldialect: remove duplicate AppendTime (8d42090)
1.0.10 (2021-10-05)
- add UpdateQuery.OmitZero (2294db6)
- make ExcludeColumn work with many-to-many queries (300e12b)
- mysqldialect: append time in local timezone (e763cc8)
- tagparser: improve parsing options with brackets (0daa61e)
- add timetz parsing (6e415c4)
1.0.9 (2021-09-27)
- change DBStats to use uint32 instead of uint64 to make it work on i386 (caca2a7)
- add IQuery and QueryEvent.IQuery (b762942)
- add QueryEvent.Model (7688201)
- bunotel: add experimental bun.query.timing metric (2cdb384)
- pgdriver: add Config.ConnParams to session config params (408caf0)
- pgdriver: allow specifying timeout in DSN (7dbc71b)
1.0.8 (2021-09-18)
- don't append soft delete where for insert queries with on conflict clause (27c477c)
- improve bun.NullTime to accept string (73ad6f5)
- make allowzero work with auto-detected primary keys (82ca87c)
- support soft deletes on nil model (0556e3c)
1.0.7 (2021-09-15)
- don't append zero time as NULL without nullzero tag (3b8d9cb)
- pgdriver: return PostgreSQL DATE as a string (40be0e8)
- specify table alias for soft delete where (5fff1dc)
- add SelectQuery.Exists helper (c3e59c1)
1.0.6 (2021-09-11)
- change unique tag to create a separate unique constraint (8401615)
- improve zero checker for ptr values (2b3623d)
- chore: tweak bundebug colors
- fix: check if table is present when appending columns
- fix: copy []byte when scanning
- Added support for MariaDB.
- Restored default
SET
forON CONFLICT DO UPDATE
queries.
- Fixed bulk soft deletes.
- pgdialect: fixed scanning into an array pointer.
- Changed to completely ignore fields marked with
bun:"-"
. If you want to be able to scan into such columns, usebun:",scanonly"
. - pgdriver: fixed SASL authentication handling.
- pgdriver: added erroneous zero writes retry.
- Improved column handling in Relation callback.
- First stable release.
- Fixed migrate package to properly rollback migrations.
- Added
allowzero
tag option that undoesnullzero
option.
- Changed
WhereGroup
function to accept*SelectQuery
. - Fixed query hooks for count queries.
- Renamed
migrate.CreateGo
toCreateGoMigration
. - Added
migrate.WithPackageName
to customize the Go package name in generated migrations. - Renamed
migrate.CreateSQL
toCreateSQLMigrations
and changedCreateSQLMigrations
to create both up and down migration files.
- Renamed
alias
field struct tag toalt
so it is not confused with column alias. - Reworked migrate package API. See migrate example for details.
- Changed migrate package to return structured data instead of logging the progress. See migrate example for details.
- Added sqliteshim by Ivan Trubach.
- Added support for MySQL 5.7 in addition to MySQL 8.
- Fixed scanners for net.IP and net.IPNet.
- Fixed pgdriver to format passed query args.
- Added support for prepared statements in pgdriver.
-
Added
UpdateQuery.Bulk
helper to generate bulk-update queries.Before:
models := []Model{ {42, "hello"}, {43, "world"}, } return db.NewUpdate(). With("_data", db.NewValues(&models)). Model(&models). Table("_data"). Set("model.str = _data.str"). Where("model.id = _data.id")
Now:
db.NewUpdate(). Model(&models). Bulk()
- Changed time.Time to always append zero time as
NULL
. - Added
db.RunInTx
helper.
- Added SSL support to pgdriver.
- Replaced
ForceDelete(ctx)
withForceDelete().Exec(ctx)
for soft deletes.
- Renamed
DBI
toIConn
.IConn
is a common interface for*sql.DB
,*sql.Conn
, and*sql.Tx
. - Added
IDB
.IDB
is a common interface for*bun.DB
,bun.Conn
, andbun.Tx
.
- Changed model hooks. See model-hooks example.
- Renamed
has-one
tobelongs-to
. Renamedbelongs-to
tohas-one
. Previously Bun used incorrect names for these relations.