A persistence layer for Hanami
- [Luca Guidi]
Hanami::Entity
defines an automatic schema for SQL databases – [Luca Guidi]Hanami::Entity
attributes schema - [Luca Guidi] Experimental support for One-To-Many association (aka
has_many
) - [Luca Guidi] Native support for PostgreSQL types like UUID, Array, JSON(B) and Money
- [Luca Guidi] Repositories instances can access all the relations (eg.
BookRepository
can accessusers
relation via#users
) - [Luca Guidi] Automapping for SQL databases
- [Luca Guidi] Added
Hanami::Model::DatabaseError
- [Luca Guidi] Entities are immutable
- [Luca Guidi] Removed support for Memory and File System adapters
- [Luca Guidi] Removed support for dirty tracking
- [Luca Guidi]
Hanami::Entity.attributes
method no longer accepts a list of attributes, but a block to optionally define typed attributes - [Luca Guidi] Removed
#fetch
,#execute
and#transaction
from repository - [Luca Guidi] Removed
mapping
block fromHanami::Model.configure
- [Luca Guidi] Changed
adapter
signature inHanami::Model.configure
(useadapter :sql, ENV['DATABASE_URL']
) - [Luca Guidi] Repositories must inherit from
Hanami::Repository
instead of including it - [Luca Guidi] Entities must inherit from
Hanami::Entity
instead of including it - [Pascal Betz] Repositories use instance level interface (eg.
BookRepository.new.find
instead ofBookRepository.find
) - [Luca Guidi] Repositories now accept hashes for CRUD operations
- [Luca Guidi]
Hanami::Repository#create
now accepts: hash (or entity) - [Luca Guidi]
Hanami::Repository#update
now accepts two arguments: primary key (id
) and data (or entity) - [Luca Guidi]
Hanami::Repository#delete
now accepts: primary key (id
) - [Luca Guidi] Drop
Hanami::Model::NonPersistedEntityError
,Hanami::Model::InvalidMappingError
,Hanami::Model::InvalidCommandError
,Hanami::Model::InvalidQueryError
- [Luca Guidi] Official support for Ruby 2.3 and JRuby 9.0.5.0
- [Luca Guidi] Drop support for Ruby 2.0, 2.1, 2.2, and JRuby 9.0.0.0
- [Luca Guidi] Drop support for
mysql
gem in favor ofmysql2
- [Luca Guidi] Ensure booleans to be correctly dumped in database
- [Luca Guidi] Ensure to respect default database schema values
- [Luca Guidi] Ensure SQL UPDATE to not override non-default primary key
- [James Hamilton] Print appropriate error message when trying to create a PostgreSQL database that is already existing
- [Kjell-Magne Øierud] Ensure inherited entities to expose attributes from base class
- [Hélio Costa e Silva & Pascal Betz] Mapping SQL Adapter's errors as
Hanami::Model
errors
- [Hélio Costa e Silva & Pascal Betz] Mapping SQL Adapter's errors as
Hanami::Model
errors
- [Luca Guidi] Renamed the project
- [Sean Collins] Improved error message for
Lotus::Model::Adapters::NoAdapterError
- [Kyle Chong & Trung Lê] Catch Sequel exceptions and re-raise as
Lotus::Model::Error
- [Taylor Finnell] Let
Lotus::Model::Configuration#adapter
to accept arbitrary options (eg.adapter type: :sql, uri: 'jdbc:...', after_connect: Proc.new { |connection| connection.auto_commit(true) }
)
- [Andrey Deryabin] Improved
Entity#inspect
- [Karim Tarek] Introduced
Lotus::Model::Error
and let all the framework exceptions to inherit from it.
- [Luca Guidi] Improved error message when trying to use a repository without mapping the corresponding collections
- [Sean Collins] Improved error message when trying to create database, but it fails (eg. missing
createdb
executable) - [Andrey Deryabin] Improved error message when trying to drop database, but a client is still connected (useful for PostgreSQL)
- [Hiếu Nguyễn] Improved error message when trying to "prepare" database, but it fails
- [Brenno Costa] Official support for JRuby 9k+
- [Luca Guidi] Command/Query separation via
Repository.execute
andRepository.fetch
- [Luca Guidi] Custom attribute coercers for data mapper
- [Alfonso Uceda] Added
#join
and#left_join
and#group
to SQL adapter
- [Luca Guidi]
Repository.execute
no longer returns a result from the database.
- [Manuel Corrales] Use
dropdb
to drop PostgreSQL database. - [Luca Guidi & Bohdan V.] Ignore dotfiles while running migrations.
- [Nick Coyne] Fixed database creation for PostgreSQL (now it uses
createdb
).
- [Luca Guidi] Database migrations
- [Matthew Bellantoni] Made
Repository.execute
not callable from the outside (private Ruby method, public API).
- [Dmitry Tymchuk & Luca Guidi] Fix for dirty tracking of attributes changed in place (eg.
book.tags << 'non-fiction'
)
- [Dmitry Tymchuk] Dirty tracking for entities (via
Lotus::Entity::DirtyTracking
module to include) - [My Mai] Automatic update of timestamps when an entity is persisted.
- [Peter Berkenbosch] Introduced
Lotus::Repository#execute
, to execute raw query/commands against database (eg.BookRepository.execute "SELECT * FROM users"
orBookRepository.execute "UPDATE users SET admin = 'f'"
) - [Guilherme Franco] Memory and File System adapters now accept a block for
where
,or
,and
conditions (egwhere { age > 33 }
).
- [Luca Guidi] Ensure Array coercion to preserve original data structure
- [Linus Pettersson] Database console
- [Alfonso Uceda Pompa] Don't send unwanted null values to the database, while coercing entities
- [Jan Lelis] Do not define top-level
Boolean
, because it is already defined byhanami-utils
- [Vsevolod Romashov] Fix entity class resolving in
Coercer#from_record
- [Jason Harrelson] Add file and line to
instance_eval
inCoercer
to make backtrace more usable
- [Luca Guidi] When duplicate the framework don't copy over the original
Lotus::Model
configuration
- [Alfonso Uceda Pompa] Added support for database transactions in repositories
- [Luca Guidi] Ensure file system adapter old data is read when a new process is started
- [Luca Guidi] Coerce entities when persisted
- [Luca Guidi] Compatibility between Lotus::Entity and Lotus::Validations
- [Luca Guidi] Introduced file system adapter
– [Benny Klotz & Trung Lê] Introduced
Entity
inheritance of attributes - [Trung Lê] Introduced
Entity#update
for bulk update of attributes - [Luca Guidi] Improved error when try to use a repository which wasn't configured or when the framework wasn't loaded yet
- [Trung Lê] Introduced
Entity#to_h
- [Trung Lê] Introduced
Lotus::Model.duplicate
- [Trung Lê] Made
Lotus::Mapper
lazy - [Trung Lê] Introduced thread safe autoloading for adapters
- [Felipe Sere] Add support for
Symbol
coercion - [Celso Fernandes] Add support for
BigDecimal
coercion - [Trung Lê] Introduced
Lotus::Model.load!
as entry point for loading - [Trung Lê] Introduced
Mapper#repository
as DSL to associate a repository to a collection - [Trung Lê & Tao Guo] Introduced
Configuration#mapping
as DSL to configure the mapping - [Coen Wessels] Allow
where
,exclude
andor
to accept blocks - [Trung Lê & Tao Guo] Introduced
Configuration#adapter
as DSL to configure the adapter - [Trung Lê] Introduced
Lotus::Model::Configuration
- [Trung Lê] Changed
Entity.attributes=
toEntity.attributes
- [Trung Lê] In case of missing entity, let
Repository#find
returnsnil
instead of raise an exception
- [Rik Tonnard] Ensure correct behavior of
#offset
in memory adapter - [Benny Klotz] Ensure
Entity
to set the attributes even when the given Hash uses strings as keys - [Ben Askins] Always return the entity from
Repository#persist
- [Jeremy Stephens] Made
Memory::Query#where
and#or
behave more like the SQL counter-part
- [Stanislav Spiridonov] Ensure to require
'hanami/model/mapping/coercions'
- [Krzysztof Zalewski]
Entity
defines#id
accessor by default
- [Luca Guidi] Introduced
Lotus::Model::Mapping::Coercions
in order to decouple fromLotus::Utils::Kernel
- [Luca Guidi] Official support for Ruby 2.1
- [Luca Guidi] Allow to inject coercer into mapper
- [Luca Guidi] Introduced database mapping
- [Luca Guidi] Introduced
Lotus::Entity
- [Luca Guidi] Introduced SQL adapter
- [Luca Guidi] Introduced memory adapter – [Luca Guidi] Introduced adapters for repositories
- [Luca Guidi] Introduced
Lotus::Repository