mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 Where In 表达式解析;
- 增加 FreeSqlBuilder.UseConnectionFactory 自定义数据库连接对象的创建方法;
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user