diff options
author | vnugent <public@vaughnnugent.com> | 2024-02-16 14:51:22 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-02-16 17:25:46 -0500 |
commit | b73f0fdd70d8b560422c80a6ab9bfe96f97db3b3 (patch) | |
tree | b21494d531818f44262d53833aba5f7c6185cd92 /lib/VNLib.Plugins.Extensions.Loading.Sql/src/IRuntimeDbProvider.cs | |
parent | 54760bfabb36c96f666ca7f77028d0d6a9c812fc (diff) |
Squashed commit of the following:
commit 7b2e8b9d659f26d83c3df710056a18a9f3ddaac2
Author: vnugent <public@vaughnnugent.com>
Date: Fri Feb 16 14:21:08 2024 -0500
fix: revert mysql lib back to Pomelo and export command generators
commit d72bd53e20770be4ced0d627567ecf567d1ce9f4
Author: vnugent <public@vaughnnugent.com>
Date: Mon Feb 12 18:34:52 2024 -0500
refactor: #1 convert sql libraries to assets for better code splitting
commit 736b873e32447254b3aadbb5c6252818c25e8fd4
Author: vnugent <public@vaughnnugent.com>
Date: Sun Feb 4 01:30:25 2024 -0500
submit pending changes
Diffstat (limited to 'lib/VNLib.Plugins.Extensions.Loading.Sql/src/IRuntimeDbProvider.cs')
-rw-r--r-- | lib/VNLib.Plugins.Extensions.Loading.Sql/src/IRuntimeDbProvider.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/lib/VNLib.Plugins.Extensions.Loading.Sql/src/IRuntimeDbProvider.cs b/lib/VNLib.Plugins.Extensions.Loading.Sql/src/IRuntimeDbProvider.cs new file mode 100644 index 0000000..f6f8a24 --- /dev/null +++ b/lib/VNLib.Plugins.Extensions.Loading.Sql/src/IRuntimeDbProvider.cs @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2024 Vaughn Nugent +* +* Library: VNLib +* Package: VNLib.Plugins.Extensions.Loading.Sql +* File: IRuntimeDbProvider.cs +* +* IRuntimeDbProvider.cs is part of VNLib.Plugins.Extensions.Loading.Sql which +* is part of the larger VNLib collection of libraries and utilities. +* +* VNLib.Plugins.Extensions.Loading.Sql is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as +* published by the Free Software Foundation, either version 3 of the +* License, or (at your option) any later version. +* +* VNLib.Plugins.Extensions.Loading.Sql is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + +using System; +using System.Data.Common; +using System.Threading.Tasks; + +using Microsoft.EntityFrameworkCore; + +using VNLib.Plugins.Extensions.Loading.Sql.DatabaseBuilder; + +namespace VNLib.Plugins.Extensions.Loading.Sql +{ + /// <summary> + /// Provides a dynamic database provider for the current plugin + /// </summary> + public interface IRuntimeDbProvider + { + /// <summary> + /// Asynchronously gets the <see cref="DbConnection"/> factory for the current plugin + /// </summary> + /// <returns>A task that resolves a new DB factory function</returns> + Task<Func<DbConnection>> GetDbConnectionAsync(); + + /// <summary> + /// Asynchronously gets the <see cref="DbContextOptions"/> instance for + /// the provider's database + /// </summary> + /// <returns>A task that resolves the <see cref="DbContextOptions"/> instance</returns> + Task<DbContextOptions> GetDbOptionsAsync(); + + /// <summary> + /// Gets the command generator for the specific database provider + /// </summary> + /// <returns>A command generator instance build DB specific commands</returns> + IDBCommandGenerator GetCommandGenerator(); + } +} |