I think that it isn't a well kept secret that I'm a fanboy of Elixir. Almost half of my blog posts (at point of writing) are related to Elixir and its ecosystem. But, how exactly did I get to this point? And why? In this post, let's deep dive into what makes Erlang/Elixir so special and why the latest innovations out of this ecosystem keeps me coming back for more.
16 posts tagged with "elixir"
View All TagsUsing Embedded Schemas for Easy Peasy Ecto Preloading
Structs in Elixir are great, they let you define some data structure and lets you do all sorts of nifty stuff like default values. But what if you want to use this particular struct inside of an Ecto query and then preload associations based on a given field?
Using Common Table Expressions for Temporary Tables in Elixir (Ecto)
Ocassionally, when you've got lots of business logic defined, you may need to perform some heavy calculations outside of your main SQL query and then join back the calculated result set into your final query to perform some statistical final calculation. Usually, the calculated result set would be in the form of a list of maps or list of tuples.
Translating Data Types Between Elixir and Python (when using Erlport/Export)
As explained in my original post on connecting Python with Elixir, there are some data translation issues that we will have to deal with when interfacing between the two languages.
Thankfully, the Erlport documentation kindly provides a full table of the data type mappings, which we can now use to make our lives easier.
Using Recursive Functions for Ecto Query Building
Composability is the name of the game when it comes to writing Ecto queries. With such a beautifully designed DSL given to us, we should make full use of its design to build our queries.