2.1 SmartSqlMapConfig & SmartSqlMap √ (Yes, you guessed that, like MyBatis, you separated SQL from the XML configuration.)
2.2 Config Hot Update ->ConfigWatcher & Reload (Configuration file hot update: when you need to change Sql, modify the SqlMap configuration file directly and save it.)
3 Read-write separation
3.1 Read-write separation
3.2 Election of the read database by weight
3.3 读库故障检测,剔除
4 Logging √
4.1 Base on Microsoft.Extensions.Logging.Abstractions (When you need to track the debugging when everything is so clear at a glance)
<?xml version="1.0" encoding="utf-8" ?>
<SmartSqlMapScope="T_Test"xmlns="http://SmartSql.net/schemas/SmartSqlMap.xsd">
<Statements>
<StatementId="QueryParams">
</Statement>
<!--Insert-->
<StatementId="Insert">
INSERT INTO T_Test
(Name)
VALUES
(@Name)
;Select Scope_Identity();
</Statement>
<!--Delete-->
<StatementId="Delete">
Delete T_Test
Where Id=@Id
</Statement>
<!--Update-->
<StatementId="Update">
UPDATE T_Test
SET
Name = @Name
Where Id=@Id
</Statement>
<!--GetList-->
<StatementId="GetList">
SELECT T.* From T_Test T With(NoLock)
<IncludeRefId="QueryParams"/>
Order By T.Id Desc
</Statement>
<!--GetListByPage-->
<StatementId="GetListByPage">
Select TT.* From
(Select ROW_NUMBER() Over(Order By T.Id Desc) Row_Index,T.* From T_Test T With(NoLock)
<IncludeRefId="QueryParams"/>) TT
Where TT.Row_Index Between ((@PageIndex-1)*@PageSize+1) And (@PageIndex*@PageSize)
</Statement>
<!--GetRecord-->
<StatementId="GetRecord">
Select Count(1) From T_Test T With(NoLock)
<IncludeRefId="QueryParams"/>
</Statement>
<!--GetEntity-->
<StatementId="GetEntity">
Select Top 1 T.* From T_Test T With(NoLock)
<Where>
<IsNotEmptyPrepend="And"Property="Id">
T.Id=@Id
</IsNotEmpty>
</Where>
</Statement>
<!--IsExist-->
<StatementId="IsExist">
Select Count(1) From T_Test T With(NoLock)
<IncludeRefId="QueryParams"/>
</Statement>
</Statements>
</SmartSqlMap>