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
Query
instances as nested queries for CTEs - fix failed
nil
assertion 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::RecordNotFound
exception ModelQuery(T)#to_a
andModelQuery(T)#find_by_sql
ensureT
has 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 forSymbol
keys) CommonMapping#attribute
uses attribute getterCommonMapping#attribute
raisesJennifer::UnknownAttribute
exception if model has no requested attribute andraise_exception = true
- add
CommonMapping#attribute_before_typecast
which returns given attribute in database format using attribute converter - add
Mapping#{{attribute}}_will_change!
to mark{{attribute}}
as changed one #primary
uses getter- any
Mapping.mapping
invocation createsAttrType
alias to represent union ofJennifer::DBAny
and any arbitrary type from fields definition - change
Mapping#update_columns
argument type toHash(String | Symbol, AttrType)
Mapping#update_columns
raisesJennifer::UnknownAttribute
if key-value pairs include unknown attributeMapping#set_attribute
to acceptAttrType
Mapping#set_attribute
raisesJennifer::UnknownAttribute
exception if model has no requested attributeMapping#update_columns
raisesJennifer::UnknownAttribute
if key-value pairs include unknown fieldMapping#arguments_to_insert
andMapping#arguments_to_save
use#attribute_before_typecast
to collect attributes to store in a database#add_{{relation}}
acceptsAttrType
as a hash value type- rename
EnumConverter
toPgEnumConverter
- add
EnumConverter(T)
to convert string to crystal enum - add
JSONSerializableConverter(T)
to convert JSON field to objects ofT
that support.from_json
and#to_json
methods - add
TimeZoneConverter
to convert time attributes from UTC toJennife::Config.local_time_zone
Adapter
- add
DBFormater
as a proposed default logger formatter - change logging - emit
Log::Metadata
withquery
,args
andtime
keys (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::BaseSQLGenerator
now produces valid SQL when using multiple recursive CTEs (.with(..., true)
) in a single query
Migration
- rename
TableBuilder::DB_OPTIONS
toTableBuilder::DbOptions
Exceptions
- add
Jennifer::UnknownAttribute
to represent case when unknown attribute is tried to be read/written