Skip to content

Releases: jonbodner/proteus

Release v0.14.0

12 Jan 04:58
4c4a188
Compare
Choose a tag to compare
Release v0.14.0 Pre-release
Pre-release

This release adds the ability to return a sql.Result from a ContextExecutor or Executor function. The proteus.Builder has a new method ExecResult that returns a sql.Result and an error.

Thanks to @kalexmills for his contribution!

Release v0.13.0

15 Oct 02:28
c395cd4
Compare
Choose a tag to compare
Release v0.13.0 Pre-release
Pre-release

You can now build queries with values from arrays and slices. There are limits; references to elements in arrays and slices are int literals, so you must be sure that the array or slice is at least as long as the specified literals.

The README has been updated with examples of accessing nested fields and arrays.

The errors are now using github.com/jonbodner/stackerr to provide stack traces when they are formatted with %+v

Release v0.12.2

04 Sep 00:15
fbbe783
Compare
Choose a tag to compare
Release v0.12.2 Pre-release
Pre-release

Finally got to the root of the problem with MySQL's Go driver (https://github.com/go-sql-driver/mysql). It won't translate numbers in the response when the text protocol is used (which happens when a query is run without any parameters). Multiple issues have been filed against this for years, but the developers have responded with a wontfix due to the dubious claim that it's too much of a performance hit. See go-sql-driver/mysql#861 for an example.

This update checks to see if a query has no query args. If it does, it checks to see if the Querier/ContextQuerier also implements Prepare/PrepareContext and if so, it creates a statement, forcing MySQL to use the binary protocol. (Postgres will also be using a prepared statement unnecessarily, but it probably has minimal performance difference).

Release v0.12.1

03 Sep 01:41
e16badc
Compare
Choose a tag to compare
Release v0.12.1 Pre-release
Pre-release

Apparently MySQL was broken. Now it works, and there are tests that cover both mysql and postgres via docker-compose.

Release v0.12.0

28 Aug 18:41
5fa7b27
Compare
Choose a tag to compare
Release v0.12.0 Pre-release
Pre-release

Minor release that changes the errors returned by proteus.Build to include any errors caused by badly formed function struct fields.

Also, the tests no longer require sqlite, which greatly speeds them up. If you want to run the tests, a docker-compose.yml file is included that stands up a Postgres Docker image. The new Makefile starts it when you invoke make test

The README has been updated to clarify that using context.Context is preferred.

Release v0.11.0

23 Jul 03:04
bc842f3
Compare
Choose a tag to compare
Release v0.11.0 Pre-release
Pre-release

For its GopherCon 2019 release, Proteus can now build individual functions and run ad-hoc queries!

In addition to generating function fields on a struct, Proteus can now generate individual functions, or (if type safety is not a high priority) run queries without defining a function first. See the README for details.

There are also tweaks to:

  • logging support (specifying the logging level in the context.Context passed into a Proteus-generated function now overrides the logging level set with the package-level proteus.SetLogLevel function)
  • error messages (they should now have lowercase first letters)

Release v0.10.0

30 Jun 21:10
6babf1c
Compare
Choose a tag to compare
Release v0.10.0 Pre-release
Pre-release

Context support!

Proteus now generates functions that invoke ExecContext and QueryContext when you declare function fields that have a context.Context as the first parameter.

Also, proteus.Wrap was an interesting idea, but I've decided that it's a failed experiment. Wrap is now a no-op function, and Proteus is written in terms of *sql.Rows explicitly, and not its own Rows interface. Any existing code that uses Wrap should continue to work; if it does not, that's a bug that will be fixed. Any code that takes advantage of context support cannot use Wrap. If I ever get around to declaring a 1.0 version of Proteus, Wrap will be removed.

Release v0.9.0

30 Jun 01:01
de48061
Compare
Choose a tag to compare
Release v0.9.0 Pre-release
Pre-release

Module support! Starting with v0.9.0, Proteus has module support. Please report any issues or backward compatibility problems.

Also fixed a few minor problems with code that didn't vet due to stricter checks in *f methods.

Release v0.8.3

29 Jun 03:27
eaae0da
Compare
Choose a tag to compare
Release v0.8.3 Pre-release
Pre-release

Clean up some tests and resolve issue with sql.NullXXX fields in embedded structs.

Thanks to @brianchizhang for finding the bug and creating a test case!

Release v0.8.2

24 May 02:29
a1d71c5
Compare
Choose a tag to compare
Release v0.8.2 Pre-release
Pre-release

Remove debugging print statements accidentally left in the code.