Hey everyone!
I am pleased to announce that Marten 0.5 has been officially release!
TL;DR
Marten is a Crystal web framework that makes building web applications easy, productive, and fun. The latest 0.5 release of the framework brings significant enhancements, including relations pre-fetching, model scopes, enum fields for models and schemas, and support for raw SQL predicates in query sets. These improvements enhance performance, flexibility, and ease of use. For a detailed overview of all new features and changes, check out the full changelog.
Main new features and highlights
- Relations pre-fetching - Marten now provides the ability to prefetch relations when using query sets through the use of the new
#prefetch
method. When this capability is leveraged, the records corresponding to the specified relationships will be prefetched in single batches and each record returned by the original query set will have the corresponding related objects already selected and populated. - Model scopes - It is now possible to define scopes in model classes. Scopes allow to pre-define specific filtered query sets, which can be easily applied to model classes and model query sets. The default scope can also be overridden on a per-model basis.
- Raw SQL predicate filtering - Marten now provides the ability to filter query sets using raw SQL predicates when using the
#filter
method. This is useful for leveraging the flexibility of SQL for specific conditions while allowing Marten to handle column selection and query building for the remainder of the query. - Enum fields for models and schemas - It is now possible to define enum fields in models and schemas. For models, such fields allow to store valid enum values, with validation enforced at the database level. When validating data with schemas, they allow to expect valid string values that match those of the configured enum.
Whatβs next?
The Marten framework is still in its early stages, and the core team is actively seeking feedback from users who are interested in experimenting with it or integrating it into their projects. If you encounter any bugs or have ideas to contribute, please open an issue or start a discussion in the projectβs issue tracker on GitHub or join us on Discord. Your input and contributions are greatly appreciated!
If you are new to Marten, here are a few ideas on how you can get started:
- Check out the Marten GitHub repository
- Check out the official documentation
- Ask for help or chat with the community in our Discord
Thanks for reading me!