| 123456789101112131415161718192021222324 |
- namespace Admin.NET.Plugin.AiDOP.DataPlatform.UnifiedIngress;
- internal static class MdpIngestDatabase
- {
- internal static SqlSugarClient Open(ISqlSugarClient host)
- {
- var connections = host.AsTenant();
- var config = connections.IsAnyConnection(SqlSugarConst.MainConfigId)
- ? connections.GetConnectionScope(SqlSugarConst.MainConfigId).CurrentConnectionConfig
- : host.CurrentConnectionConfig;
- // 复用主库连接池和列映射,避免 SQL 日志展开原文和接入凭据。
- var client = new SqlSugarClient(new ConnectionConfig
- {
- DbType = config.DbType,
- ConnectionString = config.ConnectionString,
- ConfigureExternalServices = config.ConfigureExternalServices,
- InitKeyType = config.InitKeyType,
- IsAutoCloseConnection = true
- });
- client.Ado.CommandTimeOut = host.Ado.CommandTimeOut;
- return client;
- }
- }
|