22
33[ ![ Go Coverage] ( https://github.com/vinovest/sqlx/wiki/coverage.svg )] ( https://raw.githack.com/wiki/vinovest/sqlx/coverage.html ) [ ![ license] ( https://img.shields.io/badge/license-MIT-green/.svg?style=flat )] ( https://raw.githubusercontent.com/vinovest/sqlx/master/LICENSE )
44
5- This is Vinovest's fork of https://github.com/jmoiron/sqlx.git for ongoing support. Sqlx hasn't been updated in a while
6- and we use it extensively, so we're going to maintain this fork with some additional features and bug fixes.
7- You're welcome to use and contribute to this fork!
5+ This is Vinovest's fork of https://github.com/jmoiron/sqlx.git for
6+ ongoing support. Sqlx hasn't been updated in a while and we use it
7+ extensively, so we're going to maintain this fork with some additional
8+ features and bug fixes. You're welcome to use and contribute to this
9+ fork!
810
911sqlx is a library which provides a set of extensions on go's standard
1012` database/sql ` library. The sqlx versions of ` sql.DB ` , ` sql.TX ` , ` sql.Stmt ` ,
@@ -24,21 +26,40 @@ explains how to use `database/sql` along with sqlx.
2426
2527## Recent Changes
2628
27- 1.3 .0:
29+ 2.0 .0:
2830
29- * ` sqlx.DB.Connx(context.Context) *sqlx.Conn `
30- * ` sqlx.BindDriver(driverName, bindType) `
31- * support for ` []map[string]interface{} ` to do "batch" insertions
32- * allocation & perf improvements for ` sqlx.In `
31+ This is the first major release of sqlx from this fork in order to fix
32+ some issues which may cause some minor compatibility changes from
33+ previous versions, depending on how you use sqlx.
3334
34- DB.Connx returns an ` sqlx.Conn ` , which is an ` sql.Conn ` -alike consistent with
35- sqlx's wrapping of other types.
35+ * VALUES bulk insertions were performed by a regex previously, now
36+ sqlx will use a tokenizer to parse the query and reliably expand the
37+ query for additional bound parameters. This fixes several bugs
38+ around named parameters (e.g. ` :name ` ). Where previously a colon had
39+ to be escaped using an additional colon (resulting in ` ::name ` ), now
40+ the query will work as expected.
3641
37- ` BindDriver ` allows users to control the bindvars that sqlx will use for drivers,
38- and add new drivers at runtime. This results in a very slight performance hit
39- when resolving the driver into a bind type (~ 40ns per call), but it allows users
40- to specify what bindtype their driver uses even when sqlx has not been updated
41- to know about it by default.
42+ * Rebind parsing uses the tokenizer now as well, fixing double quoting
43+ and unexpected behavior with colons in sql strings.
44+
45+ * Get and GetContext will now error if the query returns more than one
46+ row. Previously, it fetched the first row and ignored the
47+ rest. Using Get on multiple rows is typically a mistake, and this
48+ change makes the behavior more consistent and avoids potential bugs.
49+
50+ * Fix for multiple sql statements ("select a from test; select b from
51+ test2;") in a single call. Previously, sqlx cached the columns of
52+ the first query and used them for all subsequent queries. This could
53+ lead to incorrect results if the queries returned different
54+ columns. Now, sqlx will reset the columns for each query on
55+ NextResultSet.
56+
57+ * Adds Queryable interface to unify DB and Tx.
58+
59+ These fixes are the results of upstream contributions submitted in PRs
60+ to the original sqlx repository. Much thanks goes to everyone who
61+ contributed their time and effort to make sqlx better. These fixes
62+ vastly improve the usability of sqlx.
4263
4364### Backwards Compatibility
4465
0 commit comments