Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | < 18 hours ago | 3.6 kB | |
v0.39.0 source code.tar.gz | < 18 hours ago | 622.4 kB | |
v0.39.0 source code.zip | < 18 hours ago | 800.9 kB | |
Totals: 3 Items | 1.4 MB | 0 |
Added
- Added the
As
method toclause.TableRef
, which sets the alias and return a copy of the struct. (thanks @Nitjsefni7) - Added the
type_system
configuration option to determine how to generate null and optional values in the generated code. Possible options:github.com/aarondl/opt
,github.com/aarondl/opt/null
ordatabase/sql
. The default value isgithub.com/aarondl/opt
. - When generating code for queries, The
All
method of the generated query will return a struct with nested fields instead of a flat struct. - columns with dots (
.
) are assumed to be ato-many
nested field. - columns with double underscores (
__
) are assumed to be ato-one
nested field. - Implement
--prefix
annotation in queries forbobgen-psql
. - Add FromExisting<Rel> method to factories to create a template from an existing model. (thanks @dutow)
- Add WithExisting<Rel> to factory mods to attach an existing model as a relationship. (thanks @dutow)
- Added support in psql for combined args (order by, limit etc.) in combined queries and use parens if they are present. (@iwyrkore)
- Added parens for combined queries. (@iwyrkore)
- Match columns using regular expressions in type replacements. This is useful for e.g. matching columns that have a common prefix or suffix. (thanks @abdusco)
Changed
Mod
is now a separate field inorm.ModQuery
andorm.ModExecQuery
.Allx
now takes aTransformer
type parameter to transform the result of the query.- Updated documentation for readability, added code gen examples. (thanks @singhsays)
- Columns are now matched in a case-insensitive manner in type replacements. (thanks @abdusco)
- Columns can now be matched with as many conditions as needed in type replacements. This removes the previous requirement that boolean fields had to be specified in addition to a string field. (thanks @abdusco)
- Factories now expose a
NewXWithContext
that accepts a context in addition toNewX
that does not. This provides a cleaner API for the callers, while still allowing the use of context internally. (thanks @abdusco)
Removed
- Removed the
fallback_null
configuration option. It is now replaced with thetype_system
configuration option.
Fixed
- Fixed some issues with creating relationships in the factory by avoiding trying to reuse models.
- Fix issues with generating code for queries with duplicate return column names.
- Updated gen table detail queries to use context. (thanks @singhsays)
- Properly detect
bool
,timestamp
andtimestamptz
types inbobgen-psql
. - Fix transformer for single result queries.
- Properly handle indexes where the sorting order can be null.
- Check for nullability when loading relationships.
- Handle table names quoted with backticks in mysql query parser. (thanks @luiscleto)
- Allow matching columns in type replacements by the
autoincr
property as stated in the docs. (thanks @abdusco) - Handle dashes and spaces in generated enum values properly (thanks @abdusco)
- Check for nullability when loading relationships from Slices (thanks @felipeparaujo)
New Contributors
- @dutow made their first contribution in https://github.com/stephenafamo/bob/pull/470
- @iwyrkore made their first contribution in https://github.com/stephenafamo/bob/pull/484
- @luiscleto made their first contribution in https://github.com/stephenafamo/bob/pull/493
- @abdusco made their first contribution in https://github.com/stephenafamo/bob/pull/499
Full Changelog: https://github.com/stephenafamo/bob/compare/v0.38.0...v0.39.0