public void Initialize(IDictionary <string, object> paramters) { paramters.EnsureValue(CONNECTION_STRING, out _connectionString); SqlMapper = SmartSqlMapperFactory.Create(new SmartSqlMapperFactory.CreateSmartSqlMapperOptions { Alias = "PGETLRepository", LoggerFactory = _loggerFactory, ProviderName = "PostgreSql", SqlMapPath = DEFAULT_SQLMAP_PATH, DataSource = new SmartSql.Configuration.WriteDataSource { ConnectionString = _connectionString, Name = "PGETL" } }); Initialized = true; }
public void Initialize(IDictionary<string, object> paramters) { var connectionString = $"Data Source={AppPath.Relative(DB_NAME)};Version=3;"; if (paramters.Value(CONNECTION_STRING, out string connStr)) { connectionString = connStr; } SqlMapper = SmartSqlMapperFactory.Create(new SmartSqlMapperFactory.CreateSmartSqlMapperOptions { Alias = "SQLiteETLRepository", LoggerFactory = _loggerFactory, ProviderName = "SQLite", SqlMapPath = DEFAULT_SQLMAP_PATH, DataSource = new SmartSql.Configuration.WriteDataSource { ConnectionString = connectionString, Name = "SQLiteETL" } }); Initialized = true; }
private ISmartSqlMapper GetSqlMapper(BuildContext context) { var smartSqlOptions = InitCreateSmartSqlMapperOptions(context); return(SmartSqlMapperFactory.Create(smartSqlOptions)); }