Vibe Coding with Replit -- May 3, 2026

How to Add a Database to My Replit App Without Writing SQL

By Arjita SethiMay 3, 20265 min read
Direct Answer

Add a database to your Replit app without writing SQL by telling Claude what data you need to store and asking it to set up a SQLite database with the right tables. Claude writes all the SQL for creating tables and all the JavaScript code for reading and writing data. You describe the data structure in plain language -- "I need to store email addresses, first names, and the date they signed up" -- and Claude handles the rest.

What a Database Actually Does

A database stores information your app needs to remember between sessions. Without a database, every time a user submits a form, the data disappears when the app restarts. With a database, the data persists -- email signups accumulate, orders are recorded, user information is saved.

Most people assume adding a database means writing SQL queries. It does -- but Claude writes them. Your job is to describe what data you need to store, not to write the storage code.

The simplest starting point: SQLite for Replit apps. It is a file-based database -- no separate server to set up, no connection credentials to manage. It lives in a file in your Replit project. Claude sets it up, creates the tables, and writes all the read and write functions. You describe the data structure in plain language.

How to Tell Claude What Database You Need

Describe your data in plain language: "I need to store a table called leads with these columns: id (auto-incrementing), first_name (text), email (text, unique), biggest_challenge (text), created_at (timestamp with default now). I need functions to insert a new lead and to get all leads sorted by most recent."

This description tells Claude everything it needs to write the database setup code, the table creation SQL, and the insert and query functions.

When to Use Something Other Than SQLite

SQLite is perfect for apps with moderate data and a single server. If you expect high write volume from many users simultaneously, or if you want to access the data from multiple services, consider PostgreSQL via Neon (a serverless PostgreSQL provider with a generous free tier). Claude can set this up too -- the description approach is identical.

Frequently Asked Questions

How do I add a database to my Replit app?
Tell Claude what data you need to store in plain language (table name, column names, column types), ask it to set up SQLite with the right tables, and paste the code. Claude writes all the SQL and all the JavaScript database functions.
Do I need to know SQL to use a database in Replit?
No. Describe your data structure in plain language and Claude writes all the SQL. Understanding what SQL does (storing and retrieving structured data) is more useful than knowing how to write it.
What is SQLite and why is it recommended for Replit?
SQLite is a file-based database that lives in a file in your Replit project. No separate server, no connection credentials, minimal setup. It is the simplest database option for Replit apps and Claude sets it up reliably.
How do I view the data stored in my Replit database?
Ask Claude to add an admin endpoint -- a protected route like /admin/leads that displays all stored data. Alternatively, download the SQLite file from Replit and open it with a free tool like DB Browser for SQLite.
When should I use PostgreSQL instead of SQLite?
When you expect high write volume from many simultaneous users, when you need to access the data from multiple services, or when your app grows beyond SQLite's practical capacity. Neon provides free serverless PostgreSQL that Claude can integrate into Replit.
Build With AI

Build Your First Database-Connected App

The Vibe Coding track at Build with AI covers databases and data persistence.

Explore the University