- Database namespace is now NadekoBot.Db

- Db related code is now in src/NadekoBot/Db
- Finished major part of the db refactor, but many optimizations are left to be made
This commit is contained in:
Kwoth
2021-06-19 06:08:09 +02:00
parent c127dcd1e3
commit d42705087e
141 changed files with 104 additions and 102 deletions

View File

@@ -12,7 +12,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Core.Services.Database.Repositories.Impl;
using NadekoBot.Db;
namespace NadekoBot.Modules.Administration.Services
{

View File

@@ -9,7 +9,7 @@ using System.Threading.Channels;
using LinqToDB;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Core.Services.Database.Repositories.Impl;
using NadekoBot.Db;
using NadekoBot.Extensions;
using Serilog;

View File

@@ -5,7 +5,7 @@ using Discord.WebSocket;
using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Repositories.Impl;
using NadekoBot.Db;
using Serilog;
namespace NadekoBot.Modules.Administration.Services

View File

@@ -6,6 +6,7 @@ using NadekoBot.Extensions;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using System.Threading.Tasks;
using NadekoBot.Db;
namespace NadekoBot.Modules.Administration.Services
{

View File

@@ -12,6 +12,7 @@ using Microsoft.Extensions.Caching.Memory;
using NadekoBot.Common.Collections;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration.Common;

View File

@@ -10,6 +10,7 @@ using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using Serilog;
namespace NadekoBot.Modules.Administration.Services

View File

@@ -11,6 +11,7 @@ using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Extensions;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Common.TypeReaders.Models;
using NadekoBot.Db;
using Serilog;
namespace NadekoBot.Modules.Administration.Services

View File

@@ -8,6 +8,7 @@ using NadekoBot.Extensions;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Db;
using Serilog;
namespace NadekoBot.Modules.Administration.Services

View File

@@ -1,15 +1,13 @@
using Discord;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Modules.Administration;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Db;
using NadekoBot.Modules.Xp;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Modules.Xp.Common;
namespace NadekoBot.Modules.Administration.Services
{

View File

@@ -12,8 +12,8 @@ using NadekoBot.Common.Replacements;
using NadekoBot.Core.Common.TypeReaders.Models;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Modules.Permissions.Services;
using Newtonsoft.Json;
using Serilog;

View File

@@ -8,6 +8,7 @@ using Discord.WebSocket;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using Serilog;
namespace NadekoBot.Modules.Administration.Services

View File

@@ -5,7 +5,6 @@ using NadekoBot.Common;
using NadekoBot.Modules.Gambling.Common;
using NadekoBot.Modules.Gambling.Common.Blackjack;
using NadekoBot.Modules.Gambling.Services;
using NadekoBot.Services;
using NadekoBot.Extensions;
using System.Linq;
using System.Threading.Tasks;

View File

@@ -2,7 +2,6 @@ using Discord;
using Discord.Commands;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Services;
using NadekoBot.Extensions;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

View File

@@ -12,7 +12,6 @@ using NadekoBot.Modules.Gambling.Common;
using Image = SixLabors.ImageSharp.Image;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using NadekoBot.Services;
namespace NadekoBot.Modules.Gambling
{

View File

@@ -4,7 +4,7 @@ using Discord.WebSocket;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Gambling.Common;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using NadekoBot.Extensions;
using NadekoBot.Modules.Gambling.Services;
using System;
@@ -17,6 +17,7 @@ using NadekoBot.Core.Common;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
namespace NadekoBot.Modules.Gambling
{

View File

@@ -11,6 +11,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Common;
using NadekoBot.Db;
using NadekoBot.Modules.Gambling.Services;
using Serilog;

View File

@@ -5,6 +5,7 @@ using NadekoBot.Common.Collections;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration;

View File

@@ -19,7 +19,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NadekoBot.Modules.Administration;
using NadekoBot.Db;
using Image = SixLabors.ImageSharp.Image;
using Color = SixLabors.ImageSharp.Color;

View File

@@ -1,16 +1,15 @@
using Discord;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Modules.Gambling.Common.Waifu;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Core.Services.Database.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Db;
using NadekoBot.Modules.Gambling.Common;
using NadekoBot.Modules.Gambling.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Gambling.Services
{

View File

@@ -12,6 +12,7 @@ using NadekoBot.Modules.Gambling.Common;
using NadekoBot.Modules.Gambling.Services;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration;
using Serilog;

View File

@@ -1,10 +1,10 @@
using Discord;
using Discord.Commands;
using NadekoBot.Services;
using System;
using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Core.Services;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using NadekoBot.Modules.Games.Services;
using NadekoBot.Modules.Games.Common.ChatterBot;

View File

@@ -1,7 +1,6 @@
using System.Threading.Tasks;
using Discord;
using NadekoBot.Services.Database.Models;
using NadekoBot.Services;
using NadekoBot.Db.Models;
using System;
using System.Linq;
using System.Threading;

View File

@@ -9,7 +9,6 @@ using CommandLine;
using NadekoBot.Common;
using NadekoBot.Core.Common;
using NadekoBot.Core.Services;
using NadekoBot.Services;
namespace NadekoBot.Modules.Games.Common
{

View File

@@ -6,11 +6,11 @@ using Discord;
using Discord.WebSocket;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Modules.Games.Common;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using NadekoBot.Common.Collections;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Extensions;
using Serilog;

View File

@@ -8,8 +8,8 @@ using Discord.Commands;
using NadekoBot.Common.Attributes;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Db.Models;
using NadekoBot.Extensions;
using NadekoBot.Modules;
using NadekoBot.Modules.Music;

View File

@@ -9,10 +9,9 @@ using Discord;
using Discord.WebSocket;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Core.Services.Database.Repositories.Impl;
using NadekoBot.Db;
using NadekoBot.Modules.Music;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using NadekoBot.Extensions;
using Serilog;

View File

@@ -10,6 +10,7 @@ using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.Collections;
using NadekoBot.Common.TypeReaders;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using NadekoBot.Modules.Permissions.Services;

View File

@@ -9,6 +9,7 @@ using NadekoBot.Common.Attributes;
using NadekoBot.Common.Collections;
using NadekoBot.Modules.Permissions.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
namespace NadekoBot.Modules.Permissions

View File

@@ -10,6 +10,7 @@ using Discord.WebSocket;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.TypeReaders;
using NadekoBot.Common.TypeReaders.Models;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using NadekoBot.Modules.Permissions.Common;
using NadekoBot.Modules.Permissions.Services;

View File

@@ -8,6 +8,7 @@ using NadekoBot.Core.Services.Database.Models;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Common;
using NadekoBot.Db;
namespace NadekoBot.Modules.Permissions.Services
{

View File

@@ -11,6 +11,7 @@ using NadekoBot.Core.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using Serilog;

View File

@@ -11,6 +11,7 @@ using NadekoBot.Extensions;
using NadekoBot.Modules.Permissions.Common;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
namespace NadekoBot.Modules.Permissions.Services

View File

@@ -1,5 +1,5 @@
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Searches.Common
{

View File

@@ -1,5 +1,5 @@
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Searches.Common
{

View File

@@ -5,7 +5,7 @@ using System.Net.Http;
using System.Threading.Tasks;
using NadekoBot.Modules.Searches.Common.StreamNotifications.Providers;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using Newtonsoft.Json;
using Serilog;
using StackExchange.Redis;

View File

@@ -6,7 +6,7 @@ using System.Net.Http.Headers;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using Newtonsoft.Json;
using Serilog;

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
#nullable enable
namespace NadekoBot.Modules.Searches.Common.StreamNotifications.Providers

View File

@@ -5,7 +5,7 @@ using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using Newtonsoft.Json;
using Serilog;

View File

@@ -10,6 +10,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
namespace NadekoBot.Modules.Searches.Services

View File

@@ -24,6 +24,7 @@ using System.Threading;
using System.Threading.Tasks;
using AngleSharp.Html.Dom;
using AngleSharp.Html.Parser;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using Serilog;
using HorizontalAlignment = SixLabors.Fonts.HorizontalAlignment;

View File

@@ -17,8 +17,9 @@ using Discord;
using Discord.WebSocket;
using NadekoBot.Common.Collections;
using NadekoBot.Common.Replacements;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using Serilog;
namespace NadekoBot.Modules.Searches.Services

View File

@@ -10,8 +10,9 @@ using NadekoBot.Common.Attributes;
using NadekoBot.Extensions;
using NadekoBot.Modules.Searches.Services;
using Discord.WebSocket;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Searches
{

View File

@@ -3,8 +3,7 @@ using Discord.Commands;
using Discord.WebSocket;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
@@ -12,6 +11,7 @@ using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using NadekoBot.Modules.Utility.Services;

View File

@@ -3,15 +3,13 @@ using Discord.Commands;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.Replacements;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using NadekoBot.Extensions;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Core.Services.Database.Repositories.Impl;
using NadekoBot.Db;
namespace NadekoBot.Modules.Utility

View File

@@ -7,8 +7,8 @@ using Discord.Commands;
using NadekoBot.Common.Attributes;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Db.Models;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Modules.Utility.Common;

View File

@@ -5,13 +5,13 @@ using System.Threading.Tasks;
using Discord;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using System;
using Discord.WebSocket;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
namespace NadekoBot.Modules.Utility.Services

View File

@@ -1,8 +1,7 @@
#nullable enable
using Discord.WebSocket;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using NadekoBot.Extensions;
using System;
using System.Collections.Generic;

View File

@@ -11,6 +11,7 @@ using NadekoBot.Common.TypeReaders;
using NadekoBot.Modules.Utility.Common;
using NadekoBot.Modules.Utility.Common.Exceptions;
using Discord.Net;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using Serilog;

View File

@@ -6,6 +6,7 @@ using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using NadekoBot.Modules.Help.Services;
using NadekoBot.Core.Services;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
namespace NadekoBot.Modules.Utility.Services

View File

@@ -7,7 +7,7 @@ using NadekoBot.Modules.Xp.Services;
using System;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Xp
{

View File

@@ -1,5 +1,5 @@
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Xp
{

View File

@@ -1,14 +1,13 @@
using NadekoBot.Services;
using System;
using System;
using System.Collections.Generic;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using Discord;
using System.Linq;
using NadekoBot.Extensions;
using System.Net.Http;
using System.Threading.Tasks;
using NadekoBot.Core.Services;
using NadekoBot.Modules.Xp.Common;
using NadekoBot.Db;
namespace NadekoBot.Modules.Xp.Services
{

View File

@@ -1,5 +1,4 @@
using System;
using NadekoBot.Core.Common;
using NadekoBot.Core.Common;
using NadekoBot.Core.Common.Configs;
using NadekoBot.Core.Services;

View File

@@ -2,8 +2,7 @@ using Discord;
using Discord.WebSocket;
using NadekoBot.Common;
using NadekoBot.Common.Collections;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db.Models;
using NadekoBot.Extensions;
using Newtonsoft.Json;
using SixLabors.Fonts;
@@ -19,15 +18,11 @@ using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using AngleSharp.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Core.Services.Impl;
using NadekoBot.Modules.Administration;
using NadekoBot.Modules.Xp;
using NadekoBot.Modules.Xp.Common;
using NadekoBot.Db;
using Serilog;
using StackExchange.Redis;
using Image = SixLabors.ImageSharp.Image;