DataProvider.cs 538 B

123456789101112131415161718192021
  1. using System.Collections.Generic;
  2. using Vitorm.Sql;
  3. using Vitorm.Sql.DataProvider;
  4. namespace Vitorm.ClickHouse
  5. {
  6. public class DataProvider : SqlDataProvider
  7. {
  8. protected Dictionary<string, object> config;
  9. protected DbConfig dbConfig;
  10. public override void Init(Dictionary<string, object> config)
  11. {
  12. this.config = config;
  13. this.dbConfig = new(config);
  14. }
  15. public override SqlDbContext CreateDbContext() => new SqlDbContext().UseClickHouse(dbConfig);
  16. }
  17. }