Allow custom plugin provided database providers to be loaded (#14171)
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
OpenAPI / OpenAPI - HEAD (push) Waiting to run
OpenAPI / OpenAPI - BASE (push) Waiting to run
OpenAPI / OpenAPI - Difference (push) Blocked by required conditions
OpenAPI / OpenAPI - Publish Unstable Spec (push) Blocked by required conditions
OpenAPI / OpenAPI - Publish Stable Spec (push) Blocked by required conditions
Tests / run-tests (macos-latest) (push) Waiting to run
Tests / run-tests (ubuntu-latest) (push) Waiting to run
Tests / run-tests (windows-latest) (push) Waiting to run
Project Automation / Project board (push) Waiting to run
Merge Conflict Labeler / Labeling (push) Waiting to run

This commit is contained in:
JPVenson
2025-06-04 01:53:37 +03:00
committed by GitHub
parent d5672ce407
commit 916e897ed2
4 changed files with 97 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.DbConfiguration;
/// <summary>
/// The custom value option for custom database providers.
/// </summary>
public class CustomDatabaseOption
{
/// <summary>
/// Gets or sets the key of the value.
/// </summary>
public required string Key { get; set; }
/// <summary>
/// Gets or sets the value.
/// </summary>
public required string Value { get; set; }
}

View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Jellyfin.Database.Implementations.DbConfiguration;
/// <summary>
/// Defines the options for a custom database connector.
/// </summary>
public class CustomDatabaseOptions
{
/// <summary>
/// Gets or sets the Plugin name to search for database providers.
/// </summary>
public required string PluginName { get; set; }
/// <summary>
/// Gets or sets the plugin assembly to search for providers.
/// </summary>
public required string PluginAssembly { get; set; }
/// <summary>
/// Gets or sets the connection string for the custom database provider.
/// </summary>
public required string ConnectionString { get; set; }
/// <summary>
/// Gets or sets the list of extra options for the custom provider.
/// </summary>
#pragma warning disable CA2227 // Collection properties should be read only
public Collection<CustomDatabaseOption> Options { get; set; } = [];
#pragma warning restore CA2227 // Collection properties should be read only
}

View File

@@ -1,3 +1,5 @@
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.DbConfiguration;
/// <summary>
@@ -10,6 +12,11 @@ public class DatabaseConfigurationOptions
/// </summary>
public required string DatabaseType { get; set; }
/// <summary>
/// Gets or sets the options required to use a custom database provider.
/// </summary>
public CustomDatabaseOptions? CustomProviderOptions { get; set; }
/// <summary>
/// Gets or Sets the kind of locking behavior jellyfin should perform. Possible options are "NoLock", "Pessimistic", "Optimistic".
/// Defaults to "NoLock".