< Summary - Jellyfin

Information
Class: Jellyfin.Database.Providers.Sqlite.Migrations.SqliteDesignTimeJellyfinDbFactory
Assembly: Jellyfin.Database.Providers.Sqlite
File(s): /srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/SqliteDesignTimeJellyfinDbFactory.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 25
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
CreateDbContext(...)100%11100%

File(s)

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/SqliteDesignTimeJellyfinDbFactory.cs

#LineLine coverage
 1using Jellyfin.Database.Implementations;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Design;
 4using Microsoft.Extensions.Logging.Abstractions;
 5
 6namespace Jellyfin.Database.Providers.Sqlite.Migrations
 7{
 8    /// <summary>
 9    /// The design time factory for <see cref="JellyfinDbContext"/>.
 10    /// This is only used for the creation of migrations and not during runtime.
 11    /// </summary>
 12    internal sealed class SqliteDesignTimeJellyfinDbFactory : IDesignTimeDbContextFactory<JellyfinDbContext>
 13    {
 14        public JellyfinDbContext CreateDbContext(string[] args)
 15        {
 116            var optionsBuilder = new DbContextOptionsBuilder<JellyfinDbContext>();
 117            optionsBuilder.UseSqlite("Data Source=jellyfin.db", f => f.MigrationsAssembly(GetType().Assembly));
 18
 119            return new JellyfinDbContext(
 120                optionsBuilder.Options,
 121                NullLogger<JellyfinDbContext>.Instance,
 122                new SqliteDatabaseProvider(null!, NullLogger<SqliteDatabaseProvider>.Instance));
 23        }
 24    }
 25}