- 增加 Where In 表达式解析;

- 增加 FreeSqlBuilder.UseConnectionFactory 自定义数据库连接对象的创建方法;
This commit is contained in:
28810
2019-12-17 01:39:53 +08:00
parent 51494c31a2
commit e1e3e4a3b2
57 changed files with 1018 additions and 492 deletions

View File

@ -21,9 +21,7 @@ namespace FreeSql.Oracle
public OracleConnectionPool(string name, string connectionString, Action availableHandler, Action unavailableHandler) : base(null)
{
var userIdMatch = Regex.Match(connectionString, @"(User\s+Id|Uid)\s*=\s*([^;]+)", RegexOptions.IgnoreCase);
if (userIdMatch.Success == false) throw new Exception(@"从 ConnectionString 中无法匹配 (User\s+Id|Uid)\s*=\s*([^;]+)");
this.UserId = userIdMatch.Groups[2].Value.Trim().ToUpper();
this.UserId = OracleConnectionPool.GetUserId(connectionString);
var policy = new OracleConnectionPoolPolicy
{
@ -37,6 +35,13 @@ namespace FreeSql.Oracle
this.unavailableHandler = unavailableHandler;
}
public static string GetUserId(string connectionString)
{
var userIdMatch = Regex.Match(connectionString, @"(User\s+Id|Uid)\s*=\s*([^;]+)", RegexOptions.IgnoreCase);
if (userIdMatch.Success == false) throw new Exception(@"从 ConnectionString 中无法匹配 (User\s+Id|Uid)\s*=\s*([^;]+)");
return userIdMatch.Groups[2].Value.Trim().ToUpper();
}
public void Return(Object<DbConnection> obj, Exception exception, bool isRecreate = false)
{
if (exception != null && exception is OracleException)