Skip to content

Commit

Permalink
mysql missing where
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Qu authored and Victor Qu committed Oct 16, 2024
1 parent 64444d3 commit 7f19ccd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ProjectCommon.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<Version>0.0.2.5</Version>
<Version>0.0.2.6</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<FileVersion>$(Version)</FileVersion>
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)$(VersionSuffix)</Version>
Expand Down
9 changes: 9 additions & 0 deletions src/SV.Db.Sloth.MySql/MySqlConnectionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ private void BuildSelectStatement(DbCommand cmd, DbEntityInfo info, SelectStatem
}
}

if (statement.Where == null || statement.Where.Condition == null)
{
table = table.Replace("{Where}", string.Empty, StringComparison.OrdinalIgnoreCase);
}
else
{
table = table.Replace("{Where}", BuildCondition(cmd, info, statement.Where.Condition), StringComparison.OrdinalIgnoreCase);
}

if (statement.GroupBy.IsNotNullOrEmpty())
{
table = table.Replace("{OrderBy}", $"group by {ConvertFields(info, statement.GroupBy, false)} ");
Expand Down

0 comments on commit 7f19ccd

Please sign in to comment.