I was following this Laravel bootcamp:
https://bootcamp.laravel.com/inertia/installation
I installed Laravel and changed DB_CONNECTION to sqlite as directed.
However when I tried to complete the installation of Laravel Breeze by running migrations, I received an exception from sqlite.
Here is the output from the command:
$ php artisan migrate
Illuminate\Database\QueryException
SQLSTATE[HY000]: General error: 1 no such table: pragma_compile_options (Connection: sqlite, SQL: select exists (select 1 from pragma_compile_options where compile_options = 'ENABLE_DBSTAT_VTAB') as enabled)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:822
818▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
819▕ );
820▕ }
821▕
➜ 822▕ throw new QueryException(
823▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
824▕ );
825▕ }
826▕ }
+30 vendor frames
31 artisan:35
Illuminate\Foundation\Console\Kernel::handle()
The file database/database.sqlite
is created but is empty.
I tried to google the error message but nothing turned up.
Here is the sqlite version used:
$ sqlite3 --version
3.32.3 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd
Here is the version of Laravel used:
$ php artisan --version
Laravel Framework 10.34.2
Is there something I can do to continue the tutorial using sqlite as the database?
Update
It seems
pragma_compile_options
is a built-in table ofSQLite
.Meaning, you not having such table means that, your Laravel's DB connection is configured for
SQLite
engine, but your actual database engine is something else.MySQL
.Another possible cause; maybe Laravel does not support your
SQLite
version.Example configs
In my
./config/database.php
file, I have something like:Old answer
Try dropping/removing all tables:
Then repeat:
Finally ensure DB has initial data, like:
Done!