github.com/Ali-iotechsys/sqlboiler/v4@v4.0.0-20221208124957-6aec9a5f1f71/CHANGELOG.md (about) 1 # Changelog 2 3 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 4 and this project adheres to [Semantic 5 Versioning](http://semver.org/spec/v2.0.0.html). 6 7 ## [v4.13.0] - 2022-08-28 8 9 ### Added 10 11 - Generate IN/NIN whereHelpers for nullable types (thanks @fdegiuli) 12 13 ### Fixed 14 15 - Fixed concurrent map writes in psql driver (thanks @pavel-krush) 16 - Force title case for enum null prefix (thanks @optiman) 17 18 ## [v4.12.0] - 2022-07-26 19 20 ### Added 21 22 - Fetch column and table info in parallel (thanks @pavel-krush) 23 - Generate IN/NIN methods for enum type query helpers (thanks @optiman) 24 - Improve psql performance by isolating uniqueness query (thanks @peterldowns) 25 - Support for psql materialized view (thanks @severedsea) 26 - Support loading model relationships when binding to a struct with embedded model (thanks @optiman) 27 28 ### Fixed 29 30 - Fix panic when missing primary key in table (thanks @zapo) 31 - Fix some SQLite tests by enabling shared cache (thanks @gabe565) 32 - Fix(sqlite3): narrows `column.AutoGenerated` to columns with INT PKs (thanks @pbedat) 33 - Fix `auto-columns.deleted` not replace the default `deleted_at` column name (thanks @shivaluma) 34 - Trim whitespace for column comments (thanks @arp242) 35 36 ## [v4.11.0] - 2022-04-25 37 38 ### Added 39 40 - Add getter methods to relationship structs 41 (thanks @fsaintjacques) 42 43 ### Changed 44 45 - When title casing UPPER_SNAKE_CASE strings, underscores are not removed for readablity. 46 47 ### Fixed 48 49 - Fix panic when a column referrring a foreign key is ignored 50 (thanks @zapo) 51 - Fix one single point in paths and polygons 52 (thanks @saulortega) 53 54 ## [v4.10.2] - 2022-04-15 55 56 ### Fixed 57 58 - Fix performance issue when scanning pgeo point (thanks @ivokanchev) 59 60 ## [v4.10.1] - 2022-04-15 61 62 ### Fixed 63 64 - Properly assign new query object in models.Pural() 65 66 ## [v4.10.0] - 2022-04-15 67 68 ### Added 69 70 - Add config options to allow user defined rules for inflections 71 72 ### Fixed 73 74 - Don't generate test suites for views 75 - Properly assign new query object in models.Pural() 76 - Fix false negatives for enum values 77 - Strip non alphanumeric characters when title casing. 78 79 ## [v4.9.2] - 2022-04-11 80 81 ### Fixed 82 83 - Use correct column alias during soft delete 84 - Use a default "table.*" for model queries 85 86 ## [v4.9.1] - 2022-04-08 87 88 ### Fixed 89 90 - Fixes issue with column name quotinc in many-to-many eager load 91 - Properly honor `--no-back-referencing` in relationship setops 92 - Retract `v4.9.0` due to issues with the commit tagging and the generated code showing `v4.8.6` 93 94 ## [v4.9.0] - 2022-04-04 95 96 ### Added 97 98 - Add `AllEnum()` function to retrieve a slice of all valid values of an enum type 99 - Add `DefaultTemplates` to `boilingcore.Config` to change the base template files to use for generation 100 - Add `CustomTemplateFuncs` to `boilingcore.Config` to supply additional functions that can be used in templates (thanks @ccakes) 101 102 ### Fixed 103 104 - Fixes issues with detecting enum values that contain uppercases 105 - Properly wrap column names in quotes when loading many-to-many relationships (thanks @bryanmcgrane) 106 - Removes duplicated `deleted_at IS NULL` clause in relationship queries (thanks @ktakenaka) 107 108 ## [v4.8.6] - 2022-01-29 109 110 ### Added 111 112 - Add missing function `func (modelQuery) DeleteAllGP(...)` (thanks @parnic) 113 114 ### Fixed 115 116 - Fixed issue with generation of both nullable and non-nullable enum types (thanks @optiman) 117 118 ## [v4.8.5] - 2022-01-28 119 120 ### Added 121 122 - Do not generate a template file if the content is empty 123 - Add function `drivers.RegisterBinaryFromCmdArg()` to extract binary registration 124 125 ### Fixed 126 127 - Fix panic on zero value of `types.NullDecimal` 128 - `driver.Value()` for zero `types.Decimal` is now "0". 129 130 ## [v4.8.4] - 2022-01-27 131 132 ### Added 133 134 - Add new --always-wrap-errors flag that does not unwrap sql.ErrNoRows 135 so it can retain the stack trace. This supports the best practice of using 136 errors.Is() anyway and will eventually become the default behavior in 137 a breaking v5 (thanks @jhnj) 138 - Add support for * as a wildcard for white/blacklisting columns. See readme 139 for details (thanks @Yoshiji) 140 - Add missing function `func (modelQuery) UpdateAllGP(...)` (thanks @MeanSquaredError) 141 - Add support for generated columns 142 - Add support for database views 143 - Add a `_model` suffix to the generated file for tables names that end with 144 `_test` or `_goos` or `_goarch` since Go treats such files specially. 145 - Add `C` in front of model column attributes that begin with a number since a struct 146 field cannot begin with a number in Go 147 - Add **sqlite3** driver to the main repo using the CGo-free port 148 149 ### Changes 150 151 - Modify the `--add-enum-types` flag to also use the generated types in the model 152 fields (thanks @optiman) 153 - Mark nullable columns as having a default in Postgres driver 154 - Bump MySQL version used for testing to 8.0 155 156 ### Fixed 157 158 - Fix panic when a column referrring a foreign key is ignored 159 (thanks @zapo) 160 - Fix bug with using the zero value of the decimal type for a nullable column 161 (thanks @hongshaoyang) 162 163 ## [v4.8.3] - 2021-11-16 164 165 ### Fixed 166 167 - Fix bad use of titlecase in mysql enum name generation 168 169 ## [v4.8.2] - 2021-11-16 170 171 ### Fixed 172 173 - Fix regression in enum name generation 174 175 ## [v4.8.1] - 2021-11-14 176 177 ### Fixed 178 179 - Fix a regression in the soft delete test template generation introduced in 180 4.8.1 181 182 ## [v4.8.0] - 2021-11-14 183 184 ### Added 185 186 - Add `--add-enum-types` to create distinct enum types instead of strings 187 (thanks @stephenamo) 188 189 ### Fixed 190 191 - Fix a regression in soft delete generation introduced in 4.7.1 192 (thanks @stephenamo) 193 194 ## [v4.7.1] - 2021-09-30 195 196 ### Changed 197 198 - Change template locations to templates/{main,test}. This unfortunate move 199 is necessary to preserve old behavior. 200 201 ### Fixed 202 203 - Revert change to boilingcore.New() both in behavior and function signature 204 205 ## [v4.7.0] - 2021-09-26 206 207 ### Added 208 209 - Add configuration for overriding custom timestamp column names 210 (thanks @stephanafamo) 211 - Add support for arguments to order by (thanks @emwalker and @alexdor) 212 - Add support for comments to mysql (thanks @Wuvist) 213 214 ### Fixed 215 216 - Fix CVEs in transitive dependencies by bumping cobra & viper 217 - Fix inconsistent generation of IsNull/IsNotNull where helpers for types that 218 appear both as null and not null in the database. 219 - JSON unmarshalling null into types.NullDecimal will no longer panic. String 220 and format have been overridden to return "nil" when the underlying decimal 221 is nil instead of crashing. 222 223 ### Removed 224 225 - Removed bindata in favor of go:embed. This is not a breaking change as there 226 are no longer supported versions of Go that do not support go:embed. 227 228 ## [v4.6.0] - 2021-06-06 229 230 ### Added 231 232 - Add `models.TableColumns.MODELNAME` which has the table.column name, useful 233 for custom printf style queries (thanks @sadayuki-matsuno) 234 235 ### Fixed 236 237 - Fix limit 0 queries (no longer omits limit clause) (thanks @longngn) 238 - Fix ordering issue when doing where clause on `deleted_at` and also trying to 239 query for deleted_at 240 - Fix filename generation for tables that begin with `_` 241 - Add MarshalJSON implementation to NullDecimal to fix marshalling this type 242 when nil. 243 - Fix issue with Go 1.16 compatibility for mssql driver by bumping mssql version 244 (thanks @stefkampen) 245 - Fix Remove set operations for to-many relationships error when passing in nil 246 or empty arrays of related models, it's now a no-op. 247 248 ## [v4.5.0] - 2021-03-14 249 250 ### Added 251 252 - Add new query mod WithDeleted to sidestep soft deletes in queries that 253 support query mods (note there still is no way to do this for exists/find 254 operations, see #854 for details) 255 - Add select hooks to the Find() methods, this was an accidental omission 256 in previous versions (thanks @jakecoffman) 257 258 ### Changed 259 260 - Change go-bindata to v3.22.0 261 - Change datetimeoffset and uniqueidentifier types in mssql this is a breaking 262 change if you are using these types, but at least in the case of 263 uniquedidentifier it was not possible to use without this change 264 (thanks @severedsea) 265 266 ### Fixed 267 268 - Fix unnecessary copies in JSON type which improves performance (thanks @bouk) 269 - Fix inclusion of foreign key constraints that target generated pg columns 270 (thanks @chochihim) 271 - Fix generation failure bug in delete template when using --no-context 272 --add-global-variants and --add-soft-deletes 273 - Fix cross-schema psql enum generation bug (thanks @csueiras) 274 - Fix bug where column alias was not respected in Load names (thanks @jalan) 275 - Fix bug with large uint64 values in eager loading (thanks @maku693) 276 277 ## [v4.4.0] - 2020-12-16 278 279 ### Added 280 281 - Add support for a qm.Comment query mod to add comments to queries that will 282 be given to the server for tracing purposes (thanks @Pilatuz) 283 284 ### Fixed 285 286 - Fix compatibility with ANSI_QUOTES in mysql (thanks @alexsander-souza) 287 288 ## [v4.3.1] - 2020-11-16 289 290 ### Fixed 291 292 - Fix case sensitive table name lookup in psql driver (thanks @severedsea) 293 294 ## [v4.3.0] - 2020-11-03 295 296 ### Added 297 298 - Add comments to generated code from db for psql driver (thanks @vladvelici) 299 - Add boil.None() to help with `DO NOTHING` upsert in mssql/mysql 300 (thanks @emmanual099) 301 302 ### Fixed 303 304 - Fix qm.WhereNotIn/qm.AndNotIn/qm.OrNotIn generating the wrong types of 305 clauses (thanks @peterIdowns) 306 - Fix an issue where order of columns can change during eager loading which 307 could cause errors (thanks @inoc603) 308 - Fix longstanding naming conflict when not using suffixes for foreign keys 309 (thanks @yuzuy) 310 - Fix auto-generated timestamp columns not respecting aliases 311 (thanks @while-loop) 312 - Fix upsert bug using schema names in mysql/mssql (thanks @emmanuel099) 313 - Fix blacklist/whitelist as environment variables being clobbered by incorrect 314 values (thanks @Amandeepsinghghai) 315 316 ## [v4.2.0] - 2020-07-03 317 318 ### Added 319 320 - Add types.DecimalContext to control the context with which new decimals 321 are created. This is important if your application uses a special context 322 with more precision or requires the Go operating mode for example. 323 - Add WhereNotIn/AndNotIn/OrNotIn query mods to help solve a bug 324 - Add alias struct case type (uses the columns alias) (thanks @Darkclainer) 325 - Add ability to type replace on tables (thanks @stephenafamo) 326 327 ### Changed 328 329 - Change the way column cache keys are created and looked up, improving memory 330 performance of sqlboiler's caching layer (thanks @zikaeroh) 331 332 ### Fixed 333 334 - Fix the psql driver to correctly ignore generated columns (thanks @chochihim) 335 - Fix an issue with mariadb ssl-mode when running generated tests 336 (thanks @tooolbox) 337 - Fix $1 placeholder in mysql DeleteAll() when using soft delete 338 (thanks @mfzy602) 339 - Fix boilingcore tests to use current module via replace instead of the 340 published v4 module 341 342 ## [v4.1.2] - 2020-05-18 343 344 ### Fixed 345 346 - Fix $1 placeholder in mysql Delete() when using soft delete 347 348 ## [v4.1.1] - 2020-05-05 349 350 ### Fixed 351 352 - Fix mysql generation error made by previous commit 353 354 ## [v4.1.0] - 2020-05-04 355 356 ### Added 357 358 - Add support for postgresql `oid` type (thanks @ImVexed) 359 - Add a new `--relation-tag` option to control the tag name of the relationship 360 struct in generated structs - this can expose loaded relationships to APIs 361 (thanks @speatzle) 362 363 ### Fixed 364 365 - Fix issue that caused horrible mysql generation performance (thanks @oderwat) 366 367 ## [v4.0.1] - 2020-05-02 368 369 ### Fixed 370 371 - Fix missing soft-delete pieces for the P/G variants (thanks @psucodervn) 372 373 ## [v4.0.0] - 2020-04-26 374 375 **NOTE:** Your database drivers must be rebuilt upon moving to this release 376 377 ### Added 378 379 - Add a `--add-soft-deletes` that changes the templates to use soft deletion 380 (thanks @namco1992) 381 - Add a `--no-back-referencing` flag to disable setting backreferences in 382 relationship helpers and eager loading. (thanks @namco1992) 383 - Add not in helpers (thanks @RichardLindhout) 384 385 ### Changed 386 387 - Changed dependency scheme to go modules 388 - Changed randomize/strmangle to be external dependencies to avoid module 389 cycles with the null package. 390 - Changed the way comparisons work for keying caches which dramatically speeds 391 up cache lookups (thanks @zikaeroh) 392 393 ### Fixed 394 395 - Fix postgres tests failing on partioned tables (thanks @troyanov) 396 - Fix enums with spaces being disallowed (thanks @razor-1) 397 - Fix postgresql looking at other types of tables (eg. views) and reporting that 398 they do not have primary keys (thanks @chochihim) 399 400 ## [v3.7.1] - 2020-04-26 401 402 ### Fixed 403 404 - Fix bug in --version command reporting old version 405 406 ## [v3.7.0] - 2020-03-31 407 408 ### Added 409 410 - Add a whitelist of table.column names to set "-" struct tags for to ignore 411 them during serialization (thanks @bogdanpradnj) 412 - Add 'where in' helpers for all primitive Go types (thanks @nwidger) 413 - Add a usage example of accessing the .R field (thanks @tooolbox) 414 - Add a check that safely sidesteps empty WhereIn queries like in other ORMs. 415 (thanks @rekki) 416 - Add LeftOuter/RightOuter/FullOuter join query mods. Keep in mind this has no 417 direct Bind() support as of yet so as with inner joins you -must- use custom 418 data structs. (thanks @tzachshabtay) 419 - Add `distinct` query mod (thanks @tzachshabtay) 420 421 ### Fixed 422 423 - Fix an idempotency issue with primary key column ordering 424 - Fix the plural/singular helpers for the word schema (thanks @Mushus) 425 - Fix some panics in Remove relationship set operations 426 - Fix panic when using WhereNullEQ with NullDecimal: implemented 427 qmhelper.Nullable for NullDecimal 428 429 ## [v3.6.1] - 2019-11-08 430 431 ### Fixed 432 433 - Fix bug where mysql instead of mssql got the fix for offset rows which broke 434 mysql users. (thanks @kkoudev) 435 436 ## [v3.6.0] - 2019-10-21 437 438 ### Added 439 440 - Log lines now can be controlled by context (both their presence and output) 441 see the new boil.WithDebug/boil.WithDebugWriter (thanks @zikaeroh) 442 - OrderBy can now optionally take arguments (thanks @emwalker) 443 - Driver templates can now be disabled to allow further re-use of the existing 444 drivers without having to recompile custom ones. (thanks @kurt-stolle) 445 - Add "whereIn" helpers for int64 (thanks @sadayuki-matsuno) 446 447 ### Fixed 448 449 - Fix bug in mssql offset clause, it now properly includes the "ROWS" suffix 450 as required by the official T-SQL spec. 451 - Fix unmarshalling json into a 0-value Decimal or NullDecimal type when 452 the `*big.Decimal` itself is nil (thanks @ericlagergren) 453 - Fix a bug where mysql/sqlite3 would make spurious select id from table 454 calls on insert when the id was already known. 455 - Fix various quality issues such as Replace(..., -1) -> ReplaceAll, use of 456 EqualFold, etc. (thanks @sosiska) 457 - Fix an issue where using environment variables to configure sqlboiler's 458 drivers the port would fail to parse (thanks @letientai299) 459 460 ### Changed 461 462 - Changed the github.com/pkg/errors library for github.com/friendsofgo/errors 463 This change is backwards compatible, it simply needs the new dependency 464 to be downloaded. It also provides compatible with the new Go 1.13 error 465 handling idioms with which we'd like for users to be able to use. 466 (thanks @jwilner) 467 468 ## [v3.5.0] - 2019-08-26 469 470 ### Added 471 472 - Add wherein helpers for string and int column types (thanks @bugzpodder) 473 - Add sqlboiler version number in output 474 475 ### Changed 476 477 - Rewrite alias documentation for relationships to be a bit more clear and 478 concise. 479 480 ### Fixed 481 482 - Fix a bug where relationship helpers were not quoting properly 483 - Fix issue where eager loads could produce ambiguous wherein clauses 484 - Fix import for sqlmock (thanks @zikaeroh) 485 - Fix issue with quoting identifiers that contain - 486 - Fix unsigned mediumint overflows for mysql tests 487 - Fix bad reference in mssql templates (thanks @cliedeman) 488 489 ## [v3.4.0] - 2019-05-27 490 491 ### Added 492 493 - Add domain name to psql column data from driver (thanks @natsukagami) 494 - Add full_db_type to psql column data from driver (thanks @vincentserpoul) 495 496 ### Fixed 497 498 - Fix problems with idempotency patch messing up the lists of columns, now to 499 achieve idempotency in column lists we sort based on information_schema's 500 ordinal index for columns. 501 - Fix code compilation failure due to whitespace when certain struct tag 502 options were used. 503 504 ## [v3.3.0] - 2019-05-20 505 506 ### Added 507 508 - Add title as an option for struct tag casing configuration 509 - CTE Support for query-mod built queries: see With query mod (thanks @lucaslsl) 510 - Extra documentation to explain how local/foreign work in aliases 511 (thanks @NickyMateev). 512 - When re-running the sqlboiler command to dump a schema, all tables, columns, 513 and foreign keys are now selected in a predictable sorted order. This means 514 that if you run the command against the same schema twice you should get 515 exactly the same output each time. This is useful if you want to check in 516 your generated code, as it avoids pointless churn. It is also helpful if you 517 want to test that the checked-in generated code is up to date. You can now 518 regenerate the code and simply check that nothing has changed. Note that 519 with MS SQL this only works if you provide explicit names for all of your 520 foreign keys, as MS SQL generates names with a random component 521 otherwise. (thanks @autarch) 522 523 ### Changed 524 525 - Change error return on ModelSlice.DeleteAll when ModelSlice is nil to simply 526 return 0, nil. This is not really an error state and is burdensome to users. 527 528 ### Fixed 529 530 - Fix identifiers in Where helpers not being quoted nor having table 531 specifications. 532 - Fix a bug where types declared within a non-global scope could cause cache 533 key collisions and create undesirable behavior within Bind(). 534 - Fix a bug where decimal types in the database without decimal points 535 would be provided by the driver as an int64 which failed to Scan() into 536 a types.Decimal 537 - A Postgres domain that was created from an array ("CREATE DOMAIN foo AS 538 INT[]") would cause a runtime panic when trying to generate model 539 code. These are now handled correctly when the array's type is a 540 built-in. If the array type is itself a UDT then this will be treated as a 541 string, which will not be correct in some cases. (thanks @autarch) 542 - Fix doc typo around qm.Load/qm.Rels (thanks @KopiasCsaba) 543 - Fix a bug where hstore did not Value() properly 544 - Fix an issue related to interface{} keys from yaml type replacements 545 546 ## [v3.2.0] - 2019-01-22 547 548 ### Added 549 550 - Type-safe where clauses can now be created, see README for details. It is 551 highly recommended that this be used at all times. 552 - Type-safe where clauses can now be combined with Or2 for setting or. 553 - The new Expr query mod will allow you to group where statements manually 554 (this turns off all automatic paretheses in the where clause for the query). 555 - Driver specific commands (eg. pg_dump) that are run for test scaffolding 556 will now output their error messages to stderr where they were previously 557 silently failing (thanks @LukasAuerbeck) 558 - Add skipsqlcmd to generated test code for each driver. This allows skipping 559 the whole drop/create database cycle while testing so you may point sqlboiler 560 at a pre-setup test database. (thanks @gemscng) 561 - Add a way to skip hook execution for a given query (boil.SkipHooks) 562 - Add a way to skip timestamp updating for a given query (boil.SkipTimestamps) 563 - Add note about mysql minimum version requirement to README (thanks @jlarusso) 564 565 ### Fixed 566 567 - Fix panic on eager load with nullable foreign keys 568 - Fix bug that prevented 'where' and 'in' from being mixed naturally as 'in' 569 query mods would always be rendered at the end of the query resulting in 570 an unintentional problem. 571 - Fix an issue where 'in' query mods were not being automatically grouped in 572 parentheses like 'where' statements. 573 - Fix bug where mysql columns can sometimes be selected out of order in 574 certain internal queries. (thanks @cpickett-ml) 575 - Fix bug where an incorrect query could be built while eager loading nullable 576 relations (thanks @parnic) 577 - Fix bug where aliases weren't used in many-to-many eager loading 578 (thanks @nwidger for suggested fix) 579 - Fix bug where mysql driver would look outside the current database for 580 indexes that applied to tables and columns named the same and apply those 581 constraints to the generated schema. 582 - Fix MSSQL Link in Readme (thanks @philips) 583 - Fix bug where psql upsert would error when not doing an update 584 - Fix bug where mysql upsert did not have quotes around the table name 585 - Fix bug where yaml config files would panic due to type assertions (thanks 586 @ch3rub1m) 587 - Fix bug where a table name that was a Go keyword could cause test failures 588 - Fix missing boil.Columns type in README (thanks @tatane616) 589 590 ## [v3.1.0] - 2018-10-29 591 592 ### Added 593 594 - Add extra text to clarify the conditions required for a transparent join table 595 in the readme. 596 - Add extra development instructions to the CONTRIBUTING.md (thanks @gemscng) 597 - Add `UpdateAllG` function variant (thanks @gemscng) 598 - Add context to Find examples in README.md (thanks @jones77) 599 600 ### Fixed 601 602 - Fix boil.sh did not go-generate sqlboiler when using `all`, it now does 603 `sqlboiler` and all drivers as well. 604 - Fix a bug with MSSQL exists finisher, it now uses `*` instead of the schema 605 name and a star (like the count query). 606 - Fix a panic in aliases code (thanks @nadilas) 607 - Fix bug when eager loading with null.Uint64 ids 608 - Fix dead links to drivers in README (thanks @DenLilleMand) 609 - Fix a problem with eager loading where null foreign keys would create bad IDs 610 and cause general problems. 611 - Fix mysql bigint signed type to not use an unsigned int in Go (thanks @nazo) 612 - Fix an issue where generated tests failed when output directory was too 613 far away from the config file (thanks @gedorinku). 614 615 ## [v3.0.1] - 2018-08-24 616 617 ### Fixed 618 619 - Fix a DSN formatting issue when connecting to sql server instances 620 - Fix missing BindG function (should have been there) 621 - Fix blacklist using the whitelist instead of blacklist in the mssql driver 622 623 ## [v3.0.0] - 2018-08-13 624 625 ### Added 626 627 - Add constant for relationship names, as well as a helper to use them in 628 query mods: See `ModelNameRels` for the constants and `qm.Rels` for the helper 629 (thanks @glerchundi). 630 - Add support for PSQL Identity columns (thanks @gencer) 631 - Add a new syntax for import maps in the config file. This allows us to 632 sidestep viper's constant downcasing of config keys. This is the 633 exact same fix as happened with aliases previously. 634 635 ### Changed 636 637 - Change querymods to an interface much like the http.Handler interface. This 638 is a breaking change but facilitates being able to actually test querymods 639 as well as a more flexible method of being able to create them. For 640 compatibility with older querymods you've created, use the `qm.QueryModFunc` 641 to convert them to a function type that implements the interface, just like 642 `http.HandlerFunc` (thanks @glerchundi) 643 - Change the `seed` parameter to a `func () int64` function that when called 644 safely produces a new thread-safe pseudorandom sequential integer. This was 645 done to remove the dependency on `sqlboiler` code. 646 - Stop using gopkg.in for versioning for the null package. Please ensure you 647 have null package v8.0.0 or higher after this change. 648 - MySQL driver was erroneously using time.Time for the `time` type but the 649 most prolific driver does not support this, use string instead. This change 650 was PR'd to v2 but never to v3. (thanks @ceshihao) 651 - Remove satori.uuid in favor of a properly maintained fork, this should not 652 be a breaking change. 653 - Hstore now uses the null package in order to have nicer JSON serialization 654 - Changed bindata fork to https://github.com/kevinburke/go-bindata 655 656 ### Fixed 657 658 - MySQL now correctly imports the null package for null json fields 659 (thanks @mickeyreiss) 660 - Pass is now optional as in the README, except mssql (thanks @izumin5210) 661 - menus now singularizes correctly (thanks @jonas747) 662 - Randomize the time as a string for mysql 663 - Remove generation disclaimer for non-go files which prevents proper parsing 664 of languages like html 665 666 ## [v3.0.0-rc9] 667 668 ### Fixed 669 670 - Fix a bug where rows may not be closed when bind failed in some way 671 - Fix aliasing of primary key column names in exist template 672 - Fix a bug in the psql driver where `double precision` was converted into 673 a decimal type when it indeed should be float64. 674 - Fix a bug in the psql driver where `double precision` and `real` arrays were 675 converted into decimal arrays, now they are converted into float64 arrays. 676 For `real` this may not be ideal but it's a better fix for now since we don't 677 have a float32 array. 678 679 ## [v3.0.0-rc8] 680 681 ### Added 682 683 - Add alternative syntax that's case-sensitive for defining aliases. This is 684 particularly useful if toml key syntax is not good enough or viper keeps 685 lowercasing all your keys (and you have uppercase names in say mssql). 686 - Added `aliasCols`, a template helper that can be used in conjunction with 687 stringMap to transform a slice of column names into their aliased names. 688 689 ### Fixed 690 691 - Fix several places that referenced primary keys in the templates that were 692 not alias aware. 693 - Fix strmangle's CamelCase such that it forces the first char to be lowercase. 694 695 ## [v3.0.0-rc7] 696 697 ### Fixed 698 699 - Fix a bug where relationship to_many eager had an old argument in the query 700 call. 701 - Fix a bug where relationship to_many eager call for afterSelectHooks was not 702 using aliases. 703 704 ### Removed 705 706 - Remove dependency on spew package in tests for boilingcore 707 708 ## [v3.0.0-rc6] 709 710 ### Fixed 711 712 - Fix a badly templated value in the mssql upsert template when using context 713 - Fix a bug where the database schema name was not properly being 714 given to the templates. This broke explicit schemas where implicit schemas 715 like in mysql, psql public etc. would still work. 716 717 ## [v3.0.0-rc5] 718 719 ### Fixed 720 721 - Fix generation failure on windows due to path manipulation issues (#314) 722 723 ## [v3.0.0-rc4] 724 725 ### Fixed 726 727 - Fix an issue in mysql driver where the null json field was getting the wrong type (#311) 728 - Fix compilation failures when using a nullable created_at column (#313) 729 730 ## [v3.0.0-rc3] 731 732 ### Added 733 734 - Add CockroachDB out of band driver link to readme (thanks @glerchundi) 735 736 ### Fixed 737 738 - Fix an issue in psql driver where if you had a primary key with the same name 739 in two different tables, it could possibly get the wrong one (#308) 740 - Allow errcheck to run successfully (exclude fmt.Fprint(|ln|f) function) on models 741 - Fix an issue where debug output wouldn't output on crash (exactly when you want it) 742 - Fix issue with boolean values 'true' and 'false' not being accepted (thanks @glerchundi) 743 744 ## [v3.0.0-rc2] 745 746 ### Added 747 748 - Add ability to rename tables, columns, and relationships. 749 - Add support for rows affected to Update/Delete calls. 750 - Add support for geotypes for psql (thanks @saulortega) 751 - Add a flag to set the config file (thanks @l4u) 752 - Add support for citext to psql (thanks @boxofrad) 753 - Add virtual columns ignoring for mysql (thanks @Nykakin) 754 - Add ability for drivers to provide their own templates/replacement templates 755 - Add ability for drivers to specify imports 756 - Add a boil.sh that includes many commands that help build and test sqlboiler 757 - Add many more driver dialect flags to be able to remove all the DriverName 758 comparisons inside sqlboiler templates. This allows us to more cleanly support 759 more drivers. 760 - Add ability to override imports via config file 761 - Add ability to replace types using the config file 762 - Add ability to re-use queries with SetArgs 763 - Add ability to specify blacklisted or whitelisted columns in a table by 764 using the syntax tablename.columnname in the driver's whitelist/blacklist 765 config setting. 766 - Add way to create a relationship struct: `modelName.R.NewStruct()` 767 - MySQL numeric, fixed, dec types now generate using the new types.(Null)Decimal 768 - Use bindata as the default method of accessing templates, this prevents many 769 bug reports we've had in the past. During development or to otherwise opt out 770 the --templates flag will not load from bindata (drivers are the exception). 771 - Add the ability to generate non-go files. The new --templates flag allows you to override 772 the default bindata templates/ and templates_test/ directory that ship with sqlboiler. 773 - Export the queries.BuildQuery method for public use. This allows building 774 queries without executing. 775 776 ### Changed 777 778 #### Driver split 779 780 Drivers are now separate binaries. A lot of the reason for this is because 781 having to keep all the drivers together inside sqlboiler was going to later 782 cause more churn that it was worth. sqlite showed us this immediately with 783 it's cgo dependencies as an example. This was the source of a huge number 784 of changes, many of them breaking but other than the new workflow of using 785 a new binary instead of just a string, users shouldn't actually see too much 786 difference. 787 788 #### Smaller changes 789 790 - Insert, Update and Upsert now take a `boil.Columns` instead of a 791 `whitelist []string`. This allows more flexibility in that we can use 792 different column list kinds to control what gets inserted and updated. 793 See `boil.Infer`, `boil.Whitelist`, `boil.Blacklist`, `boil.Greylist`. 794 This is a breaking change to the syntax of Insert and Update as this argument 795 is no longer optional. To migrate an app and keep the same behavior, 796 add `boil.Infer()` where there's a missing argument, and add 797 `boil.Whitelist("columns", "here")` where columns were previously specified. 798 - Eager loading can now accept QueryMods. This is a breaking change. To migrate 799 an application simply take calls that were of the form: `Load("a.b", "a.c")` 800 and break them into two separate `Load()` query mods. The second argument 801 is now a variadic slice of query mods, hence the breaking change. See the docs 802 for `Load()` for more details. 803 - Eager loading now attaches both sides of the relationship in the `R` structs. 804 This is consistent with the way the set relationship helpers work. 805 - Queries no longer keep a handle to the database and therefore the db 806 parameter is no longer passed in where you create a query, instead it's passed 807 in where you execute the query. 808 - context.Context is now piped through everything, this is a breaking change 809 syntactically. This can be controlled by the `--no-context` flag. 810 - Rename postgresql driver to psql 811 - MySQL driver no longer accepts `tinyint_as_bool` via command line. Instead 812 the flag has been inverted (`tinyint_as_int`) to stop the automatic bool 813 conversion and it's now passed in as a driver configuration setting (via the 814 env or config). 815 - Schema is no longer an sqlboiler level configuration setting. Instead it is 816 passed back to sqlboiler when the driver is asked to produce the information 817 for the database we're generating for. This is a breaking change. 818 - Rows affected is now returned by update and deletes by default. This is 819 syntactically a breaking change. This can be controlled by the 820 `--no-rows-affected` flag. 821 - Panic and Global variants are now hidden behind flags. This reduces the size 822 of the generated code by 15%. This is a breaking change if you were using 823 them. 824 - Randomize now counts on an interface to do proper randomization for 825 custom types. 826 - Imports is now it's own package and is cleaned up significantly 827 - Changed all `$dot` references to `$.` as is proper 828 - Drivers are now responsible for their own config validation 829 - Drivers are now responsible for their own default config values 830 - Upsert is no longer a core part of sqlboiler, and is currently being provided 831 by all three supported drivers, but other drivers may choose not to implement 832 it. 833 - Drivers can now take any configuration via environment or config files. This 834 allows drivers to be much more configurable and there's no constraints 835 imposed by the main/testing of sqlboiler itself. 836 - Replace templates (hidden flag) now use the `;` separator not `:` for windows 837 compatibility. 838 - Postgres numeric, fixed, decimal types now generate using the new 839 types.(Null)Decimal instead of float64, this is a breaking change, 840 but a very correct and important one. 841 842 ### Removed 843 844 - The concept of TestMain is now gone from both templates and imports. It's 845 been superceded by the new driver abilities to supply templates and imports. 846 The drivers add their mains to the TestSingleton templates. 847 - Remove the reliance on the null package in the templates. Instead favor 848 using the sql.Scanner and driver.Valuer interface that most types will 849 implement anyway (and the null package does too). 850 851 ### Fixed 852 853 - Fixed a bug in Bind() where all the given `*sql.Rows` would be consumed 854 even in the event where we were binding to a single object. This allows 855 for slower scanning of a `*sql.Rows` object. 856 - Fixed a problem in eager loading where the same object would be queried 857 for multiple times. This was simply inefficient and so we now de-duplicate 858 the ids before creating the query. 859 - Fix a bug with insert where if the columns to insert were nil, values 860 would never be loaded into the query (RETURNING clause missing).