SSQLite : Connection Example and real database location to put the DB

Higuys. Ineed know hw i make a DATABASE CONNECTION with SQLITE and where i put my database in folders structure.

And a SQLite DB have the same methods then MySQL in database processes ?

I know about performances diferences… :slight_smile:

Thanks for attention.

I’ve never used SQLlite with Cakephp, but have you looked @ stackoverflow? How about something like this:
http://stackoverflow.com/questions/8035314/using-sqlite3-with-cakephp-2-0

As far as I know, you only have to make the proper configuration; You should be able to use exactly the same DB find methods as with normal MySQL.

Ok… but is CAKE 3.2 not 2.0
The correct sentence is…

In my CakePHP 3.2 /config/app.php >>

/** BD SQLite /
‘Datasources’ => [
‘default’ => [
‘className’ => ‘Cake\Database\Connection’,
‘driver’ => ‘Cake\Database\Driver\Sqlite’,
‘persistent’ => false,
‘database’ => ‘default’,
‘encoding’ => ‘utf8’,
‘timezone’ => ‘UTC’,
],
],
/
* - - - - - */

The database “default” will be created automatic by system when you run the default page .

Work fine… thanks.

1 Like

Im getting error of this # Missing Datasource.
In my CakePHP 3 /config/app.php
‘datasource’ => ‘Database/Sqlite’,
‘persistent’ => false,
‘database’ => ‘simplequeue.sqlite’,
‘encoding’ => ‘utf-8’,
‘driver’ => ‘sqlite3’,
how to install/use driver?

This has been answered above.
Just use:
className’ => ‘Cake\Database\Connection’,
‘driver’ => ‘Cake\Database\Driver\Sqlite’,
database => {the full path to your database file},

You dont need to alter any other database settings.