Emil Privér

Hey! My name is Emil Privér, I write about stuffs I learn and build. I am a software developer who likes exploring stuffs and writing articles.

Geni, A database migration CLI tool

I’m excited to introduce Geni, a user-friendly CLI migration tool for databases written in Rust. It currently supports LibSQL, Postgres, MariaDB, MySQL, and SQLite, and I have plans to add support for more databases in the future. The concept behind Geni is simple: it can seamlessly integrate with your code as a plugin for your CI, or as a sidebar in Kubernetes, without causing any disruptions or requiring you to use a specific programming language....

December 28, 2023 · 4 min · 728 words

Rust: Multithreading

Time to dive into multi-threading in Rust, a topic that many developers work with and something that sets Rust apart by enforcing rules to ensure memory safety in your code. A common use case for multi-threaded Rust is building web servers, where each thread can handle different requests. However, multi-threaded programming can present a few challenges. Rust aims to tackle these challenges by offering compile-time alerts. Some of these challenges include race conditions and deadlocks....

December 25, 2023 · 13 min · 2718 words

Rust: Traits

It has been a while since Rust introduced traits, which are similar to interfaces in most other languages (although they do have some differences). Personally, I really enjoy working with traits because they provide great flexibility within a statically typed language. However, they can be a bit confusing to grasp at first. The goal of this post is to help you gain a better understanding of traits. The case we will use in this post is a real use-case, as I am currently working on a SQL migration tool....

December 16, 2023 · 9 min · 1718 words

Rust: Memory Management

Rust is an amazing low-level language that empowers users to work directly with memory. It provides developers with both thread-safety and memory safety, which are fantastic features. This post is all about working with memory in Rust and covers interesting topics such as the stack, heap, and the .clone() method. Rust keeps its promise of ensuring memory safety to developers through its ownership system. Unlike other systems languages that rely on garbage collection or require manual memory management, Rust intelligently manages memory through a system of ownership rules that the program must follow in order to compile....

November 27, 2023 · 11 min · 2225 words

Running Migrations To Google Cloud SQL Database From Github Actions

For a hobby project, I am using Google Cloud as my hosting provider. Recently, I built a way to run migrations from GitHub actions to my Cloud SQL Database using DBmate. However, my database is running within a VPC, which makes it difficult to connect to the database as it is within a private network with a firewall that does not accept traffic from the outside world. Fortunately, I found three potential solutions to this issue....

October 16, 2023 · 7 min · 1440 words