Skip to content

Commit

Permalink
发布2.3.5版本;
Browse files Browse the repository at this point in the history
  • Loading branch information
zqlovejyc committed Apr 4, 2022
1 parent 73b9f17 commit 74c0703
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<PackageReleaseNotes>1.升级SQLBuilder引用版本;</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageId>Zq.SQLBuilder.Core.Diagnostics</PackageId>
<Version>2.3.4</Version>
<FileVersion>2.3.4.0</FileVersion>
<AssemblyVersion>2.3.4.0</AssemblyVersion>
<Version>2.3.5</Version>
<FileVersion>2.3.5.0</FileVersion>
<AssemblyVersion>2.3.5.0</AssemblyVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions SQLBuilder.Core.ElasticApm/SQLBuilder.Core.ElasticApm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<PackageTags>sqlbuilder;elastic;apm</PackageTags>
<PackageReleaseNotes>1.升级SQLBuilder引用版本;</PackageReleaseNotes>
<PackageId>Zq.SQLBuilder.Core.ElasticApm</PackageId>
<Version>2.3.4</Version>
<FileVersion>2.3.4.0</FileVersion>
<AssemblyVersion>2.3.4.0</AssemblyVersion>
<Version>2.3.5</Version>
<FileVersion>2.3.5.0</FileVersion>
<AssemblyVersion>2.3.5.0</AssemblyVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions SQLBuilder.Core.SkyWalking/SQLBuilder.Core.SkyWalking.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<PackageReleaseNotes>1.升级SQLBuilder引用版本;</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageId>Zq.SQLBuilder.Core.SkyWalking</PackageId>
<Version>2.3.4</Version>
<FileVersion>2.3.4.0</FileVersion>
<AssemblyVersion>2.3.4.0</AssemblyVersion>
<Version>2.3.5</Version>
<FileVersion>2.3.5.0</FileVersion>
<AssemblyVersion>2.3.5.0</AssemblyVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
45 changes: 32 additions & 13 deletions SQLBuilder.Core/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,23 @@ public static class StringExtensions
/// <returns>string</returns>
public static string Substring(this string @this, string separator, bool lastIndexOf = true)
{
var startIndex = (lastIndexOf ?
@this.LastIndexOf(separator, StringComparison.OrdinalIgnoreCase) :
@this.IndexOf(separator, StringComparison.OrdinalIgnoreCase)) +
separator.Length;
if (@this.IsNullOrEmpty())
return string.Empty;

if (separator.IsNullOrEmpty())
return string.Empty;

var startIndex = lastIndexOf
? @this.LastIndexOf(separator, StringComparison.OrdinalIgnoreCase)
: @this.IndexOf(separator, StringComparison.OrdinalIgnoreCase);

if (startIndex == -1)
return string.Empty;

startIndex += separator.Length;

var length = @this.Length - startIndex;

return @this.Substring(startIndex, length);
}

Expand All @@ -58,32 +69,40 @@ public static string Substring(this string @this, string separator, bool lastInd
/// <returns>string</returns>
public static string Substring(this string @this, string begin, string end, bool beginIsIndexOf = true, bool endIsIndexOf = true)
{
if (string.IsNullOrEmpty(@this))
return "";
if (string.IsNullOrEmpty(begin))
return "";
if (string.IsNullOrEmpty(end))
return "";
if (@this.IsNullOrEmpty())
return string.Empty;

if (begin.IsNullOrEmpty())
return string.Empty;

if (end.IsNullOrEmpty())
return string.Empty;

int li;

if (beginIsIndexOf)
li = @this.IndexOf(begin);
else
li = @this.LastIndexOf(begin);

if (li == -1)
return "";
return string.Empty;

li += begin.Length;

int ri;

if (endIsIndexOf)
ri = @this.IndexOf(end, li);
else
ri = @this.LastIndexOf(end);

if (ri == -1)
return "";
return string.Empty;

var length = ri - li;

return @this.Substring(li, ri - li);
return @this.Substring(li, length);
}
#endregion

Expand Down
2 changes: 1 addition & 1 deletion SQLBuilder.Core/Repositories/MySqlRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public override long Insert<T>(T entity, bool identity, string identitySql = nul
public override async Task<long> InsertAsync<T>(T entity, bool identity, string identitySql = null) where T : class
{
if (!identity)
return Insert(entity);
return await InsertAsync(entity);

identitySql ??= "SELECT LAST_INSERT_ID()";

Expand Down
2 changes: 1 addition & 1 deletion SQLBuilder.Core/Repositories/NpgsqlRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public override long Insert<T>(T entity, bool identity, string identitySql = nul
public override async Task<long> InsertAsync<T>(T entity, bool identity, string identitySql = null) where T : class
{
if (!identity)
return Insert(entity);
return await InsertAsync(entity);

identitySql ??= "RETURNING $PRIMARYKEY";

Expand Down
2 changes: 1 addition & 1 deletion SQLBuilder.Core/Repositories/SqlRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public override long Insert<T>(T entity, bool identity, string identitySql = nul
public override async Task<long> InsertAsync<T>(T entity, bool identity, string identitySql = null) where T : class
{
if (!identity)
return Insert(entity);
return await InsertAsync(entity);

identitySql ??= "SELECT SCOPE_IDENTITY()";

Expand Down
2 changes: 1 addition & 1 deletion SQLBuilder.Core/Repositories/SqliteRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public override long Insert<T>(T entity, bool identity, string identitySql = nul
public override async Task<long> InsertAsync<T>(T entity, bool identity, string identitySql = null) where T : class
{
if (!identity)
return Insert(entity);
return await InsertAsync(entity);

identitySql ??= "SELECT LAST_INSERT_ROWID()";

Expand Down
15 changes: 10 additions & 5 deletions SQLBuilder.Core/SQLBuilder.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Authors>张强</Authors>
<Version>2.3.4</Version>
<FileVersion>2.3.4.0</FileVersion>
<AssemblyVersion>2.3.4.0</AssemblyVersion>
<Version>2.3.5</Version>
<FileVersion>2.3.5.0</FileVersion>
<AssemblyVersion>2.3.5.0</AssemblyVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Expression表达式转换为SQL语句,支持SqlServer、MySql、Oracle、Sqlite、PostgreSql;基于Dapper实现了不同数据库对应的数据仓储Repository;</Description>
<Copyright>Copyright © 2018-2025 , 张强 [email protected]</Copyright>
<PackageId>Zq.SQLBuilder.Core</PackageId>
<PackageReleaseNotes>1.新增DataType特性,允许自定义表实体单个字段数据库类型;
2.优化Dispose;</PackageReleaseNotes>
<PackageReleaseNotes>1.优化SqlBuilderCore部分属性;
2.优化GetKeyWordIndex;
3.优化字典初始化和取值判断;
4.移除OracleColumnAttribute和Oracle插入更新扩展,采用DataTypeAttribute特性进行替代即可;
5.优化GetColumnInfo和GetPrimaryKey返回类型;
6.KeyAttribute特性新增OracleSequenceName;
7.重载仓储Insert,支持返回自增主键值;</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/zqlovejyc/SQLBuilder.Core</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageIcon>sql.png</PackageIcon>
Expand Down

0 comments on commit 74c0703

Please sign in to comment.