惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
小众软件
小众软件
D
Docker
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
V2EX
博客园 - 叶小钗
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
IT之家
IT之家
博客园 - 司徒正美
M
MIT News - Artificial intelligence
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Supabase dual-DB gotcha — test vs live, and how I stopped...
Jakub · 2026-05-06 · via DEV Community

Jakub

I spent two hours debugging an empty production list. The data was in the test database the whole time.

If you're building with Lovable and Supabase, there's a gotcha that will bite you eventually — and when it does, you'll wonder why nobody warned you. Consider this your warning.

The setup nobody explains

When you spin up a Supabase project through Lovable, you get two database environments: test and live. This makes sense in theory — you don't want your AI-assisted edits touching production data while you're experimenting.

The problem? The boundary between these two is almost invisible.

When you use the AI chat in Lovable to insert data — say, seed some blog posts, add sample users, or populate a lookup table — that data goes into the test database. Your production app, the one your users actually visit, reads from the live database.

You insert ten records. You check the app. Zero records. You start debugging.

Where the confusion hits

Here's the typical debugging spiral:

  1. You ask the AI to insert data. It confirms success.
  2. You open your app. The list is empty.
  3. You check your query. It looks correct.
  4. You add console logs. The query runs fine, returns nothing.
  5. You start questioning your RLS policies, your auth setup, your entire understanding of PostgreSQL.

The data is there. It's just in the wrong database.

The fix is one toggle

In Lovable's Supabase integration, there's a SQL Editor with a toggle to switch between test and live environments. When you need data in production, you switch to Live and run your inserts there.

Simple — once you know about it. Brutal when you don't.

My pre-deploy checklist

After getting burned on this across multiple projects at Inithouse (we run about a dozen MVPs built on Lovable + Supabase), I started using a quick checklist before every deploy:

1. Check which database you're targeting. Before any insert, look at the SQL Editor toggle. If it says "test" and you need production data, switch it.

2. Don't trust AI chat inserts for production. The AI chat is great for prototyping, but treat its database writes as test-only by default. For production data, use the SQL Editor switched to Live.

3. Verify after insert. After running your production inserts, open your deployed app and confirm the data shows up. Don't assume — check.

4. Document your seed data. Keep your production seed SQL in a file. When you inevitably need to re-run it (new environment, data reset, migration), you want it ready.

Why this matters for real products

This isn't just a development inconvenience. I've shipped Živá Fotka and HereWeAsk on the Lovable + Supabase stack. Both had moments where content was "missing" in production because someone inserted it through the AI chat.

For an MVP you're validating with real users, showing an empty page when there should be content is a conversion killer. Users don't debug — they leave.

The broader lesson

AI-assisted builders are incredible for speed. But they abstract away infrastructure in ways that create new categories of bugs. The test-vs-live database split is Supabase doing the right thing by protecting your production data. The gap is in making that split visible enough.

If you're building on Lovable + Supabase, bookmark this. You'll need it at 11 PM on a Sunday when your production page is empty and you can't figure out why.


I'm Jakub, building a portfolio of micro-products at Inithouse. Follow along for more war stories from the AI-assisted building trenches.