can you add support for mysql please ?
yoooby opened this issue · 1 comments
yoooby commented
can you add support for mysql please ?
krisdb2009 commented
When you start the container, a database config file will be generated.
When generating a new Medoo class, you should be able to swap out the sqlite config for a config of your choice.
Keep in mind that the ./api/?db admin database config web page will no longer function.
You may also need to generate the database schema yourself in MySQL.
Most of the schema is generated in this file:
https://github.com/belowaverage-org/phonebook/blob/master/api/reqs/database.run.php
<?php
if(!isset($singlePointEntry)){http_response_code(403);exit;}
/* PhoneBook database settings */
$dbConfig = array(
\'insertLoopLimit\' => 100 //Determines how many rows can be inserted at a time before the Phone Book API will start splitting the database calls.
);
/* Database connection settings */
require_once(\'./reqs/medoo.lib.php\');
use Medoo\Medoo;
$db = new Medoo([
\'database_type\' => \'sqlite\',
\'database_file\' => \'../data/db/database.sqlite3\'
]);
/* Database technology specific settings */
$db->query(\'PRAGMA foreign_keys = ON;\');
?>