mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
This commit is contained in:
parent
7ec4279ba1
commit
a7233c1926
@ -552,7 +552,7 @@ namespace base_entity
|
|||||||
.UseNoneCommandParameter(true)
|
.UseNoneCommandParameter(true)
|
||||||
.UseNameConvert(NameConvertType.ToLower)
|
.UseNameConvert(NameConvertType.ToLower)
|
||||||
//.UseMappingPriority(MappingPriorityType.Attribute, MappingPriorityType.FluentApi, MappingPriorityType.Aop)
|
//.UseMappingPriority(MappingPriorityType.Attribute, MappingPriorityType.FluentApi, MappingPriorityType.Aop)
|
||||||
|
.UseAdoConnectionPool(true)
|
||||||
|
|
||||||
.UseConnectionString(FreeSql.DataType.Sqlite, "data source=:memory:")
|
.UseConnectionString(FreeSql.DataType.Sqlite, "data source=:memory:")
|
||||||
.UseConnectionString(DataType.Sqlite, "data source=C:\\Users\\28810\\Desktop\\github\\FreeSql\\Examples\\base_entity\\AspNetRoleClaims\\ids_api.db")
|
.UseConnectionString(DataType.Sqlite, "data source=C:\\Users\\28810\\Desktop\\github\\FreeSql\\Examples\\base_entity\\AspNetRoleClaims\\ids_api.db")
|
||||||
@ -568,9 +568,9 @@ namespace base_entity
|
|||||||
|
|
||||||
//.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3;TrustServerCertificate=true")
|
//.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3;TrustServerCertificate=true")
|
||||||
|
|
||||||
.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=192.168.164.10;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;Maximum Pool Size=2")
|
//.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=192.168.164.10;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;Maximum Pool Size=2")
|
||||||
//.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=192.168.164.10;Port=5432;Username=postgres;Password=123456;Database=toc;Pooling=true;Maximum Pool Size=2")
|
////.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=192.168.164.10;Port=5432;Username=postgres;Password=123456;Database=toc;Pooling=true;Maximum Pool Size=2")
|
||||||
.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)
|
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)
|
||||||
|
|
||||||
//.UseConnectionString(FreeSql.DataType.Oracle, "user id=user1;password=123456;data source=//127.0.0.1:1521/XE;Pooling=true;Max Pool Size=2")
|
//.UseConnectionString(FreeSql.DataType.Oracle, "user id=user1;password=123456;data source=//127.0.0.1:1521/XE;Pooling=true;Max Pool Size=2")
|
||||||
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToUpper)
|
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToUpper)
|
||||||
|
@ -1358,6 +1358,19 @@
|
|||||||
<param name="providerType">提供者的类型,一般不需要指定,如果一直提示“缺少 FreeSql 数据库实现包:FreeSql.Provider.MySql.dll,可前往 nuget 下载”的错误,说明反射获取不到类型,此时该参数可排上用场<para></para>例如:typeof(FreeSql.SqlServer.SqlServerProvider<>)</param>
|
<param name="providerType">提供者的类型,一般不需要指定,如果一直提示“缺少 FreeSql 数据库实现包:FreeSql.Provider.MySql.dll,可前往 nuget 下载”的错误,说明反射获取不到类型,此时该参数可排上用场<para></para>例如:typeof(FreeSql.SqlServer.SqlServerProvider<>)</param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:FreeSql.FreeSqlBuilder.UseAdoConnectionPool(System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
使用原始连接池(ado.net、odbc、oledb)<para></para>
|
||||||
|
默认:false<para></para>
|
||||||
|
UseConnectionString 默认使用 FreeSql 连接池,有以下特点:<para></para>
|
||||||
|
- 状态不可用,断熔机制直到后台检测恢复<para></para>
|
||||||
|
- 读写分离,从库不可用,会切换其他可用从库<para></para>
|
||||||
|
- 监测连接池使用情况,fsql.Ado.Statistics<para></para>
|
||||||
|
有部分使用者不喜欢【断熔机制】,可使用此设置
|
||||||
|
</summary>
|
||||||
|
<param name="value"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:FreeSql.FreeSqlBuilder.UseSlave(System.String[])">
|
<member name="M:FreeSql.FreeSqlBuilder.UseSlave(System.String[])">
|
||||||
<summary>
|
<summary>
|
||||||
使用从数据库,支持多个
|
使用从数据库,支持多个
|
||||||
@ -3537,177 +3550,6 @@
|
|||||||
<param name="parms"></param>
|
<param name="parms"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.IAdo.ExecuteConnectTestAsync(System.Int32,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
测试数据库是否连接正确,本方法执行如下命令:<para></para>
|
|
||||||
MySql/SqlServer/PostgreSQL/达梦/人大金仓/神通: SELECT 1<para></para>
|
|
||||||
Oracle: SELECT 1 FROM dual<para></para>
|
|
||||||
</summary>
|
|
||||||
<param name="commandTimeout">命令超时设置(秒)</param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns>true: 成功, false: 失败</returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteReaderAsync(System.Func{FreeSql.Internal.Model.FetchCallbackArgs{System.Data.Common.DbDataReader},System.Threading.Tasks.Task},System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询,若使用读写分离,查询【从库】条件cmdText.StartsWith("SELECT "),否则查询【主库】
|
|
||||||
</summary>
|
|
||||||
<param name="readerHander"></param>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteReaderAsync(System.Func{FreeSql.Internal.Model.FetchCallbackArgs{System.Data.Common.DbDataReader},System.Threading.Tasks.Task},System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询,ExecuteReaderAsync(dr => {}, "select * from user where age > @age", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<param name="readerHander"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteArrayAsync(System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询
|
|
||||||
</summary>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteArrayAsync(System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询,ExecuteArrayAsync("select * from user where age > @age", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteDataSetAsync(System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询
|
|
||||||
</summary>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteDataSetAsync(System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询,ExecuteDataSetAsync("select * from user where age > @age; select 2", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteDataTableAsync(System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询
|
|
||||||
</summary>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteDataTableAsync(System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
查询,ExecuteDataTableAsync("select * from user where age > @age", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteNonQueryAsync(System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
在【主库】执行
|
|
||||||
</summary>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteNonQueryAsync(System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
在【主库】执行,ExecuteNonQueryAsync("delete from user where age > @age", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteScalarAsync(System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
在【主库】执行
|
|
||||||
</summary>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.ExecuteScalarAsync(System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
在【主库】执行,ExecuteScalarAsync("select 1 from user where age > @age", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.QueryAsync``1(System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
执行SQL返回对象集合,QueryAsync<User>("select * from user where age > @age", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
||||||
</summary>
|
|
||||||
<typeparam name="T"></typeparam>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.QueryAsync``1(System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
执行SQL返回对象集合,QueryAsync<User>("select * from user where age > @age", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<typeparam name="T"></typeparam>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.QueryAsync``2(System.Data.CommandType,System.String,System.Data.Common.DbParameter[],System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
执行SQL返回对象集合,Query<User>("select * from user where age > @age; select * from address", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
||||||
</summary>
|
|
||||||
<typeparam name="T1"></typeparam>
|
|
||||||
<typeparam name="T2"></typeparam>
|
|
||||||
<param name="cmdType"></param>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="cmdParms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.IAdo.QueryAsync``2(System.String,System.Object,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
执行SQL返回对象集合,Query<User, Address>("select * from user where age > @age; select * from address", new { age = 25 })<para></para>
|
|
||||||
提示:parms 参数还可以传 Dictionary<string, object>
|
|
||||||
</summary>
|
|
||||||
<typeparam name="T1"></typeparam>
|
|
||||||
<typeparam name="T2"></typeparam>
|
|
||||||
<param name="cmdText"></param>
|
|
||||||
<param name="parms"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="E:FreeSql.IAop.ParseExpression">
|
<member name="E:FreeSql.IAop.ParseExpression">
|
||||||
<summary>
|
<summary>
|
||||||
可自定义解析表达式
|
可自定义解析表达式
|
||||||
@ -4698,12 +4540,6 @@
|
|||||||
<param name="timeout">超时</param>
|
<param name="timeout">超时</param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.Internal.ObjectPool.IObjectPool`1.GetAsync">
|
|
||||||
<summary>
|
|
||||||
获取资源
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.Internal.ObjectPool.IObjectPool`1.Return(FreeSql.Internal.ObjectPool.Object{`0},System.Boolean)">
|
<member name="M:FreeSql.Internal.ObjectPool.IObjectPool`1.Return(FreeSql.Internal.ObjectPool.Object{`0},System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
使用完毕后,归还资源
|
使用完毕后,归还资源
|
||||||
@ -4779,12 +4615,6 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="obj">资源对象</param>
|
<param name="obj">资源对象</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.Internal.ObjectPool.IPolicy`1.OnGetAsync(FreeSql.Internal.ObjectPool.Object{`0})">
|
|
||||||
<summary>
|
|
||||||
从对象池获取对象成功的时候触发,通过该方法统计或初始化对象
|
|
||||||
</summary>
|
|
||||||
<param name="obj">资源对象</param>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSql.Internal.ObjectPool.IPolicy`1.OnReturn(FreeSql.Internal.ObjectPool.Object{`0})">
|
<member name="M:FreeSql.Internal.ObjectPool.IPolicy`1.OnReturn(FreeSql.Internal.ObjectPool.Object{`0})">
|
||||||
<summary>
|
<summary>
|
||||||
归还对象给对象池的时候触发
|
归还对象给对象池的时候触发
|
||||||
@ -5102,142 +4932,204 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.Ignored_Check_Confirm_PublicGetSet(System.Object,System.Object)">
|
<member name="M:FreeSql.CoreStrings.Ignored_Check_Confirm_PublicGetSet(System.Object,System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
{tb2DbName}.{mp2MemberName} 被忽略,请检查 IsIgnore 设置,确认 get/set 为 public
|
{tb2DbName}.{mp2MemberName} 被忽略,请检查 IsIgnore 设<><E8AEBE>"M:FreeSql.Internal.ObjectPool.IPolicy`1.OnCheckAvailable(FreeSql.Internal.ObjectPool.Object{`0})">
|
||||||
|
<summary>
|
||||||
|
检查可用性
|
||||||
|
</summary>
|
||||||
|
<param name="obj">资源对象</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:FreeSql.Internal.ObjectPool.IPolicy`1.OnAvailable">
|
||||||
|
<summary>
|
||||||
|
事件:可用时触发
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:FreeSql.CoreStrings.Include_ParameterType_Error">
|
<member name="M:FreeSql.Internal.ObjectPool.IPolicy`1.OnUnavailable">
|
||||||
<summary>
|
<summary>
|
||||||
Include 参数类型错误
|
事件:不可用时触发
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:FreeSql.CoreStrings.Include_ParameterType_Error_Use_IncludeMany">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.Pool">
|
||||||
<summary>
|
<summary>
|
||||||
Include 参数类型错误,集合属性请使用 IncludeMany
|
所属对象池
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:FreeSql.CoreStrings.Include_ParameterType_Error_Use_MemberAccess">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.Id">
|
||||||
<summary>
|
<summary>
|
||||||
Include 参数类型错误,表达式类型应该为 MemberAccess
|
在对象池中的唯一标识
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.IncludeMany_NotValid_Navigation(System.Object,System.Object)">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.Value">
|
||||||
<summary>
|
<summary>
|
||||||
IncludeMany 类型 {tbTypeDisplayCsharp} 的属性 {collMemMemberName} 不是有效的导航属性,提示:IsIgnore = true 不会成为导航属性
|
资源对象
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.IncludeMany_ParameterError_OnlyUseOneParameter(System.Object)">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.GetTimes">
|
||||||
<summary>
|
<summary>
|
||||||
IncludeMany {navigateSelector} 参数错误,Select 只可以使用一个参数的方法,正确格式:.Select(t =>new TNavigate {{}})
|
被获取的总次数
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.IncludeMany_ParameterError_Select_ReturnConsistentType(System.Object,System.Object)">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.LastGetTime">
|
||||||
|
最后获取时的时间
|
||||||
|
</member>
|
||||||
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.LastReturnTime">
|
||||||
<summary>
|
<summary>
|
||||||
IncludeMany {navigateSelector} 参数错误,Select lambda参数返回值必须和 {collMemElementType} 类型一致
|
最后归还时的时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:FreeSql.CoreStrings.IncludeMany_ParameterType_Error_Use_MemberAccess">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.CreateTime">
|
||||||
<summary>
|
<summary>
|
||||||
IncludeMany 参数1 类型错误,表达式类型应该为 MemberAccess
|
创建时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.IncludeMany_ParameterTypeError(System.Object)">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.LastGetThreadId">
|
||||||
<summary>
|
<summary>
|
||||||
IncludeMany {navigateSelector} 参数类型错误,正确格式: a.collections.Take(1).Where(c =>c.aid == a.id).Select(a=> new TNavigate{{}})
|
最后获取时的线程id
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.InsertInto_No_Property_Selected(System.Object)">
|
<member name="P:FreeSql.Internal.ObjectPool.Object`1.LastReturnThreadId">
|
||||||
<summary>
|
<summary>
|
||||||
ISelect.InsertInto() 未选择属性: {displayCsharp}
|
最后归还时的线程id
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.InsertInto_TypeError(System.Object)">
|
<member name="M:FreeSql.Internal.ObjectPool.Object`1.ResetValue">
|
||||||
<summary>
|
<summary>
|
||||||
ISelect.InsertInto() 类型错误: {displayCsharp}
|
重置 Value 值
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.InsertOrUpdate_Must_Primary_Key(System.Object)">
|
<member name="T:FreeSql.Internal.ObjectPool.ObjectPool`1">
|
||||||
<summary>
|
<summary>
|
||||||
InsertOrUpdate 功能执行 merge into 要求实体类 {CsName} 必须有主键
|
对象池管理类
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T">对象类型</typeparam>
|
||||||
|
</member>
|
||||||
|
<member name="M:FreeSql.Internal.ObjectPool.ObjectPool`1.CheckAvailable(System.Int32)">
|
||||||
|
<summary>
|
||||||
|
后台定时检查可用性
|
||||||
|
</summary>
|
||||||
|
<param name="interval"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:FreeSql.Internal.ObjectPool.ObjectPool`1.#ctor(System.Int32,System.Func{`0},System.Action{FreeSql.Internal.ObjectPool.Object{`0}})">
|
||||||
|
<summary>
|
||||||
|
创建对象池
|
||||||
|
</summary>
|
||||||
|
<param name="poolsize">池大小</param>
|
||||||
|
<param name="createObject">池内对象的创建委托</param>
|
||||||
|
<param name="onGetObject">获取池内对象成功后,进行使用前操作</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:FreeSql.Internal.ObjectPool.ObjectPool`1.#ctor(FreeSql.Internal.ObjectPool.IPolicy{`0})">
|
||||||
|
<summary>
|
||||||
|
创建对象池
|
||||||
|
</summary>
|
||||||
|
<param name="policy">策略</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:FreeSql.Internal.ObjectPool.ObjectPool`1.GetFree(System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
获取可用资源,或创建资源
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="T:FreeSql.CoreStrings">
|
||||||
|
<summary>
|
||||||
|
<para>
|
||||||
|
String resources used in FreeSql exceptions, etc.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
These strings are exposed publicly for use by database providers and extensions.
|
||||||
|
It is unusual for application code to need these strings.
|
||||||
|
</para>
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.InsertOrUpdate_NotSuport_Generic_UseEntity(System.Object)">
|
<member name="P:FreeSql.CoreStrings.Culture">
|
||||||
<summary>
|
<summary>
|
||||||
InsertOrUpdate<>的泛型参数 不支持 {typeofT1},请传递您的实体类
|
重写当前线程的 CurrentUICulture 属性,对
|
||||||
|
使用此强类型资源类的所有资源查找执行重写。
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:FreeSql.CoreStrings.Install_FreeSql_Extensions_LazyLoading">
|
<member name="M:FreeSql.CoreStrings.AsTable_PropertyName_FormatError(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
【延时加载】功能需要安装 FreeSql.Extensions.LazyLoading.dll,可前往 nuget 下载
|
[Table(AsTable = "{asTable}")] 特性值格式错误
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.LazyLoading_CompilationError(System.Object,System.Object,System.Object)">
|
<member name="M:FreeSql.CoreStrings.AsTable_PropertyName_NotDateTime(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
【延时加载】{trytbTypeName} 编译错误:{exMessage}\r\n\r\n{cscode}
|
[Table(AsTable = xx)] 设置的属性名 {atmGroupsValue} 不是 DateTime 类型
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.LazyLoading_EntityMustDeclarePublic(System.Object)">
|
<member name="M:FreeSql.CoreStrings.Available_Failed_Get_Resource(System.Object,System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
【延时加载】实体类型 {trytbTypeName} 必须声明为 public
|
{name}: Failed to get resource {statistics}
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:FreeSql.CoreStrings.ManyToMany_AsSelect_NotSupport_Sum_Avg_etc">
|
<member name="M:FreeSql.CoreStrings.Available_Thrown_Exception(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
ManyToMany 导航属性 .AsSelect() 暂时不可用于 Sum/Avg/Max/Min/First/ToOne/ToList 方法
|
{name}: An exception needs to be thrown
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.ManyToMany_NotFound_CorrespondingField(System.Object,System.Object,System.Object,System.Object,System.Object)">
|
<member name="M:FreeSql.CoreStrings.Bad_Expression_Format(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 在 {tbmidCsName} 中没有找到对应的字段,如:{midTypePropsTrytbName}{findtrytbPkCsName}、{midTypePropsTrytbName}_{findtrytbPkCsName}
|
错误的表达式格式 {column}
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.ManyToMany_ParsingError_EntityMissing_PrimaryKey(System.Object,System.Object,System.Object)">
|
<member name="P:FreeSql.CoreStrings.Before_Chunk_Cannot_Use_Select">
|
||||||
<summary>
|
<summary>
|
||||||
【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,实体类型 {tbrefTypeName} 缺少主键标识,[Column(IsPrimary = true)]
|
Chunk 功能之前不可使用 Select
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.ManyToMany_ParsingError_EntityMustHas_NavigateCollection(System.Object,System.Object,System.Object)">
|
<member name="P:FreeSql.CoreStrings.Begin_Transaction_Then_ForUpdate">
|
||||||
<summary>
|
<summary>
|
||||||
【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,实体类型 {tbrefTypeName} 必须存在对应的 [Navigate(ManyToMany = x)] 集合属性
|
安全起见,请务必在事务开启之后,再使用 ForUpdate
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.ManyToMany_ParsingError_InconsistentType(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)">
|
<member name="P:FreeSql.CoreStrings.Cannot_Be_NULL">
|
||||||
<summary>
|
<summary>
|
||||||
【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,{tbmidCsName}.{trycolCsName} 和 {trytbCsName}.{trytbPrimarysCsName} 类型不一致
|
不能为 null
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.ManyToMany_ParsingError_IntermediateClass_ErrorMessage(System.Object,System.Object,System.Object,System.Object,System.Object)">
|
<member name="M:FreeSql.CoreStrings.Cannot_Be_NULL_Name(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,中间类 {tbmidCsName}.{midTypePropsTrytbName} 错误:{exMessage}
|
{name} 不能为 null
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne(System.Object,System.Object,System.Object,System.Object)">
|
<member name="M:FreeSql.CoreStrings.Cannot_Match_Property(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,中间类 {tbmidCsName}.{midTypePropsTrytbName} 导航属性不是【ManyToOne】或【OneToOne】
|
无法匹配 {property}
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.Mapping_Exception_HasNo_SamePropertyName(System.Object)">
|
<member name="M:FreeSql.CoreStrings.Cannot_Resolve_ExpressionTree(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
映射异常:{name} 没有一个属性名相同
|
{property} 无法解析为表达式树
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:FreeSql.CoreStrings.MasterPool_IsNull_UseTransaction">
|
<member name="P:FreeSql.CoreStrings.Check_UseConnectionString">
|
||||||
<summary>
|
<summary>
|
||||||
Ado.MasterPool 值为 null,该操作无法自启用事务,请显式传递【事务对象】解决
|
参数 masterConnectionString 不可为空,请检查 UseConnectionString
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.Missing_FreeSqlProvider_Package(System.Object)">
|
<member name="P:FreeSql.CoreStrings.Commit">
|
||||||
<summary>
|
<summary>
|
||||||
缺少 FreeSql 数据库实现包:FreeSql.Provider.{Provider}.dll,可前往 nuget 下载
|
提交
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.Missing_FreeSqlProvider_Package_Reason(System.Object,System.Object)">
|
<member name="P:FreeSql.CoreStrings.Connection_Failed_Switch_Servers">
|
||||||
<summary>
|
<summary>
|
||||||
缺少 FreeSql 数据库实现包:{dll},可前往 nuget 下载;如果存在 {dll} 依然报错(原因是环境问题导致反射不到类型),请在 UseConnectionString/UseConnectionFactory 第三个参数手工传入 typeof({providerType})
|
连接失败,准备切换其他可用服务器
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.Navigation_Bind_Number_Different(System.Object,System.Object,System.Object,System.Object)">
|
<member name="M:FreeSql.CoreStrings.Custom_Expression_ParsingError(System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
导航属性 {trytbTypeName}.{pnvName} 特性 [Navigate] Bind 数目({bindColumnsCount}) 与 外部主键数目({tbrefPrimarysLength}) 不相同
|
自定义表达式解析错误:类型 {exp3MethodDeclaringType} 需要定义 static ThreadLocal<ExpressionCallContext> 字段、字段、字段(重要三次提醒)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:FreeSql.CoreStrings.Custom_Reflection_IsNotNull">
|
||||||
|
<summary>
|
||||||
|
Custom { 反射信息 }不能为空,格式:{ 静态方法名 }{ 空格 }{ 反射信息 }
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:FreeSql.CoreStrings.Custom_StaticMethodName_IsNotNull">
|
||||||
|
<summary>
|
||||||
|
Custom { 静态方法名 }不能为空,格式:{ 静态方法名 }{ 空格 }{ 反射信息 }
|
||||||
|
<20>目({tbrefPrimarysLength}) 不相同
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSql.CoreStrings.Navigation_Missing_AsSelect(System.Object,System.Object)">
|
<member name="M:FreeSql.CoreStrings.Navigation_Missing_AsSelect(System.Object,System.Object)">
|
||||||
@ -6226,7 +6118,191 @@
|
|||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
</doc>
|
</doc>
|
||||||
`0})">
|
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.And``2(System.Linq.Expressions.Expression{System.Func{``0,``1,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 and 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``2(System.Linq.Expressions.Expression{System.Func{``0,``1,System.Boolean}},System.Linq.Expressions.Expression{System.Func{``0,``1,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``2(System.Linq.Expressions.Expression{System.Func{``0,``1,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Not``2(System.Linq.Expressions.Expression{System.Func{``0,``1,System.Boolean}},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
将 lambda 表达式取反
|
||||||
|
</summary>
|
||||||
|
<param name="exp"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.And``3(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}},System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 and 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.And``3(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 and 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``3(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}},System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``3(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Not``3(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,System.Boolean}},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
将 lambda 表达式取反
|
||||||
|
</summary>
|
||||||
|
<param name="exp"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.And``4(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}},System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 and 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.And``4(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 and 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``4(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}},System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``4(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Not``4(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,System.Boolean}},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
将 lambda 表达式取反
|
||||||
|
</summary>
|
||||||
|
<param name="exp"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.And``5(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}},System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 and 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.And``5(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 and 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``5(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}},System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Or``5(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}},System.Boolean,System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
使用 or 拼接两个 lambda 表达式
|
||||||
|
</summary>
|
||||||
|
<param name="exp1"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<param name="exp2"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:System.Linq.Expressions.LambadaExpressionExtensions.Not``5(System.Linq.Expressions.Expression{System.Func{``0,``1,``2,``3,``4,System.Boolean}},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
将 lambda 表达式取反
|
||||||
|
</summary>
|
||||||
|
<param name="exp"></param>
|
||||||
|
<param name="condition">true 时生效</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:FreeUtil.NewMongodbId">
|
||||||
|
<summary>
|
||||||
|
生成类似Mongodb的ObjectId有序、不重复Guid
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IFreeSql.Insert``1">
|
||||||
|
<summary>
|
||||||
|
插入数据
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T1"></typeparam>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IFreeSql.Insert``1(``0)">
|
||||||
|
<summary>
|
||||||
|
插入数据,传入实体
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T1"></typeparam>
|
||||||
|
<param name="source"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IFreeSql.Insert``1(``0[])">
|
||||||
|
<summary>
|
||||||
|
插入数据,传入实体数组
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T1"></typeparam>
|
||||||
|
<param name="source"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IFreeSql.Insert``1(System.Collections.Generic.List{``0})">
|
||||||
|
<summary>
|
||||||
|
插入数据,传入实体集合
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T1"></typeparam>
|
||||||
|
<param name="source"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IFreeSql.Insert``1(System.Collections.Generic.IEnumerable{``0})">
|
||||||
<summary>
|
<summary>
|
||||||
插入数据,传入实体集合
|
插入数据,传入实体集合
|
||||||
</summary>
|
</summary>
|
||||||
|
@ -24,6 +24,7 @@ namespace FreeSql
|
|||||||
bool _isLazyLoading = false;
|
bool _isLazyLoading = false;
|
||||||
bool _isExitAutoDisposePool = true;
|
bool _isExitAutoDisposePool = true;
|
||||||
bool _isQuoteSqlName = true;
|
bool _isQuoteSqlName = true;
|
||||||
|
bool _isAdoConnectionPool = false;
|
||||||
MappingPriorityType[] _mappingPriorityTypes;
|
MappingPriorityType[] _mappingPriorityTypes;
|
||||||
NameConvertType _nameConvertType = NameConvertType.None;
|
NameConvertType _nameConvertType = NameConvertType.None;
|
||||||
Action<DbCommand> _aopCommandExecuting = null;
|
Action<DbCommand> _aopCommandExecuting = null;
|
||||||
@ -46,6 +47,22 @@ namespace FreeSql
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 使用原始连接池(ado.net、odbc、oledb)<para></para>
|
||||||
|
/// 默认:false<para></para>
|
||||||
|
/// UseConnectionString 默认使用 FreeSql 连接池,有以下特点:<para></para>
|
||||||
|
/// - 状态不可用,断熔机制直到后台检测恢复<para></para>
|
||||||
|
/// - 读写分离,从库不可用,会切换其他可用从库<para></para>
|
||||||
|
/// - 监测连接池使用情况,fsql.Ado.Statistics<para></para>
|
||||||
|
/// 有部分使用者不喜欢【断熔机制】,可使用此设置
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public FreeSqlBuilder UseAdoConnectionPool(bool value)
|
||||||
|
{
|
||||||
|
_isAdoConnectionPool = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 使用从数据库,支持多个
|
/// 使用从数据库,支持多个
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="slaveConnectionString">从数据库连接串</param>
|
/// <param name="slaveConnectionString">从数据库连接串</param>
|
||||||
@ -353,7 +370,12 @@ namespace FreeSql
|
|||||||
default: throw new Exception(CoreStrings.NotSpecified_UseConnectionString_UseConnectionFactory);
|
default: throw new Exception(CoreStrings.NotSpecified_UseConnectionString_UseConnectionFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = Activator.CreateInstance(type, new object[] { _masterConnectionString, _slaveConnectionString, _connectionFactory }) as IFreeSql<TMark>;
|
ret = Activator.CreateInstance(type, new object[]
|
||||||
|
{
|
||||||
|
_isAdoConnectionPool ? $"AdoConnectionPool,{_masterConnectionString}" : _masterConnectionString,
|
||||||
|
_slaveConnectionString,
|
||||||
|
_connectionFactory
|
||||||
|
}) as IFreeSql<TMark>;
|
||||||
if (ret != null)
|
if (ret != null)
|
||||||
{
|
{
|
||||||
ret.CodeFirst.IsAutoSyncStructure = _isAutoSyncStructure;
|
ret.CodeFirst.IsAutoSyncStructure = _isAutoSyncStructure;
|
||||||
|
@ -37,6 +37,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
|
|
||||||
public AdoProvider(DataType dataType, string connectionString, string[] slaveConnectionStrings)
|
public AdoProvider(DataType dataType, string connectionString, string[] slaveConnectionStrings)
|
||||||
{
|
{
|
||||||
|
if (connectionString?.StartsWith("AdoConnectionPool,") == true) connectionString = connectionString.Substring("AdoConnectionPool,".Length);
|
||||||
this.DataType = dataType;
|
this.DataType = dataType;
|
||||||
this.ConnectionString = connectionString;
|
this.ConnectionString = connectionString;
|
||||||
this.SlaveConnectionStrings = slaveConnectionStrings;
|
this.SlaveConnectionStrings = slaveConnectionStrings;
|
||||||
|
@ -44,7 +44,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
|
|
||||||
_dataType = dataType;
|
_dataType = dataType;
|
||||||
_connectionFactory = connectionFactory;
|
_connectionFactory = connectionFactory;
|
||||||
Policy = new DbConnectionPoolPolicy(this);
|
Policy = new DbConnectionPoolPolicy(dataType.ToString(), connectionFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPolicy<DbConnection> Policy { get; }
|
public IPolicy<DbConnection> Policy { get; }
|
||||||
@ -94,15 +94,74 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class DbConnectionPoolPolicy : IPolicy<DbConnection>
|
public class DbConnectionStringPool : IObjectPool<DbConnection>
|
||||||
{
|
{
|
||||||
DbConnectionPool Pool;
|
internal DataType _dataType;
|
||||||
public DbConnectionPoolPolicy(DbConnectionPool pool)
|
internal Func<DbConnection> _connectionFactory;
|
||||||
|
int _id;
|
||||||
|
public DbConnectionStringPool(DataType dataType, string name, Func<DbConnection> connectionFactory)
|
||||||
{
|
{
|
||||||
this.Pool = pool;
|
_dataType = dataType;
|
||||||
|
_connectionFactory = connectionFactory;
|
||||||
|
Policy = new DbConnectionPoolPolicy(string.IsNullOrWhiteSpace(name) ? dataType.ToString() : name, connectionFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name { get; set; } = typeof(DbConnectionPoolPolicy).GetType().FullName;
|
public IPolicy<DbConnection> Policy { get; }
|
||||||
|
|
||||||
|
public bool IsAvailable => true;
|
||||||
|
public Exception UnavailableException => null;
|
||||||
|
public DateTime? UnavailableTime => null;
|
||||||
|
public string Statistics => "throw new NotImplementedException()";
|
||||||
|
public string StatisticsFullily => "throw new NotImplementedException()";
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object<DbConnection> Get(TimeSpan? timeout = null)
|
||||||
|
{
|
||||||
|
var conn = _connectionFactory();
|
||||||
|
if (conn.State != ConnectionState.Open)
|
||||||
|
conn.Open();
|
||||||
|
return Object<DbConnection>.InitWith(this, Interlocked.Increment(ref _id), conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if net40
|
||||||
|
#else
|
||||||
|
async public Task<Object<DbConnection>> GetAsync()
|
||||||
|
{
|
||||||
|
var conn = _connectionFactory();
|
||||||
|
if (conn.State != ConnectionState.Open)
|
||||||
|
await conn.OpenAsync();
|
||||||
|
return Object<DbConnection>.InitWith(this, Interlocked.Increment(ref _id), conn);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public void Return(Object<DbConnection> obj, bool isReset = false)
|
||||||
|
{
|
||||||
|
if (obj == null || obj.Value == null) return;
|
||||||
|
if (obj.Value.State != ConnectionState.Closed)
|
||||||
|
obj.Value.Close();
|
||||||
|
if (_dataType == DataType.Sqlite)
|
||||||
|
obj.Value.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SetUnavailable(Exception exception, DateTime lastGetTime)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DbConnectionPoolPolicy : IPolicy<DbConnection>
|
||||||
|
{
|
||||||
|
Func<DbConnection> _connectionFactory;
|
||||||
|
public DbConnectionPoolPolicy(string name, Func<DbConnection> connectionFactory)
|
||||||
|
{
|
||||||
|
_connectionFactory = connectionFactory;
|
||||||
|
this.Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
public int PoolSize { get; set; } = 1000;
|
public int PoolSize { get; set; } = 1000;
|
||||||
public TimeSpan SyncGetTimeout { get; set; } = TimeSpan.FromSeconds(10);
|
public TimeSpan SyncGetTimeout { get; set; } = TimeSpan.FromSeconds(10);
|
||||||
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromSeconds(20);
|
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromSeconds(20);
|
||||||
@ -114,7 +173,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
|
|
||||||
public DbConnection OnCreate()
|
public DbConnection OnCreate()
|
||||||
{
|
{
|
||||||
var conn = Pool._connectionFactory();
|
var conn = _connectionFactory();
|
||||||
if (conn.State != ConnectionState.Open)
|
if (conn.State != ConnectionState.Open)
|
||||||
conn.Open();
|
conn.Open();
|
||||||
return conn;
|
return conn;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
using FreeSql.Internal;
|
using ClickHouse.Client.ADO;
|
||||||
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Text;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using ClickHouse.Client.ADO;
|
|
||||||
|
|
||||||
namespace FreeSql.ClickHouse
|
namespace FreeSql.ClickHouse
|
||||||
{
|
{
|
||||||
@ -24,16 +25,21 @@ namespace FreeSql.ClickHouse
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new ClickHouseConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new ClickHouseConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new ClickHouseConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new ClickHouseConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new ClickHouseConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new ClickHouseConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
using Dm;
|
using Dm;
|
||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace FreeSql.Dameng
|
namespace FreeSql.Dameng
|
||||||
@ -22,16 +24,21 @@ namespace FreeSql.Dameng
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new DamengConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new DmConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new DamengConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new DmConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new DamengConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new DamengConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
using FirebirdSql.Data.FirebirdClient;
|
using FirebirdSql.Data.FirebirdClient;
|
||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Text;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace FreeSql.Firebird
|
namespace FreeSql.Firebird
|
||||||
@ -25,16 +26,21 @@ namespace FreeSql.Firebird
|
|||||||
_CreateCommandConnection = pool.TestConnection;
|
_CreateCommandConnection = pool.TestConnection;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new FirebirdConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new FbConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new FirebirdConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new FbConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new FirebirdConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new FirebirdConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsFirebird2_5 => ServerVersion.Contains("Firebird 2.5");
|
public bool IsFirebird2_5 => ServerVersion.Contains("Firebird 2.5");
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
using System.Text;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace FreeSql.GBase
|
namespace FreeSql.GBase
|
||||||
@ -25,16 +26,21 @@ namespace FreeSql.GBase
|
|||||||
_CreateCommandConnection = pool.TestConnection;
|
_CreateCommandConnection = pool.TestConnection;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new GBaseConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new GBaseConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new GBaseConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new GBaseConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using Kdbndp;
|
using Kdbndp;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Text;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace FreeSql.KingbaseES
|
namespace FreeSql.KingbaseES
|
||||||
@ -24,16 +24,21 @@ namespace FreeSql.KingbaseES
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new KingbaseESConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new KdbndpConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new KingbaseESConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new KdbndpConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new KingbaseESConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new KingbaseESConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
@ -6,7 +7,6 @@ using System.Collections;
|
|||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.OleDb;
|
using System.Data.OleDb;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace FreeSql.MsAccess
|
namespace FreeSql.MsAccess
|
||||||
@ -24,16 +24,21 @@ namespace FreeSql.MsAccess
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new MsAccessConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OleDbConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new MsAccessConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OleDbConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new MsAccessConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new MsAccessConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
|
@ -4,8 +4,9 @@ using FreeSql.Internal.ObjectPool;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Linq;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
#if MySqlConnector
|
#if MySqlConnector
|
||||||
using MySqlConnector;
|
using MySqlConnector;
|
||||||
#else
|
#else
|
||||||
@ -28,16 +29,21 @@ namespace FreeSql.MySql
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new MySqlConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new MySqlConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new MySqlConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new MySqlConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new MySqlConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new MySqlConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@ -23,16 +25,21 @@ namespace FreeSql.Odbc.Dameng
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OdbcDamengConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OdbcDamengConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OdbcDamengConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OdbcDamengConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
|
using FreeSql.Odbc.Dameng;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@ -23,16 +26,21 @@ namespace FreeSql.Odbc.Default
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OdbcConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OdbcConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OdbcConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OdbcConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
OdbcAdapter Adapter => (_util == null ? FreeSqlOdbcGlobalExtensions.DefaultOdbcAdapter : _util._orm.GetOdbcAdapter());
|
OdbcAdapter Adapter => (_util == null ? FreeSqlOdbcGlobalExtensions.DefaultOdbcAdapter : _util._orm.GetOdbcAdapter());
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
|
using FreeSql.Odbc.Dameng;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@ -24,16 +27,21 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OdbcKingbaseESConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OdbcKingbaseESConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OdbcKingbaseESConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OdbcKingbaseESConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
|
using FreeSql.Odbc.Dameng;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@ -24,16 +27,21 @@ namespace FreeSql.Odbc.MySql
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OdbcMySqlConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OdbcMySqlConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OdbcMySqlConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OdbcMySqlConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
|
using FreeSql.Odbc.Dameng;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@ -23,16 +26,21 @@ namespace FreeSql.Odbc.Oracle
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OdbcOracleConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OdbcOracleConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OdbcOracleConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OdbcOracleConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
|
using FreeSql.Odbc.Dameng;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@ -24,16 +27,21 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OdbcPostgreSQLConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OdbcPostgreSQLConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OdbcPostgreSQLConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OdbcPostgreSQLConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
|
using FreeSql.Odbc.Dameng;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
@ -24,16 +26,21 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OdbcSqlServerConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OdbcConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OdbcSqlServerConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OdbcConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OdbcSqlServerConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OdbcSqlServerConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string[] ncharDbTypes = new[] { "NVARCHAR", "NCHAR", "NTEXT" };
|
string[] ncharDbTypes = new[] { "NVARCHAR", "NCHAR", "NTEXT" };
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace FreeSql.Oracle
|
namespace FreeSql.Oracle
|
||||||
@ -21,16 +23,21 @@ namespace FreeSql.Oracle
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new OracleConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => OracleConnectionPool.CreateConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new OracleConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => OracleConnectionPool.CreateConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new OracleConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new OracleConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -54,6 +54,12 @@ namespace FreeSql.Oracle
|
|||||||
}
|
}
|
||||||
base.Return(obj, isRecreate);
|
base.Return(obj, isRecreate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DbConnection CreateConnection(string connectionString)
|
||||||
|
{
|
||||||
|
var conn = new OracleConnection(connectionString);
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OracleConnectionPoolPolicy : IPolicy<DbConnection>
|
class OracleConnectionPoolPolicy : IPolicy<DbConnection>
|
||||||
@ -116,11 +122,7 @@ namespace FreeSql.Oracle
|
|||||||
return obj.Value.Ping(true);
|
return obj.Value.Ping(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DbConnection OnCreate()
|
public DbConnection OnCreate() => OracleConnectionPool.CreateConnection(_connectionString);
|
||||||
{
|
|
||||||
var conn = new OracleConnection(_connectionString);
|
|
||||||
return conn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnDestroy(DbConnection obj)
|
public void OnDestroy(DbConnection obj)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
|
using FreeSql.Internal.ObjectPool;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
using FreeSql.Internal.ObjectPool;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -26,16 +27,21 @@ namespace FreeSql.PostgreSQL
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new PostgreSQLConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new NpgsqlConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new PostgreSQLConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new NpgsqlConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new PostgreSQLConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new PostgreSQLConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
|
using FreeSql.Internal.ObjectPool;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
using FreeSql.Internal.ObjectPool;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -26,16 +27,21 @@ namespace FreeSql.QuestDb
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new QuestDbConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new NpgsqlConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new QuestDbConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new NpgsqlConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new QuestDbConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new QuestDbConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.OscarClient;
|
using System.Data.OscarClient;
|
||||||
using System.Text;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace FreeSql.ShenTong
|
namespace FreeSql.ShenTong
|
||||||
@ -24,16 +24,21 @@ namespace FreeSql.ShenTong
|
|||||||
MasterPool = pool;
|
MasterPool = pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new ShenTongConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new OscarConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new ShenTongConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new OscarConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new ShenTongConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new ShenTongConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
|
@ -10,8 +10,8 @@ using Microsoft.Data.SqlClient;
|
|||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
#endif
|
#endif
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
|
|
||||||
namespace FreeSql.SqlServer
|
namespace FreeSql.SqlServer
|
||||||
{
|
{
|
||||||
@ -29,16 +29,21 @@ namespace FreeSql.SqlServer
|
|||||||
_CreateCommandConnection = pool.TestConnection;
|
_CreateCommandConnection = pool.TestConnection;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new SqlServerConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new SqlConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new SqlServerConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new SqlConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new SqlServerConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new SqlServerConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static DateTime dt1970 = new DateTime(1970, 1, 1);
|
static DateTime dt1970 = new DateTime(1970, 1, 1);
|
||||||
|
@ -3,7 +3,6 @@ using FreeSql.Internal.Model;
|
|||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Data;
|
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
#if MicrosoftData
|
#if MicrosoftData
|
||||||
using Microsoft.Data.Sqlite;
|
using Microsoft.Data.Sqlite;
|
||||||
@ -12,6 +11,8 @@ using System.Data.SQLite;
|
|||||||
#endif
|
#endif
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Linq;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
|
|
||||||
namespace FreeSql.Sqlite
|
namespace FreeSql.Sqlite
|
||||||
{
|
{
|
||||||
@ -29,16 +30,21 @@ namespace FreeSql.Sqlite
|
|||||||
_CreateCommandConnection = pool.TestConnection;
|
_CreateCommandConnection = pool.TestConnection;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new SqliteConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => SqliteConnectionPool.CreateConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new SqliteConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => SqliteConnectionPool.CreateConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new SqliteConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new SqliteConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
#if MicrosoftData
|
#if MicrosoftData
|
||||||
@ -51,6 +49,16 @@ namespace FreeSql.Sqlite
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal SqliteConnectionPoolPolicy policy;
|
internal SqliteConnectionPoolPolicy policy;
|
||||||
|
|
||||||
|
public static DbConnection CreateConnection(string connectionString)
|
||||||
|
{
|
||||||
|
#if MicrosoftData
|
||||||
|
var conn = new SqliteConnection(connectionString);
|
||||||
|
#else
|
||||||
|
var conn = new SQLiteConnection(connectionString);
|
||||||
|
#endif
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SqliteConnectionPoolPolicy : IPolicy<DbConnection>
|
class SqliteConnectionPoolPolicy : IPolicy<DbConnection>
|
||||||
@ -137,15 +145,7 @@ namespace FreeSql.Sqlite
|
|||||||
return obj.Value.Ping(true);
|
return obj.Value.Ping(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DbConnection OnCreate()
|
public DbConnection OnCreate() => SqliteConnectionPool.CreateConnection(_connectionString);
|
||||||
{
|
|
||||||
#if MicrosoftData
|
|
||||||
var conn = new SqliteConnection(_connectionString);
|
|
||||||
#else
|
|
||||||
var conn = new SQLiteConnection(_connectionString);
|
|
||||||
#endif
|
|
||||||
return conn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnDestroy(DbConnection obj)
|
public void OnDestroy(DbConnection obj)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using FreeSql.Internal;
|
using FreeSql.Internal;
|
||||||
|
using FreeSql.Internal.CommonProvider;
|
||||||
using FreeSql.Internal.Model;
|
using FreeSql.Internal.Model;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
@ -24,16 +25,21 @@ namespace FreeSql.Xugu
|
|||||||
MasterPool = new FreeSql.Internal.CommonProvider.DbConnectionPool(DataType.PostgreSQL, connectionFactory);
|
MasterPool = new FreeSql.Internal.CommonProvider.DbConnectionPool(DataType.PostgreSQL, connectionFactory);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isAdoPool = masterConnectionString?.StartsWith("AdoConnectionPool,") ?? false;
|
||||||
|
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
|
||||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||||
MasterPool = new XuguConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
MasterPool = isAdoPool ?
|
||||||
if (slaveConnectionStrings != null)
|
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new XGConnection(masterConnectionString)) as IObjectPool<DbConnection> :
|
||||||
|
new XuguConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
|
||||||
|
|
||||||
|
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
|
||||||
{
|
{
|
||||||
foreach (var slaveConnectionString in slaveConnectionStrings)
|
var slavePool = isAdoPool ?
|
||||||
{
|
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new XGConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
|
||||||
var slavePool = new XuguConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
new XuguConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
|
||||||
SlavePools.Add(slavePool);
|
SlavePools.Add(slavePool);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user