Releases: nullism/bqb
v1.7.2 - Minor fixes
This release includes an escaped parameter fix for nested queries. Thanks to @djpalm801 for the issue and fix.
v1.7.1 Continued PGSQL query parameter performance
This updates the work by @benjic to avoid re-scanning the SQL string for each parameter.
This uses a StringBuilder instead of a custom scanner solution, performance seems similar.
v1.7.0 Query builder now uses a scanner
This release comes with some substantial performance improvements to PGSQL dialect queries with lots of parameters.
Instead of re-scanning the string (strings.Replace
) for each parameter, it now does a sequential single scan, providing a 900% speed improvement for lots (order of 1K) of parameters.
Thanks to @benjic for the idea and implementation.
v1.6.2 Fix to error propagation
This release contains a fix to the way errors were being discarded from subqueries for a given query.
This has been tested locally by myself, and Henrik was kind enough to include test coverage such that we're still at 100%.
Thanks to @HenrikPoulsen for fixing this.
v1.6.1 Minor typo fixes
This release contains only an error message typo fix and updates to some tests.
v1.6.0 Remove panics and add Embedded type
This release contains the new Embedded
type. Embedded
, like Embedder
, produces a raw value for a query. It differs from Embedder
in that it can be used as a string:
q := bqb.New("embedded: ?, unembedded: ?", bqb.Embedded("raw"), "bound")
q.Print()
// Prints:
// SQL: embedded: "one"."two"."""three""", unembedded: ?
// PARAMS: [bound]
NOTE This release also removes panics. This was done to minimize runtime crashes. Since this utilizes the existing error
return for the ToX
methods it should not cause any crashes. This means that extra or missing params in queries bqb.New("? ?", 1)
or bqb.New("", 1)
now return an error when converting to SQL which seems like the agreed upon proper way to handle this.
v1.5.0 Add Embedder support
This release provides a new type of Embedder
that is covered in types_test.go
and has an example.
@dschep rightly pointed out that there's not a good way to embed raw values in the query string. By using a Embedder
implementation a query can be made more readable by embedding values for replacement with ?
.
Note: These values are not bound, so an Embedder implementation should be careful to whitelist or sanitize any untrusted input.
v1.4.0 driver.Valuer support and Go 1.20
The minor release upgrades to Go v1.20 as well as contains support for driver.Valuer
as a query parameter thanks to @allanglen.
v1.3.1 Minor Release
Massive speed improvement for MySQL
and SQL
dialects in cases where very large array parameters are required (10K+).
v1.3.0 Minor Release
This change is just an update from Go 1.17 to Go 1.19.