Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.1 KiB

using LiteDB.Async;
using StabilityMatrix.Core.Models.Api;
using StabilityMatrix.Core.Models.Database;
1 year ago
namespace StabilityMatrix.Core.Database;
1 year ago
public interface ILiteDbContext : IDisposable
1 year ago
{
LiteDatabaseAsync Database { get; }
1 year ago
ILiteCollectionAsync<CivitModel> CivitModels { get; }
ILiteCollectionAsync<CivitModelVersion> CivitModelVersions { get; }
ILiteCollectionAsync<CivitModelQueryCacheEntry> CivitModelQueryCache { get; }
ILiteCollectionAsync<LocalModelFile> LocalModelFiles { get; }
ILiteCollectionAsync<InferenceProjectEntry> InferenceProjects { get; }
ILiteCollectionAsync<LocalImageFile> LocalImageFiles { get; }
Task<(CivitModel?, CivitModelVersion?)> FindCivitModelFromFileHashAsync(string hashBlake3);
1 year ago
Task<bool> UpsertCivitModelAsync(CivitModel civitModel);
Task<bool> UpsertCivitModelAsync(IEnumerable<CivitModel> civitModels);
Task<bool> UpsertCivitModelQueryCacheEntryAsync(CivitModelQueryCacheEntry entry);
Task<GithubCacheEntry?> GetGithubCacheEntry(string cacheKey);
Task<bool> UpsertGithubCacheEntry(GithubCacheEntry cacheEntry);
1 year ago
}