![]() But perhaps the most important feature is that we have announced Ecto to be stable API and this is only possible due to the work that Plataformatec and the community has put into Ecto throughout the years. This short series of articles shares the most notable changes but there is much more. We are very excited with the many improvements in Ecto 3.0. This may create an issue on deployment: in case something goes wrong when deploying this new feature and you have to rollback the database, the latest migrations by timestamp does not match the migrations that have just been executed.īy emitting warnings, we help developers and production teams alike to be aware of such pitfalls. ![]() Since you started working on this feature, other features and migrations were already shipped to production. Imagine you have been working on a feature for a long period of time and you were finally able to merge it to master. Similarly, Ecto will now warn if you attempt to run a migration and there is a higher version number already migrated in the database. In previous Ecto versions, if you had a long index name, the database would truncate and emit an alert through the TCP connection, but this alert was never extracted and printed in the terminal. The type of lock can be configured via the :migration_lock repository configuration and defaults to “FOR UPDATE” or disabled if set to nil.Īnother improvement is that Ecto is now capable of logging notices/alerts/warnings emitted by the database when running migrations. In previous Ecto versions, if you had multiple machines attempting to run migrations, they could race each other, leading to failures, but now it is guaranteed such can’t happen. The most important change was a contribution by Allen Madsen that locks the migration table, allowing multiple machines to run migrations at the same time. MigrationsĪnother area in Ecto (or to be more precise, Ecto.SQL) that saw major improvements is migrations. There are many other improvements to the Ecto.Repo API, such as, introduced in the previous section, and the new ?. Every instance you have of an Ecto.Schema, such as a %User as a value. One of the most notable performance improvements in Ecto 3.0 is that schemas loaded from an Ecto repository now uses less memory.Ī big part of the memory improvements seen in Ecto 3.0 comes from better management of schema metadata. If you would like to give Ecto a try right now, note Ecto v3.0.0-rc.0 has been released and we are looking forward to your feedback. We are back for one last round! This time we are going to cover improvements on three main areas: performance, upserts and migrations. ![]() Performance, migrations and more (you are here!).Welcome to the “A sneak peek at Ecto 3.0” series: A sneak peek at Ecto 3.0: performance, migrations and more Oct 22, 2018 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |