I'm trying to play with Symfony4 and SQlite3. After:
composer create-project symfony/website-skeleton my-project
and something like LuckyNumber, I try to define DB-connection. in: config/packages/doctrine.yaml is:
doctrine:
dbal:
# configure these for your database server
url: '%env(DATABASE_URL)%'
and in .env :
DATABASE_URL="sqlite:///%kernel.project_dir%/db/sqlite3.db3"
Is there any console-command to test connection? Or maybe:
php bin/console doctrine:query:sql "select * from all_files"
should return resource or something else way to simply test the connection? Unfortunatelly Google is silent like a grave :-( How do you test DB connections in Symfony4/Doctrine?
after: php bin/console doctrine:query:sql "select * from all_files"
I got:
In AbstractSQLiteDriver.php line 89:
An exception occurred in driver: could not find driver
In PDOConnection.php line 47:
could not find driver
php7.2-sqlite3-dbgsym is installed and apache2 restarted (but I guess Symfony console do nto use Apache?)...
edit:
after Mike`s prompt, (there wasn't pdo_sqlite for this php ver.) I get:
~/Dokumenty/projects/symfony_mdb/my-project$ php bin/console doctrine:query:sql "select * from all_files"
In AbstractSQLiteDriver.php line 86:
An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file
In PDOConnection.php line 47:
SQLSTATE[HY000] [14] unable to open database file
but this is new file and none of process using it (I guess). It is possible to open it with SQlite GUI and run query with expected answer...