• Category Archives: elixir

Ecto’s insert_all and schemaless queries

One of the functions added to Ecto 2.0 is Ecto.Repo.insert_all/3. insert_all allows developers to insert multiple entries at once into a repository: MyApp.Repo.insert_all(Post, [[title: "hello", body: "world"], [title: "another", body: "post"]]) Although insert_all is just a regular Elixir function, it plays an important role in Ecto 2.0 goals. To understand more about these goals, let’s … »

Read more at the source

Developing NectarCommerce Extensions

In the past few posts we have learned how to write code that extends existing models, routers, added methods to override view rendering and run multiple phoenix application together in the same umbrella project. Let’s Continue to build upon that and write our first extension for NectarCommerce favorite products and ultimately our store based on NectarCommerce.

For our curious readers, we tried another extension approach which had linear dependency (nectar => extensions_manager => extensions) helpful in development but turned out to had the serious limitation of Nectar being unavailable for testing.

To overcome the barrier of testing and pleasant developer workflow, what we need is that Nectar is available and compiled while developing extensions and if an extension is added it should recompile itself to include the new extensions.
We have modified Nectar for this approach to seek for extensions and used a custom compiler step(A story for another time) to mark files for recompilation. Let’s get started and see if we can scale the testing barrier.

Continue reading

Read more at the source

Learning from failures: First Experiment at NectarCommerce Extension Approach

It’s a walk-through of Extension Approach which has simple, linear dependency (nectar => extensions_manager => extensions) between Nectar, Extensions and Extension Manager and developing an extension is also quite straightforward but turned out to have the serious limitation of Nectar being unavailable for testing. Continue reading

Read more at the source

Running Multiple Elixir Apps in Umbrella Project

As NectarCommerce extensions are envisioned to be used with Nectar and would be dependent on Nectar directly or indirectly, we chose umbrella project to have Nectar, extensions_manager, user_app, and extensions apps as part of it.

We plan to use phoenix app for extensions where web-component is needed and which would be part of the umbrella project.

Continue reading

Read more at the source
close