Skip to content

Commit f72217d

Browse files
committed
update readme and add CHANGES
1 parent eb4fd1d commit f72217d

2 files changed

Lines changed: 88 additions & 15 deletions

File tree

CHANGES.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Changes
2+
3+
## 2.0.0:
4+
5+
This is the first major release of sqlx from this fork in order to fix
6+
some issues which may cause some minor compatibility changes from
7+
previous versions, depending on how you use sqlx.
8+
9+
* VALUES bulk insertions were performed by a regex previously, now
10+
sqlx will use a tokenizer to parse the query and reliably expand the
11+
query for additional bound parameters. This fixes several bugs
12+
around named parameters (e.g. `:name`). Where previously a colon had
13+
to be escaped using an additional colon (resulting in `::name`), now
14+
the query will work as expected.
15+
16+
* Rebind parsing uses the tokenizer now as well, fixing double quoting
17+
and unexpected behavior with colons in sql strings.
18+
19+
* Get and GetContext will now error if the query returns more than one
20+
row. Previously, it fetched the first row and ignored the
21+
rest. Using Get on multiple rows is typically a mistake, and this
22+
change makes the behavior more consistent and avoids potential bugs.
23+
24+
* Fix for multiple sql statements ("select a from test; select b from
25+
test2;") in a single call. Previously, sqlx cached the columns of
26+
the first query and used them for all subsequent queries. This could
27+
lead to incorrect results if the queries returned different
28+
columns. Now, sqlx will reset the columns for each query on
29+
NextResultSet.
30+
31+
* Adds Queryable interface to unify DB and Tx.
32+
33+
These fixes are the results of upstream contributions submitted in PRs
34+
to the original sqlx repository. Much thanks goes to everyone who
35+
contributed their time and effort to make sqlx better. These fixes
36+
vastly improve the usability of sqlx.
37+
38+
## 1.3.0:
39+
40+
* `sqlx.DB.Connx(context.Context) *sqlx.Conn`
41+
* `sqlx.BindDriver(driverName, bindType)`
42+
* support for `[]map[string]interface{}` to do "batch" insertions
43+
* allocation & perf improvements for `sqlx.In`
44+
45+
DB.Connx returns an `sqlx.Conn`, which is an `sql.Conn`-alike consistent with
46+
sqlx's wrapping of other types.
47+
48+
`BindDriver` allows users to control the bindvars that sqlx will use for drivers,
49+
and add new drivers at runtime. This results in a very slight performance hit
50+
when resolving the driver into a bind type (~40ns per call), but it allows users
51+
to specify what bindtype their driver uses even when sqlx has not been updated
52+
to know about it by default.

README.md

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
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

911
sqlx 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

Comments
 (0)