Skip to main content

Database

PingoJS needs a database to store all its precious data treasures. πŸ΄β€β˜ οΈ
But fear not, brave explorer! Below you'll find all the information you need and a shiny example to guide you on your quest. πŸ—ΊοΈβœ¨

info

As of v1.0.1-beta.1, the supported database drivers are: mysqli and sqlit.

/private/config/system/databaseConf.php
$GLOBALS['PINGOJS_CONF']["PINGOJS_CONF_VARS"] =
[
'DB' => [
'Connections' => [
'SERVER' => [
'dbname' => 'db',
'driver' => 'sqlit',
'host' => 'db',
'password' => 'db',
'user' => 'db',
'port' => '3306',
'path' => "workdir:private/data/db/database.db"
],
'LOCAL' => [
'dbname' => 'db',
'driver' => 'mysqli',
'host' => '127.0.0.1',
'user' => 'db',
'password' => 'db',
'port' => '3306',
'path' => "workdir:private/data/db/database.db"
],
],
],
];
tip

workdir: is a PingoJS variable used to specify the working directory.