using AfRApay.Web.Backend.Tables; using LinqToDB; using LinqToDB.Configuration; using LinqToDB.Data; namespace AfRApay.Web.Backend; public class Database { private class ConnectionStringSettings : IConnectionStringSettings { public string ConnectionString { get; set; } = null!; public string Name { get; set; } = null!; public string ProviderName { get; set; } = null!; public bool IsGlobal => false; } public class Settings : ILinqToDBSettings { public IEnumerable DataProviders => Enumerable.Empty(); public string DefaultConfiguration => "SQLite"; public string DefaultDataProvider => "SQLite"; public IEnumerable ConnectionStrings { get { yield return new ConnectionStringSettings { Name = "db", ProviderName = "SQLite", ConnectionString = @"Data Source=database.db;" }; } } } public class DbConn : DataConnection { public DbConn() : base("db") { } public ITable DbInfo => this.GetTable(); public ITable Users => this.GetTable(); public ITable Cards => this.GetTable(); public ITable Config => this.GetTable(); } }