can you add support for mysql please ? #26
-
Beta Was this translation helpful? Give feedback.
Answered by
krisdb2009
Apr 8, 2021
Replies: 1 comment
-
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. 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;\');
?> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
krisdb2009
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://medoo.in/api/new
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