1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Add Sqlite as EF DB provider (#2487)

* Add Sqlite as EF DB provider

Note: In-memory sqlite does not work across projects, since the migrator
only runs on the Admin project

Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>

* Include example sqlite connection string

* Add migrator assembly to sqlite connection

* Update initial migration to current schema state

* dotnet format 🤖

* Update package locks

* Respect name set in BW_SSL_KEY for cert generation (#2490)

(cherry picked from commit 2469e10110)

* [PS-2016] Add ability to change UID/GID for Bitwarden unified (#2495)

(cherry picked from commit c6fbe8cc44)

* Add SqliteMigrations project to unified Dockerfile

Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
Co-authored-by: accolon <mail@accolon.net>
Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
This commit is contained in:
Matt Gibson
2022-12-14 09:28:51 -05:00
committed by GitHub
parent 16ad5db418
commit 7cbc4a8970
42 changed files with 10073 additions and 1433 deletions

View File

@ -10,6 +10,7 @@
<ProjectReference Include="..\SharedWeb\SharedWeb.csproj" />
<ProjectReference Include="..\..\util\Migrator\Migrator.csproj" />
<ProjectReference Include="..\Core\Core.csproj" />
<ProjectReference Include="..\..\util\SqliteMigrations\SqliteMigrations.csproj" />
</ItemGroup>
<Choose>

View File

@ -54,6 +54,9 @@ public class Startup
case Core.Enums.SupportedDatabaseProviders.Postgres:
services.AddSingleton<IDbMigrator, PostgresMigrations.PostgresDbMigrator>();
break;
case Core.Enums.SupportedDatabaseProviders.Sqlite:
services.AddSingleton<IDbMigrator, SqliteMigrations.SqliteDbMigrator>();
break;
default:
break;
}

View File

@ -731,6 +731,14 @@
"resolved": "4.0.0",
"contentHash": "wtLlRwQX7YoBUYm25xBjJ3UsuLgycme1xXqDn8t3S5kPCWiZrx8uOkyZHLKzH4kkCiQ9m2/J5JeCKNRbZNn3Qg=="
},
"Microsoft.Data.Sqlite.Core": {
"type": "Transitive",
"resolved": "6.0.4",
"contentHash": "3TZX7R2aX1TX5m4A5Kj+SY633NJDeHDP6JiDRCwUnJGKC3IrHgnO8p+oT2hRZpN168qx4Ixe4T9C+xZdZc26gw==",
"dependencies": {
"SQLitePCLRaw.core": "2.0.6"
}
},
"Microsoft.DiaSymReader": {
"type": "Transitive",
"resolved": "1.3.0",
@ -790,6 +798,25 @@
"Microsoft.Extensions.Configuration.Abstractions": "6.0.0"
}
},
"Microsoft.EntityFrameworkCore.Sqlite": {
"type": "Transitive",
"resolved": "6.0.4",
"contentHash": "nn3UB4PxqnECcEWJPcIKrcuGnevf/lPd/LqFgLVYgqYe8teVqpI/yCKSDOPkEkrAbjWAB0Sgx+q59XpT5YphKQ==",
"dependencies": {
"Microsoft.EntityFrameworkCore.Sqlite.Core": "6.0.4",
"SQLitePCLRaw.bundle_e_sqlite3": "2.0.6"
}
},
"Microsoft.EntityFrameworkCore.Sqlite.Core": {
"type": "Transitive",
"resolved": "6.0.4",
"contentHash": "yO6XZA8FQkBLiTtClesWClL3Z1QEqT9vRoDDf/IOPkmsjzjedg2GzkNCauRGk/XnsZZ1qcz55TuJBO+1jNDIaA==",
"dependencies": {
"Microsoft.Data.Sqlite.Core": "6.0.4",
"Microsoft.EntityFrameworkCore.Relational": "6.0.4",
"Microsoft.Extensions.DependencyModel": "6.0.0"
}
},
"Microsoft.Extensions.Caching.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
@ -905,10 +932,14 @@
},
"Microsoft.Extensions.DependencyModel": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "Iaectmzg9Dc4ZbKX/FurrRjgO/I8rTumL5UU+Uube6vZuGetcnXoIgTA94RthFWePhdMVm8MMhVFJZdbzMsdyQ==",
"resolved": "6.0.0",
"contentHash": "TD5QHg98m3+QhgEV1YVoNMl5KtBw/4rjfxLHO0e/YV9bPUBDKntApP4xdrVtGgCeQZHVfC2EXIGsdpRNrr87Pg==",
"dependencies": {
"System.Text.Json": "4.6.0"
"System.Buffers": "4.5.1",
"System.Memory": "4.5.4",
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0",
"System.Text.Json": "6.0.0"
}
},
"Microsoft.Extensions.FileProviders.Abstractions": {
@ -1739,6 +1770,37 @@
"Serilog.Sinks.PeriodicBatching": "2.3.0"
}
},
"SQLitePCLRaw.bundle_e_sqlite3": {
"type": "Transitive",
"resolved": "2.0.6",
"contentHash": "zssYqiaucyGArZfg74rJuzK0ewgZiidsRVrZTmP7JLNvK806gXg6PGA46XzoJGpNPPA5uRcumwvVp6YTYxtQ5w==",
"dependencies": {
"SQLitePCLRaw.core": "2.0.6",
"SQLitePCLRaw.lib.e_sqlite3": "2.0.6",
"SQLitePCLRaw.provider.e_sqlite3": "2.0.6"
}
},
"SQLitePCLRaw.core": {
"type": "Transitive",
"resolved": "2.0.6",
"contentHash": "Vh8n0dTvwXkCGur2WqQTITvk4BUO8i8h9ucSx3wwuaej3s2S6ZC0R7vqCTf9TfS/I4QkXO6g3W2YQIRFkOcijA==",
"dependencies": {
"System.Memory": "4.5.3"
}
},
"SQLitePCLRaw.lib.e_sqlite3": {
"type": "Transitive",
"resolved": "2.0.6",
"contentHash": "xlstskMKalKQl0H2uLNe0viBM6fvAGLWqKZUQ3twX5y1tSOZKe0+EbXopQKYdbjJytNGI6y5WSKjpI+kVr2Ckg=="
},
"SQLitePCLRaw.provider.e_sqlite3": {
"type": "Transitive",
"resolved": "2.0.6",
"contentHash": "peXLJbhU+0clVBIPirihM1NoTBqw8ouBpcUsVMlcZ4k6fcL2hwgkctVB2Nt5VsbnOJcPspQL5xQK7QvLpxkMgg==",
"dependencies": {
"SQLitePCLRaw.core": "2.0.6"
}
},
"StackExchange.Redis": {
"type": "Transitive",
"resolved": "2.5.43",
@ -3268,6 +3330,7 @@
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2022.10.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[6.0.4, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.4, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[6.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "[6.0.1, )",
"linq2db.EntityFrameworkCore": "[6.7.1, )"
@ -3302,6 +3365,13 @@
"Infrastructure.Dapper": "[2022.10.0, )",
"Infrastructure.EntityFramework": "[2022.10.0, )"
}
},
"sqlitemigrations": {
"type": "Project",
"dependencies": {
"Core": "[2022.10.0, )",
"Infrastructure.EntityFramework": "[2022.10.0, )"
}
}
}
}