Releases: volatiletech/sqlboiler
v2.0.4
v2.0.3
This release addresses issues with fairly specific use cases, but important ones. Many thanks to jseriff for finding most of these bugs.
- Added guaranteed
.R
struct presence while eager loading to reduce (ironic) nil-check boilerplate while eager loading. - Added a
--version
flag - Fix an issue in Postgres where constraints in other schemas affected the current one which would generate extraneous relationships
- Fix an issue where eager loading would not properly load nested models
- Fix an issue where eager loading would be overridden by subsequent calls to
qm.Load()
v2.0.2
Overall these changes make for more robust naming and generation of tables with less seen relationships. An example is a self-referential table, or a join table that has extra columns + joins to itself. These situations caused some generated SQL to fail as well as some problems with name collisions in generated code.
- Correct some cases of mysql insert that would fail to generate correct sql
- Change the naming of certain relationships to preserve uniqueness
- This may have broke some function names in existing code
- Rather than gofmt individual template generation, run it on the entire output file to remove excess newlines
- Stop postgres tests from prompting for passwords that are in the sqlboiler config
- Fix generation of many-to-many with self-referential tables
- Fix SetOp for join tables that have more than 2 columns
- Fix non-join tables being flagged as such which in turn didn't generate tables for them
- Refactor output section of code to be more efficient
- Update CI schemas to include more cases for relationships
v2.0.1
Large number of bug fixes and QOL improvements.
- Added support for []byte (binary/bytea) as a primary key
- Added a MySQL and Postgres test schema for more consistent testing
- Added both schemas to CI tests
- Fixed an issue where delete all would fail
- Fixed tests for delete all query generation that allowed the previous bug
- Fixed an issue where 1-to-1 setop remove was being generated under wrong conditions
- Fixed an issue where null foreign keys were not being set as valid in relationships
- Fixed an issue where you could not insert/update/unpsert a table with only a primary-key
- Fixed caching for upsert (previously too aggressive, and missing some cache keys)
- Fixed caching for MySQL queries without return columns
- Fixed an issue where template generation would produce constant diffs (map ordering)
- Fixed several template generation failures
- Fixed several struct randomization issues for testing
- Fixed several lint errors in the generated code
- Force MySQL to use time.Time parsing (see README for requirements)
- Recognize "_uuid", "_oid" and "_guid" (in addition to "_id") as suffixes to be deleted when naming relationships
- Refactor the one-to-one relationship, duplicate rather than using clever sub-template abstraction
- Removed reflect helpers (GetStructPointers/Values) for optimized versions (PtrsFromMapping)
- Removed checks for rows affected since they're unpredictable
- Removed unused variables from text_helpers
- Removed unused variables from templates
v2.0.0
Breaking Changes
Package and Functions
Most of boil
got put into a queries
package. This is to simplify the public
interface of boil
. There was a lot of things in there that we didn't want exposed.
We wanted to make the execution of raw queries simpler
so we added the helpers to actually make the Query
object itself
a real boil.Executor
.
Before | After |
---|---|
boil.SQL() | queries.Raw() |
boil.ExecQuery() | (*queries.Query).Exec() |
boil.ExecQueryOne() | (*queries.Query).QueryRow() |
boil.ExecQueryAll() | (*queries.Query).Query() |
Before | After |
---|---|
github.com/vattle/sqlboiler/boil/qm | github.com/vattle/sqlboiler/queries/qm |
Command-line arguments
This change was mostly done because whitelist
and exclude
seemed sort of
disjoint. This has the unfortunate side-effect of stealing the -b
from
basedir
, but no one should need that option in regular cases anyway.
Before | After |
---|---|
-x --exclude | -b --blacklist |
-b --basedir | --basedir |
JSON and JSONb types
json
and jsonb
fields used to be represented by bytes
but it's now
generated as types.JSON which uses a []byte for underlying storage, but
comes with proper marshaling and nil treatment.
JSON is now recognized as an acronym and will be uppercased appropriately
in struct field names.
See the types details.
Backwards Compatible Changes
MySQL Support
MySQL is now supported. Currently ANSI_QUOTES
option must be set to
to the default "off" in MySQL for this to work, but the basics should be fully
supported by SQLBoiler now. See README for configuration details.
Additional Types
The types
package has been added which adds additional support for various
types.
- Postgres Arrays (byte, string, int, bool, float all supported)
- HStore
Whitelist
--whitelist
-w
now usable from the command-line to specify only the
tables you want to generate.
Schema support
--schema
-s
now usable from the command-line to specify which schema to target.
We added schema support in this release to be able to narrow down in Postgres
the set of tables that you were going to generate. If you need multiple schemas
to be generated, simply run SQLBoiler multiple times with the different schema
and package names.
In MySQL the schema name is automatically set to the database name.
Miscellaneous changes and bug fixes
- Upsert has been optimized to use caching, now over 10x faster.
- Fixed a panic when passing wrong command line arguments
- Significantly changed the way postgres compatibility tests are run. The user used
no longer needs super user permissions on the database (just createdb, dropdb),
but thecreatedb
/dropdb
tools must now also be in$PATH
. - Added P versions of the
Exec
/Query
functions.
Initial Release - v1.0.0
The beginning of versioning for backwards compatibility.