Christian Ulson

Built an in-memory SQL engine to speed up repository tests

by

I kept running into the same issue when testing repository layers that rely heavily on SQL.

Integration tests with a real database are essential, but they slow feedback cycles and add infrastructure complexity. Mocks don’t catch real SQL issues, and SQLite often introduces dialect differences that require adaptation.

So I built an open-source in-memory SQL engine for .NET to validate SQL behavior during unit tests.

It plugs into IDbConnection, allowing repositories (Dapper or raw SQL) to run unchanged while keeping tests fast and deterministic.

What it aims to help with

  • validating SQL logic early

  • catching constraint and query issues

  • avoiding dialect drift in tests

  • keeping CI pipelines fast

  • eliminating infrastructure setup

It’s not meant to replace integration tests — only to catch issues earlier.

Repo:
https://github.com/christianulson/DbSqlLikeMem

NuGet:
https://www.nuget.org/packages/DbSqlLikeMem/

I’d love feedback, real-world scenarios, or edge cases that could improve it.

15 views

Add a comment

Replies

Be the first to comment