fix issue
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Billing.Store
|
||||
public static string DatabasePath => Path.Combine(PersonalFolder, dbfile);
|
||||
|
||||
#region Sqlite3
|
||||
private const string dbfile = "data.db3";
|
||||
private const string dbfile = ".master.db3";
|
||||
private static SQLiteAsyncConnection database;
|
||||
#endregion
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace Billing.Store
|
||||
try
|
||||
{
|
||||
File.Copy(file, path, true);
|
||||
File.Delete(file);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -167,7 +168,15 @@ namespace Billing.Store
|
||||
public static async Task<int> GetLogsCount()
|
||||
{
|
||||
await Instance;
|
||||
return await database.ExecuteScalarAsync<int>("SELECT COUNT(Id) FROM [Logs]");
|
||||
try
|
||||
{
|
||||
return await database.ExecuteScalarAsync<int>("SELECT COUNT(Id) FROM [Logs]");
|
||||
}
|
||||
catch (SQLiteException)
|
||||
{
|
||||
await database.CreateTableAsync<Logs>();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public static async Task<int> SaveLogItemAsync(Logs log)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user