Marten 0.6.0 release notes
Under development.
Requirements and compatibility
- Crystal: 1.12, 1.13, and 1.14.
- Databases:
- MariaDB 10.4 and higher.
- MySQL 8.0.11 and higher.
- PostgreSQL 12 and higher.
- SQLite 3.27.0 and higher.
New features
Minor features
Models and databases
- Query sets now support XOR operations when performing complex queries involving
q
expressions. Additionally, combining query sets using the XOR operator (^
) is now also supported (see#^ (XOR)
). - A new
slugify
option was added toslug
model fields in order to make it possible to automatically generate a slug value from another local model field. - Query pages (instances of
Marten::DB::Query::Page
) now expose a#pages_count
method that allows to get the total number of pages. - Related objects are now automatically loaded when accessing backward relations (such as backward many-to-one relations or backward one-to-one relations).
Handlers and HTTP
- Session stores now make it possible to easily configure when session entries expire through the use of the
#expires_at=
,#expires_at_browser_close=
, and#expires_in=
methods. Please refer to Customizing session expiry times to learn more about this capability. - An alias for the
#reverse
handler method (#url
) was introduced. - A Referrer-Policy middleware was introduced to make it possible to automatically set the Referrer-Policy header in responses generated by handlers.
- A new
unsupported_http_method_strategy
setting was introduced to make it possible to configure the strategy to use when processing unsupported HTTP methods in handlers. This setting can be used to configure whether such requests should result in 405 Method Not Allowed responses (the default behavior) or 404 Not Found responses. - It is now possible to use any hash or named tuple to define schema initial data in handlers that use subclasses of
Marten::Handlers::Schema
(in the#initial_data
method).
Templates
Development
- A new
--log-level
command option was introduced to make it easier to configure the log level to use when running management commands (see Shared options for more details). - The
new
management command now makes it possible to generate projects without configured databases when the--database=none
option is used. - Projects generated with the
new
management command now include the Referrer-Policy middleware by default. - The
new
management command now generates aseed.cr
file when generating new project structures. - A new
seed
management command was introduced to make it easy to execute seed files. - Log entries generated when running the development server (
serve
management command) in debug mode now include more details about processed requests, rendered templates, and executed SQL queries.