1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

feat: review comments

This commit is contained in:
Christy Jacob 2022-07-27 22:29:27 +05:30
parent da16c0159b
commit 9e183f8994
2 changed files with 24 additions and 19 deletions

View file

@ -287,25 +287,7 @@ return [
'required' => false,
'question' => '',
'filter' => 'password'
],
[
'name' => '_APP_DB_PROJECT',
'description' => 'A list of comma separated key value pairs for Project DBs where key is the database name and value is the DSN connection string. Example: db_fra1_01=mysql://user:password@112.145.123.1:3306/appwrite, db_fra1_02=mysql://user:password@112.145.123.5:3306/appwrite',
'introduction' => '0.16.0',
'default' => 'db_fra1_02=mysql://user:password@mariadb:3306/appwrite',
'required' => true,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_DB_CONSOLE',
'introduction' => '0.16.0',
'description' => 'A key value pair representing the console DB where key is the database name and value is the DSN connection string. Example: db_fra1_01=mysql://user:password@112.145.123.1:3306/appwrite',
'default' => 'db_fra1_01=mysql://user:password@mariadb:3306/appwrite',
'required' => true,
'question' => '',
'filter' => ''
],
]
],
],
[

View file

@ -53,10 +53,13 @@ use Appwrite\Database\DatabasePool;
use Appwrite\Event\Delete;
use Utopia\Database\Validator\Structure;
use Utopia\Database\Validator\Authorization;
use Utopia\Cache\Cache;
use Utopia\Cache\Adapter\Redis as RedisCache;
use Utopia\Validator\Range;
use Utopia\Validator\WhiteList;
use Swoole\Database\RedisConfig;
use Swoole\Database\RedisPool;
use Utopia\Database\Adapter\MariaDB;
use Utopia\Database\Query;
use Utopia\Storage\Device;
use Utopia\Storage\Storage;
@ -858,6 +861,26 @@ App::setResource('console', function () {
]);
}, []);
// App::setResource('dbForProject', function ($db, $cache, Document $project) {
// $cache = new Cache(new RedisCache($cache));
// $database = new Database(new MariaDB($db), $cache);
// $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
// $database->setNamespace("_{$project->getInternalId()}");
// return $database;
// }, ['db', 'cache', 'project']);
// App::setResource('dbForConsole', function ($dbPool, $cache) {
// $cache = new Cache(new RedisCache($cache));
// $database = new Database(new MariaDB($db), $cache);
// $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
// $database->setNamespace('_console');
// return $database;
// }, ['dbPool', 'cache']);
App::setResource('deviceLocal', function () {
return new Local();
});