SQLite Forum

Creating an emty database
Login
> Is there a way to create an empty database on the disk?

```
$ ./sqlite3 foo.db
SQLite version 3.34.0 2020-08-28 11:19:49
Enter ".help" for usage hints.
sqlite> .exit
$ l foo.db
ls: cannot access 'foo.db': No such file or directory
```

Apparently you have to perform some write operation first:

```
$ ./sqlite3 foo.db
SQLite version 3.34.0 2020-08-28 11:19:49
Enter ".help" for usage hints.
sqlite> create table t(a); drop table t;
sqlite> .exit
$ l foo.db
-rw-r--r-- 1 stephan stephan 8192 Dec 26 01:56 foo.db
```