1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2025-07-05 03:38:52 +02:00

Compare commits

..

3 Commits

Author SHA1 Message Date
08dec7deb3
Release v47.1 2025-06-17 08:03:49 +02:00
b148a5634f
Update SQLite provider to 9.0.6 (SQLite version 3.46.1) 2025-06-17 07:54:40 +02:00
57e2f9ed80
Add SQLite library version to the Debug tab 2025-06-17 07:54:40 +02:00
8 changed files with 30 additions and 3 deletions

View File

@ -45,5 +45,8 @@
</StackPanel>
</WrapPanel>
</Expander>
<Expander Header="About" IsExpanded="True">
<TextBlock Text="{Binding SqliteVersion, StringFormat=Sqlite Version: {0}}" />
</Expander>
</StackPanel>
</UserControl>

View File

@ -9,14 +9,18 @@ using DHT.Desktop.Dialogs.Progress;
using DHT.Server;
using DHT.Server.Data;
using DHT.Server.Service;
using PropertyChanged.SourceGenerator;
namespace DHT.Desktop.Main.Pages;
sealed class DebugPageModel {
sealed partial class DebugPageModel {
public string GenerateChannels { get; set; } = "0";
public string GenerateUsers { get; set; } = "0";
public string GenerateMessages { get; set; } = "0";
[Notify(Setter.Private)]
private string? sqliteVersion = string.Empty;
private readonly Window window;
private readonly State state;
@ -28,6 +32,10 @@ sealed class DebugPageModel {
this.state = state;
}
public async Task Initialize() {
SqliteVersion = await state.Db.GetVersion() ?? "<unknown>";
}
public async void OnClickAddRandomDataToDatabase() {
if (!int.TryParse(GenerateChannels, out int channels) || channels < 1) {
await Dialog.ShowOk(window, "Generate Random Data", "Amount of channels must be at least 1!");
@ -169,6 +177,8 @@ sealed class DebugPageModel {
public string GenerateUsers { get; set; } = "0";
public string GenerateMessages { get; set; } = "0";
public string SqliteVersion => string.Empty;
public void OnClickAddRandomDataToDatabase() {}
}
#endif

View File

@ -70,6 +70,10 @@ sealed class MainContentScreenModel : IAsyncDisposable {
public async Task Initialize() {
await DownloadsPageModel.Initialize();
#if DEBUG
await DebugPageModel.Initialize();
#endif
}
public async ValueTask DisposeAsync() {

View File

@ -19,6 +19,10 @@ sealed class DummyDatabaseFile : IDatabaseFile {
private DummyDatabaseFile() {}
public Task<string?> GetVersion() {
return Task.FromResult<string?>(null);
}
public Task Vacuum() {
return Task.CompletedTask;
}

View File

@ -14,5 +14,6 @@ public interface IDatabaseFile : IAsyncDisposable {
IMessageRepository Messages { get; }
IDownloadRepository Downloads { get; }
Task<string?> GetVersion();
Task Vacuum();
}

View File

@ -80,6 +80,11 @@ public sealed class SqliteDatabaseFile : IDatabaseFile {
await pool.DisposeAsync();
}
public async Task<string?> GetVersion() {
await using var conn = await pool.Take();
return await conn.ExecuteReaderAsync("SELECT sqlite_version()", static reader => reader?.GetString(0));
}
public async Task Vacuum() {
await using var conn = await pool.Take();

View File

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.6" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup>

View File

@ -8,5 +8,5 @@ using DHT.Utils;
namespace DHT.Utils;
static class Version {
public const string Tag = "47.0.0.0";
public const string Tag = "47.1.0.0";
}