Repository navigation
v0.23.0
Added
- Add
bob.Cache()which saves the built SQL and args to prevent rebuilding the same query multiple times. - Add
As()starter to alias expressions - Add
OP()builder method for using custom operators - Add
table.InsertQ(ctx, db)now includes the insert columns from the table model. - It is now possible to configure additional constraints for code generation.
- Add
um.SetCol()which maintains the old behavior ofum.Set(). - Generate additional
Expressions()method for Setters to make it easier to use them inum.Set()orim.Set().
Changed
- Aliases configuration for code generation no longer has a top level
tablekey - When configuring relationships,
from_unique,to_unique,key_nullablecan no longer be configured. They are now inferred from the database. - When configuring relationships,
to_keyhas been changed tomodifyand should be set tofrom,toor""to indicate which side of the relationship to modify.
If left empty, Bob will try to guess which side to modify based on the presence of primary keys and unique columns. RelWhere.Valueis nowRelWhere.SQLValue- Change CONFLICT/DUPLICATE KEY UPDATE to use mods instead of a chainable methods.
- Change
um.Set()to take a list of expressions. - Rename Setter method from
Insert()toInsertMod()to avoid confusion.
Fixed
- Prevent generating duplicate relationships for many-to-many self-join relationships
- Correctly use table alias in generated relationship join mods
- Fix an issue where CTEs were encased in double parenthesis
- Fix invalid SQL generated when doing
JOIN USING - Correctly include "AS" in function query if alias is set
- Setters are also generated for tables that have relationships, even if they have no primary key
- Column aliases in CTEs are now correctly included in the final query
- Fix several issues with generating code for multi-sided relationships
- Fix an issue where loading many-to-many relationships cause no columns to be selected unless specified
- Fix an issue where many-to-many relationships would not be able to use nested loaders
New Contributors
- @auqust made their first contribution in #108
- @nikhilnarayanan623 made their first contribution in #110
- @guettli made their first contribution in #136
Full Changelog: v0.22.0...v0.23.0