| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2020-12-11 | 3.1 kB | |
| Release 0.10.0.tar.gz | 2020-12-11 | 225.8 kB | |
| Release 0.10.0.zip | 2020-12-11 | 362.7 kB | |
| Totals: 3 Items | 591.6 kB | 0 | |
Changes
General
- add crystal 0.35.0 support and drop 0.34.0 support
QueryBuilder
- allow arbitrary
Queryinstances as nested queries for CTEs - fix failed
nilassertion when eager load relations sequence with missing intermediate relation records - add
IModelQuery#find(id)to retrieve record by primary key - add
IModelQuery#find!(id)to retrieve record by primary key or raiseJennifer::RecordNotFoundexception ModelQuery(T)#to_aandModelQuery(T)#find_by_sqlensureThas loaded actual table field count before making a request
Model
- change model constructor hash argument type from
Hash(String, Jennifer::DBany)toHash(String, AttrType)(same forSymbolkeys) CommonMapping#attributeuses attribute getterCommonMapping#attributeraisesJennifer::UnknownAttributeexception if model has no requested attribute andraise_exception = true- add
CommonMapping#attribute_before_typecastwhich returns given attribute in database format using attribute converter - add
Mapping#{{attribute}}_will_change!to mark{{attribute}}as changed one #primaryuses getter- any
Mapping.mappinginvocation createsAttrTypealias to represent union ofJennifer::DBAnyand any arbitrary type from fields definition - change
Mapping#update_columnsargument type toHash(String | Symbol, AttrType) Mapping#update_columnsraisesJennifer::UnknownAttributeif key-value pairs include unknown attributeMapping#set_attributeto acceptAttrTypeMapping#set_attributeraisesJennifer::UnknownAttributeexception if model has no requested attributeMapping#update_columnsraisesJennifer::UnknownAttributeif key-value pairs include unknown fieldMapping#arguments_to_insertandMapping#arguments_to_saveuse#attribute_before_typecastto collect attributes to store in a database#add_{{relation}}acceptsAttrTypeas a hash value type- rename
EnumConvertertoPgEnumConverter - add
EnumConverter(T)to convert string to crystal enum - add
JSONSerializableConverter(T)to convert JSON field to objects ofTthat support.from_jsonand#to_jsonmethods - add
TimeZoneConverterto convert time attributes from UTC toJennife::Config.local_time_zone
Adapter
- add
DBFormateras a proposed default logger formatter - change logging - emit
Log::Metadatawithquery,argsandtimekeys (as new crystal-db does) - fix missing reconnect to database on connection lost
SqlGenerator
- fix a potential compilation issue that appears in certain edge cases for postgres adapter (#329)
Adapter::BaseSQLGeneratornow produces valid SQL when using multiple recursive CTEs (.with(..., true)) in a single query
Migration
- rename
TableBuilder::DB_OPTIONStoTableBuilder::DbOptions
Exceptions
- add
Jennifer::UnknownAttributeto represent case when unknown attribute is tried to be read/written