NobbZ

NobbZ

Database mocking without requiring an *external* preconfigured database

For some python projects at work we found that there are pytest-{postgres,mysql,redis} and probably more.

These tools take the burden off of you to maintain a Dev database locally which you need to configure your in Dev applications accordingly.

Those are basically plugins for pytest, which use the fixture mechanism of pytest to provide temporary “installations” of the tool in question, “persisting” it’s data into temporary folders and removing after the suite has run.

Even though this has an obvious runtime cost to initialise the tooling for each test run, it really made onboarding the junior quite easy. We just told them to install mysql package for their Ubuntu WSL and told them to run make test which wrapped the actual test run with proper command line arguments. No need to walk them through configuring a local mysql or having remember to run some docker(-compose) whenever changing projects.

Has anyone seen something similar for elixir or is there any interest in it?

Most Liked

NobbZ

NobbZ

We used the MySQL version of those plugins, that basically starts a mysql demon with a configuration pointing the data dir to somewhere in tmp, listening on specified ports or domain sockets.

It manages the full database application lifecycle.

dallagi

dallagi

If I understood your requirement correctly, you may be interested in excontainers, a library I developed to tackle exactly this problem.

Unfortunately it has not seen much adoption yet, but in case you decide to give it a try I’d be happy to hear about any problem you may encounter or any feedback you may have :slight_smile:

Where Next?

Popular in Discussions Top

vans163
So useless benchmarks aside, Its possible to write a webserver that can serve 300k requests per second (perhaps more with optimizations)....
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
rms.mrcs
A couple of days ago I was discussing with a friend about different approaches to write microservices. He said that if he was going to w...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
AstonJ
If so I (and hopefully others!) might have some tips for you :slight_smile: But first, please say which area you’re finding most challen...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Other popular topics Top

ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement