WIP db provider support for Mysql and Postgres

This commit is contained in:
Kwoth
2022-04-11 10:41:26 +00:00
parent 8e1ec2ed9e
commit e23233ee06
66 changed files with 21891 additions and 382 deletions

View File

@@ -41,10 +41,7 @@ public sealed class Bot
_credsProvider = new BotCredsProvider(totalShards);
_creds = _credsProvider.GetCreds();
_db = new(_creds);
if (shardId == 0)
_db.Setup();
_db = new(_credsProvider);
var messageCacheSize =
#if GLOBAL_NADEKO
@@ -286,6 +283,9 @@ public sealed class Bot
public async Task RunAsync()
{
if (ShardId == 0)
await _db.SetupAsync();
var sw = Stopwatch.StartNew();
await LoginAsync(_creds.Token);