Mark from Alchemist Camp by Mark

Alchemist Camp Mar 3, 2021

Lightweight text search in Postgres

Sometimes Elastic search or other services are overkill but you need SOME kind of search at the database level. Here's…

Alchemist Camp Mar 1, 2021

Adding type specs to an Elixir module

Type specs are a part of the Elixir language and they're widely used... despite the fact that Elixir is dynamically…

Alchemist Camp Feb 28, 2021

Representing strings in Postgres

A quick comparison of char, varchar and text, plus the space and performance tradeoffs.

Alchemist Camp Feb 27, 2021

The Elixir Date/Time sigils and structs you'll need

Dates and Times are a thorny issue considering the complexity of time zones, calendars and subtle bugs that can arise…

Alchemist Camp Feb 26, 2021

Dumping and restoring a Postgres DB across environments

It's often very convenient to run a prod DB in a dev environment, either for testing or for ad hoc analysis. Here's…

Alchemist Camp Feb 25, 2021

How do Elixir keyword lists work?

Are they like maps? Or tuples? What's the point, how to change them to other types and what should we do with them?

Alchemist Camp Feb 24, 2021

Modeling die rolls in Postgres (basic stat functions)

In many cases, it's better to do statistical calculations from the database instead of from your application. Even…

Alchemist Camp Feb 23, 2021

Running functions straight from the command line (Elixir)

Here's the quickest way to call a function with command line arguments. Rut it directly from the command line... with or…