---
title: "The Dangers of Testing in SQLite as a Postgres User"
description: "Testing against SQLite when production runs Postgres gives false confidence."
url: "https://swe.quest/articles/the-dangers-of-testing-in-sqlite-as-a-postgres-user-e7593810c6b7484d"
canonical: "https://neon.com/blog/testing-sqlite-postgres"
source: "Neon"
published: "2025-02-17"
difficulty: "medium"
kind: "Opinion"
reading_minutes: 9
tags: ["testing","postgres","sqlite","sql"]
---

# The Dangers of Testing in SQLite as a Postgres User

A post on [Neon](https://swe.quest/sources/neon.md), published 2025-02-17, 9 min read, Opinion. Original: [https://neon.com/blog/testing-sqlite-postgres](https://neon.com/blog/testing-sqlite-postgres)

## Summary

Testing against SQLite when production runs Postgres gives false confidence. SQLite's type affinity accepts a float in an INTEGER column that Postgres rejects. It also lacks native JSONB operators, arrays and advanced window functions. Its database-level, single-writer locking and in-process, low-I/O design hide Postgres concurrency behavior and performance characteristics. The recommended alternative is ephemeral Neon branches per test, which give real Postgres semantics with throwaway isolation.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

SQLite, PostgreSQL, Neon, JSONB, MVCC, type affinity

## Related posts

- [Is “SQL from the frontend” viable?](https://swe.quest/articles/is-sql-from-the-frontend-viable-7fa2effc8f7be530.md): Neon · 2024-11-07 · Easy · 3 min read · PostgreSQL, Identity & auth, System design, Security
  Letting the frontend query the database directly, via tools like PostgREST or Firebase, can sharply speed up development by removing backend abstraction layers and frontend/backend team dependencies, which makes it attractive for prototypes and many apps.
- [Test Your Database Without Mocks](https://swe.quest/articles/test-your-database-without-mocks-093131d18e46824a.md): Neon · 2025-01-15 · Medium · 7 min read · Testing, PostgreSQL, CI/CD
  Database mocks are brittle, expensive to maintain, and test little beyond the mock itself, since they skip real behaviour like transactions, isolation levels, foreign keys and referential integrity.
- [Beyond Docker Compose: An Alternative for Deploying Postgres for Testing](https://swe.quest/articles/beyond-docker-compose-an-alternative-for-deploying-postgres-for-testing-119ea8d590b0c90d.md): Neon · 2025-02-24 · Medium · 8 min read · PostgreSQL, Testing, Containers, CI/CD
  Docker Compose with the official Postgres image gives each developer and CI run an isolated test database, but it struggles with production-like seed data, leftover state between runs, and RAM/CPU overhead.
- [Migrating from PostgreSQL/MySQL to SQLite: When and How to Make the Switch](https://swe.quest/articles/migrating-from-postgresql-mysql-to-sqlite-when-and-how-to-make-the-switch-9d0f845128cffdd6.md): Turso · 2026-08-12 · Medium · 9 min read · SQLite, Schema migrations, PostgreSQL, MySQL, Databases
  SQLite, especially via Turso Cloud, can replace PostgreSQL or MySQL for read-heavy, moderate-write workloads, trading complex-JOIN optimization, stored procedures, rich types and native replication for simpler operations, lower cost and local reads.
- [What To Know About Postgres if You’re Coming From SQL Server](https://swe.quest/articles/what-to-know-about-postgres-if-you-re-coming-from-sql-server-2dbf370eb4f4c29d.md): Neon · 2024-12-10 · Medium · 9 min read · PostgreSQL, SQL, Databases
  Postgres and SQL Server share SQL but differ in dialect details that trip up migrating developers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
