How to create an empty SQLite database
New Courses Coming Soon
Join the waiting lists
I was looking for how to create an SQLite database to use with Prisma, when I found you can initialize an empty SQLite database just by creating an empty file.
I was overcomplicating it, but with SQLite initializing a new database is very very simple
For example you can use touch
from the command line to create a SQLite database named storage.db
:
$ touch storage.db
The same approach can be taken when duplicating a database with all its tables, or backing it up. You just copy the file.
→ Read my SQL Tutorial on
The Valley of Code
Here is how can I help you:
- COURSES where I teach everything I know
- CODING BOOTCAMP cohort course - next edition in 2025
- THE VALLEY OF CODE your web development manual
- BOOKS 17 coding ebooks you can download for free on JS Python C PHP and lots more
- Interesting links collection
- Follow me on X