mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
-
This commit is contained in:
@@ -61,6 +61,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return (HasWhere?"AND":"WHERE")+ " ROWNUM=1";
|
return (HasWhere?"AND":"WHERE")+ " ROWNUM=1";
|
||||||
}
|
}
|
||||||
|
else if (this.Context is PostgreSQLExpressionContext)
|
||||||
|
{
|
||||||
|
return "limit 1";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "limit 0,1";
|
return "limit 0,1";
|
||||||
|
@@ -103,6 +103,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = queryBuilder.GetSelectByItems(selectItems);
|
result = queryBuilder.GetSelectByItems(selectItems);
|
||||||
|
if (_context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
|
||||||
|
{
|
||||||
|
result = result.ToLower();
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
23
Src/Asp.Net/SqlSugar/OnlyNet/PostgreSQLExpressionContext.cs
Normal file
23
Src/Asp.Net/SqlSugar/OnlyNet/PostgreSQLExpressionContext.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace SqlSugar
|
||||||
|
{
|
||||||
|
internal class PostgreSQLExpressionContext : ExpressionContext, ILambdaExpressions
|
||||||
|
{
|
||||||
|
public SqlSugarClient Context
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -115,6 +115,7 @@
|
|||||||
<Compile Include="ExternalServiceInterface\ISerializeService.cs" />
|
<Compile Include="ExternalServiceInterface\ISerializeService.cs" />
|
||||||
<Compile Include="Entities\DefaultServices.cs" />
|
<Compile Include="Entities\DefaultServices.cs" />
|
||||||
<Compile Include="Infrastructure\Mapper.cs" />
|
<Compile Include="Infrastructure\Mapper.cs" />
|
||||||
|
<Compile Include="OnlyNet\PostgreSQLExpressionContext.cs" />
|
||||||
<Compile Include="Realization\Oracle\Deleteable\OracleDeleteable.cs" />
|
<Compile Include="Realization\Oracle\Deleteable\OracleDeleteable.cs" />
|
||||||
<Compile Include="Realization\Oracle\Insertable\OracleInsertable.cs" />
|
<Compile Include="Realization\Oracle\Insertable\OracleInsertable.cs" />
|
||||||
<Compile Include="Realization\Oracle\Updateable\OracleUpdateable.cs" />
|
<Compile Include="Realization\Oracle\Updateable\OracleUpdateable.cs" />
|
||||||
|
@@ -61,6 +61,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return (HasWhere?"AND":"WHERE")+ " ROWNUM=1";
|
return (HasWhere?"AND":"WHERE")+ " ROWNUM=1";
|
||||||
}
|
}
|
||||||
|
else if (this.Context is PostgreSQLExpressionContext)
|
||||||
|
{
|
||||||
|
return "limit 1";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "limit 0,1";
|
return "limit 0,1";
|
||||||
|
Reference in New Issue
Block a user