Categories
PostgreSQL Spring

PostgreSQL integration tests using Testcontainers

Running tests against a real database provides more confidence in comparison to an in-memory database such as H2. For that, the Testcontainers library is a wise choice as it provides an out-of-the-box solution to write and run integration tests against an actual database of your choice running in a Docker container. In this tutorial, we […]

Categories
MySQL Spring

Spring Boot MySQL integration tests with Testcontainers

When it comes to writing database integration tests with Spring Boot, there are two options: an in-memory database or Testcontaienrs. As we already covered Testing Spring Data Repositories with H2 in-memory database, we shift the gear in this article and focus on writing Spring Boot MySQL integration tests with Testcontainers. Introduction Although utilizing an in-memory […]

Categories
Database General

A guide to the main differences between NoSQL vs. SQL databases

A while back here on the blog, our article ‘Some Basic SQL Queries’ provided beginner-friendly commands for building and deploying SQL databases. These databases have long been popular in the programming community as the syntax and storage logic used are straightforward and reliable. It’s no wonder they remain suited for virtually any industry across a wide […]

Categories
MySQL

How to enable MySQL query logging

To inspect MySQL query execution, one can enable query logging and pipe the output to a file or table to gain insights about running queries. In this article, we cover how to enable MySQL querying logging and save queries to a file. When using an ORM framework, developers often want to know what’s happening behind […]

Categories
MySQL

Export MySQL query results as JSON

In one of the latest post, I discussed how to transform a large MySQL table to JSON using Apache Spark. Well, that approach works for any tables with any volume. But it’s an overkill for simple and small tables. The good news is MySQL by default has a feature for that. In this article, I […]

Categories
MySQL

Emulating intersection in MySQL with self-join

As you may know, MySQL does not support INTERSECT operation. Hence, to get the intersection between two result sets in the same table, we need to use self-join. In this tutorial, I cover the emulating intersection in MySQL with self-join. But what the heck is self-join? Essentially, self-join is a simple join where both sides […]

Exit mobile version