Marten 0.7.0 release notes
Under development.
Requirements and compatibility
- Crystal: 1.17, 1.18, and 1.19.
- Databases:
- MariaDB 10.5 and higher.
- MySQL 8.0.11 and higher.
- PostgreSQL 14 and higher.
- SQLite 3.31.0 and higher.
New features
Minor features
Models and databases
- Query sets now provide a
#limitmethod and an#offsetmethod. Those methods respectively allow to limit the number of records returned and to offset the records returned. They act as aliases for the#[]method with a range. - The
#updatequery set method can now be called on model classes directly, thus allowing to update all the records of the considered model with the specified values. - It is now possible to update only specific columns without running validations or callbacks for a model record by using the
#update_columnsmethod. - It is now possible to easily create or update records in a single call by using the
#update_or_createquery set method. An#update_or_create!variant is also available for the same purpose, but it raises in case updated/created records are invalid.
Handlers and HTTP
Marten::HTTP::UploadedFileobjects can now be serialized to JSON.- A convenient
#remote_ip_addressmethod was added to theMarten::HTTP::Requestclass, allowing to easily retrieve the remote IP address of the incoming request.
Templates
- Most informational string properties (such as
#ascii_only?,#blank?,#bytesize,#empty?,#size, and#valid_encoding?) are now available as template attributes for string values and safe string values.
Development
- The flash store can now be accessed from the spec client by using the
#flashmethod. See Flash messages for more details.