How to create an empty SQLite database
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.
I wrote 21 books to help you become a better developer:
- HTML Handbook
- Next.js Pages Router Handbook
- Alpine.js Handbook
- HTMX Handbook
- TypeScript Handbook
- React Handbook
- SQL Handbook
- Git Cheat Sheet
- Laravel Handbook
- Express Handbook
- Swift Handbook
- Go Handbook
- PHP Handbook
- Python Handbook
- Linux Commands Handbook
- C Handbook
- JavaScript Handbook
- Svelte Handbook
- CSS Handbook
- Node.js Handbook
- Vue Handbook
Also, JOIN MY CODING BOOTCAMP, an amazing cohort course that will be a huge step up in your coding career - covering React, Next.js - next edition February 2025