- 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

@@ -5,6 +5,7 @@ using NadekoBot.Core.Services;
using System; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Db;
using NadekoBot.Modules.Gambling.Services; using NadekoBot.Modules.Gambling.Services;
namespace NadekoBot.Core.Common.TypeReaders namespace NadekoBot.Core.Common.TypeReaders

View File

@@ -1,10 +1,9 @@
using NadekoBot.Core.Services.Database.Models; using System.Linq;
using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Collections.Generic; using System.Collections.Generic;
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Xp.Common namespace NadekoBot.Db
{ {
public static class ClubExtensions public static class ClubExtensions
{ {

View File

@@ -3,7 +3,7 @@ using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Core.Services.Database namespace NadekoBot.Db
{ {
public static class CurrencyTransactionExtensions public static class CurrencyTransactionExtensions
{ {

View File

@@ -1,11 +1,10 @@
using NadekoBot.Services.Database.Models; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using LinqToDB; using LinqToDB;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Modules.CustomReactions namespace NadekoBot.Db
{ {
public static class CustomReactionsExtensions public static class CustomReactionsExtensions
{ {

View File

@@ -1,13 +1,11 @@
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Discord; using Discord;
using System.Collections.Generic; using System.Collections.Generic;
using System;
using NadekoBot.Core.Services.Database; using NadekoBot.Core.Services.Database;
using NadekoBot.Core.Services.Database.Repositories;
namespace NadekoBot.Core.Services namespace NadekoBot.Db
{ {
public static class DiscordUserExtensions public static class DiscordUserExtensions
{ {

View File

@@ -4,9 +4,9 @@ using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System; using System;
using NadekoBot.Core.Services.Database; using NadekoBot.Core.Services.Database;
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Db
{ {
public static class GuildConfigExtensions public static class GuildConfigExtensions
{ {

View File

@@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Core.Services.Database.Repositories.Impl namespace NadekoBot.Db
{ {
public static class MusicPlayerSettingsExtensions public static class MusicPlayerSettingsExtensions
{ {

View File

@@ -1,11 +1,10 @@
using NadekoBot.Services.Database.Models; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Modules.Music namespace NadekoBot.Db
{ {
public static class MusicPlaylistExtensions public static class MusicPlaylistExtensions
{ {

View File

@@ -1,12 +1,12 @@
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services.Database; using NadekoBot.Core.Services.Database;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database; using NadekoBot.Db;
namespace NadekoBot.Modules.Games.Common namespace NadekoBot.Db
{ {
public static class PollExtensions public static class PollExtensions
{ {

View File

@@ -5,7 +5,7 @@ using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Common; using NadekoBot.Common;
namespace NadekoBot.Core.Services.Database.Repositories.Impl namespace NadekoBot.Db
{ {
public static class QuoteExtensions public static class QuoteExtensions
{ {

View File

@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace NadekoBot.Modules.Utility.Common namespace NadekoBot.Db
{ {
public static class ReminderExtensions public static class ReminderExtensions
{ {

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace NadekoBot.Modules.Administration.Common namespace NadekoBot.Db
{ {
public static class SelfAssignableRolesExtensions public static class SelfAssignableRolesExtensions
{ {

View File

@@ -1,13 +1,11 @@
using NadekoBot.Services.Database.Models; using System.Linq;
using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Collections.Generic; using System.Collections.Generic;
using LinqToDB; using LinqToDB;
using NadekoBot.Core.Services.Database; using NadekoBot.Core.Services.Database;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Services.Database;
namespace NadekoBot.Modules.Xp.Common namespace NadekoBot.Db
{ {
public static class UserXpExtensions public static class UserXpExtensions
{ {

View File

@@ -6,9 +6,9 @@ using Microsoft.EntityFrameworkCore;
using NadekoBot.Core.Services.Database; using NadekoBot.Core.Services.Database;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Migrations; using NadekoBot.Migrations;
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Db
{ {
public class WaifuInfoStats public class WaifuInfoStats
{ {

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System; using System;
namespace NadekoBot.Modules.Administration.Common namespace NadekoBot.Db
{ {
public static class WarningExtensions public static class WarningExtensions
{ {

View File

@@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Services.Database.Models namespace NadekoBot.Db.Models
{ {
public class ClubInfo : DbEntity public class ClubInfo : DbEntity
{ {

View File

@@ -1,7 +1,7 @@
using System; using System;
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Services.Database.Models namespace NadekoBot.Db.Models
{ {
public class DiscordUser : DbEntity public class DiscordUser : DbEntity
{ {

View File

@@ -2,7 +2,7 @@
using NadekoBot.Core.Services.Database.Models; using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Modules.Searches.Common; using NadekoBot.Modules.Searches.Common;
namespace NadekoBot.Services.Database.Models namespace NadekoBot.Db.Models
{ {
public class FollowedStream : DbEntity public class FollowedStream : DbEntity
{ {

View File

@@ -1,7 +1,7 @@
using System; using System;
using NadekoBot.Common.Collections; using NadekoBot.Common.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
namespace NadekoBot.Core.Services.Database.Models namespace NadekoBot.Core.Services.Database.Models
{ {

View File

@@ -1,7 +1,7 @@
using NadekoBot.Extensions; using NadekoBot.Extensions;
using System.Collections.Generic; using System.Collections.Generic;
using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Common;
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
namespace NadekoBot.Core.Services.Database.Models namespace NadekoBot.Core.Services.Database.Models
{ {

View File

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

View File

@@ -6,7 +6,7 @@ using NadekoBot.Core.Services.Impl;
using System; using System;
using System.IO; using System.IO;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NadekoBot.Services.Database.Models; using NadekoBot.Db.Models;
namespace NadekoBot.Core.Services.Database namespace NadekoBot.Core.Services.Database
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More