barrel.rs has a blog now 🎉!
Today we are also happy to announce the release of version
A lot of work as gone into this release and breaks the API in a few ways.
This post will quickly highlight new features and also changes to the API.
New type system
This release adds
barrel::types which replaces the old
While types are still enums with different type variants, the creation
is now much more streamlined with a builder-style API.
types::varchar(255) .nullable(true) .default("Alice")
This change allows us to more easily support database specific types
in the future and makes it easier for you to create your own custom
Check out the
barrel::types documentation for details.
Explicit IDs for tables
0.2.0 a new table had an implicit
PRIMARY key called
It was brought up several times that
barrel should not have implicit behaviour like this
and and as such we have no reverted this!
Now you will need to create a new
id field explicitly
We're still evaluating the option to add a
(or similar) to make this process easier.
DatabaseExecutor was renamed to
there were several bug-fixes around
diesel integration as well as
the table API.
Also you can now finally use the
UUID column type on Postgres
databases. More database specific features are coming!
Most importantly, you will need a very recent
which then depends on
If you're using barrel currently, nothing will change until you update.
Be aware that your existing migrations will need adjustment if you plan
on re-running them!
All in all, this is a pretty big step forward.
We're also tracking some things to implement on a roadmap
for an upcoming
1.0.0 release later this year (maybe!)