Skip to content

Releases: dotnetcore/SmartSql

v4.1.45

18 Dec 08:27
Compare
Choose a tag to compare
  1. add code-of-conduct
  2. fix Concurrent Register EnumTypeHandler bug
  3. add support TypeHandler for CommandType.StoredProcedure

v4.1.42

19 Nov 04:00
Compare
Choose a tag to compare
  1. fix #94
  2. fix #113
  3. fix CUD use ColumnAttribute.Name bug
  4. fix #114
  5. add Support for simultaneous use of SqlMap and StatementAttribute
  6. fix #119
  7. Fix ResultMap missing BUG

v4.1.33

28 Oct 09:28
Compare
Choose a tag to compare
  1. optimize TypeUtils error msg
  2. add Ordered for Middlewares
  3. fix CUD bug
  4. optimize ConfigBuilder
  5. add support automatically assign [Id] to [Entity] using the IdGenerator

v4.1.29

26 Sep 07:23
Compare
Choose a tag to compare

1. add support Auto Converter

configure for SmartSqlConfig.xml

  <AutoConverters>
    <AutoConverter Name="NoneConverter">
      <Tokenizer Name="None"/>
      <Converter Name="None"/>
    </AutoConverter>
    <AutoConverter Name="Default" Default="true">
      <Tokenizer Name="Default"/>
      <Converter Name="Pascal"/>      
    </AutoConverter>
    <AutoConverter Name="PascalConverter">
      <Tokenizer Name="Default">
        <Properties>
          <Property Name="IgnorePrefix" Value="" />
          <Property Name="Delimiter" Value="_" />
          <Property Name="UppercaseSplit" Value="false" />
        </Properties>
      </Tokenizer>
      <Converter Name="Pascal"/>
    </AutoConverter>
    <AutoConverter Name="DelimiterConverter">
      <Tokenizer Name="Default">
        <Properties>
          <Property Name="IgnorePrefix" Value="col_" />
          <Property Name="Delimiter" Value="_" />
          <Property Name="UppercaseSplit" Value="true" />
        </Properties>
      </Tokenizer>
      <Converter Name="Delimiter">
        <Properties>
          <Property Name="Prefix" Value="Col_" />
          <Property Name="Delimiter" Value="_"/>
          <Property Name="Mode" Value="FirstUpper"/>
        </Properties>
      </Converter>
    </AutoConverter>
  </AutoConverters>

configure for SqlMaps

    <!-- to current sql map -->
    <UseAutoConverter Name="DelimiterConverter"/>

    <!-- disabled auto converter to current sql map -->
    <UseAutoConverter Disabled="true"/>

    <!-- assign auto converter at statement -->
    <Statement Id="AssignAutoConverterQuery" AutoConverter="PascalConverter" >
        Select * From T_AutoConverter_1
    </Statement>

assign auto converter at RequestContext

            var list = SqlMapper.Query<AutoConverter_2>(new RequestContext
            {
                Scope = "DefaultAutoConverter",
                SqlId = "AssignAutoFromRequestConverterQuery",
                AutoConverterName = "DelimiterConverter"
            });

v4.1.27

30 Aug 15:18
2fd661e
Compare
Choose a tag to compare
  1. fix StatementType parse bug for SmartSql.DataConnector
  2. optimize FlushOnExecuted log
  3. fix ISqlMapperExtensions SessionStore.Dispose bug
  4. optimize PropertyTokenizer
  5. fix #99
  6. fix #100 -> thx #101
  7. optimize #102
  8. add QueryDynamic/QueryDictionary extension for DbSession/SqlMapper
  9. add support same [Scope] for mutil-sqlmap -> thx #104

v4.1.19

13 Aug 04:00
Compare
Choose a tag to compare
  1. add AES/DES TypeHandler impl
  2. init SmartSql.DataConnector
  3. task builder register smartsql use alias for SmartSql.DataConnector
  4. optimize Error log
  5. optimize sourceParameterPrefix when null
  6. SmartSql.DataConnector pack as tool
  7. add support Mutil-Publisher-Subscriber for SmartSql.InvokeSync.RabbitMQ
  8. add support Mutil-Publisher-Subscriber for SmartSql.InvokeSync.Kafka
  9. add support DbCommandCreated event for CommandExecuter
  10. fix #89
Install-Package SmartSql.Oracle
 new SmartSqlBuilder().
    UseOracleCommandExecuter()
    ...

v4.1.11

30 Jul 05:37
Compare
Choose a tag to compare
  1. add support Now-Tag
    <Statement Id="GetNow">
      <Now Property="CreateTime"/>
      Select @CreateTime;
    </Statement>
    <Statement Id="UpdateDateTime">
      <Now Property="CreateTime"/>
      UPDATE T_AllPrimitive
      <Set>
        DateTime =@CreateTime
      </Set>
      Where Id=@Id
    </Statement>
Select @CreateTime;
Parameters:[CreateTime=2019/7/30 3:46:18]
Sql with parameter value: 
Select '2019/7/30 3:46:18'; (99204db3)
UPDATE T_AllPrimitive
       Set DateTime =@DateTime
      Where Id=@Id
Parameters:[DateTime=2019/7/30 11:38:13,Id=86088]
Sql with parameter value: 
UPDATE T_AllPrimitive
       Set DateTime ='2019/7/30 11:38:13'
      Where Id=86088 
  1. add support Properties nest propExp
  2. add UsePropertiesFromEnv api for SmartSqlBuilder
  3. add CryptoTypeHandler api - pre
  4. add IFunction api - pre

v4.1.9

29 Jul 14:14
Compare
Choose a tag to compare
  1. add support IgnoreDbNull ofr SmartSqlConfig
  2. add support AddTypeHandler for SmartSqlBuilder
  3. add GetSetParameterValue api for TypeHandler
  4. add TypeScan
  5. add RegisterEntity for SmartSqlBuilder
  6. add support TypeHandler for Bulk api
  7. add support Cache-Annotation with Cache-XML Mixed use
  8. optimize PrepareStatement
  9. add support EnablePropertyChangedTrack/ReadDb/CommandTimeout for StatementAttribute

v4.1.5

27 Jul 03:42
Compare
Choose a tag to compare
  1. add support CacheKeyTemplate for RequestContext
  2. add Rest api for ICacheManager
  3. add support for dynamic generation of SqlMap with Repository interface
    [Cache("DateCache", "Lru", FlushInterval = 6000)]
    [Cache("LruCache", "Lru", FlushInterval = 6000)]
    [Cache("UserCache", "Fifo", FlushOnExecutes = new[] {"UpdateUserName"})]
    public interface IUsedCacheRepository
    {
        [ResultCache("DateCache", Key = "GetNow")]
        [Statement(Sql = "Select GetDate();")]
        DateTime GetNow();

        [ResultCache("LruCache", Key = "GetId:$id")]
        [Statement(Sql = "Select @id;")]
        int GetId(long id);

        [ResultCache("UserCache", Key = "GetUserById:$id")]
        [Statement(Sql = "select * from T_User where id=@id;")]
        User GetUserById(long id);

        [Statement(Sql = "update T_User set UserName=@userName where id=@id;")]
        int UpdateUserName(long id, string userName);
    }

v4.1.3

26 Jul 05:41
Compare
Choose a tag to compare
  1. Change Sample DB To SQLite And Fix SQLite ParameterPrefix
  2. add support [For-tag] nest-value-access
  3. optimize Check null-Tag.Property from XML-tag
  4. optimize Check null-Tag.Property ExceptionMessage
  5. add support Cache-Annotations for Repository-interface - Demo
    [Cache("DateCache", "Lru", FlushInterval = 6000)]
    [Cache("LruCache", "Lru", FlushInterval = 6000)]
    [Cache("UserCache", "Fifo", FlushOnExecutes = new[] {"UpdateUserName"})]
    public interface IUsedCacheRepository
    {
        [ResultCache("DateCache", Key = "GetNow")]
        [Statement(Sql = "Select Now();")]
        DateTime GetNow();

        [ResultCache("LruCache", Key = "GetId:$id")]
        [Statement(Sql = "Select @id;")]
        int GetId(long id);

        [ResultCache("UserCache", Key = "GetUserById:$id")]
        [Statement(Sql = "select * from T_User where id=@id;")]
        User GetUserById(long id);

        [Statement(Sql = "update T_User set UserName=@userName where id=@id;")]
        int UpdateUserName(long id, string userName);
    }
  1. add support ColumnAttribute for EntityDeserializer
  2. add support ColumnAttribute for RequestConvert
  3. add support ParamAttribute for TypeHandler
  4. add ResultType From ArrayType to Object for ExecuteScalar.
    [Annotations.Table("t_annotation_entity")]
    public class ColumnAnnotationEntity
    {
        [Annotations.Column("id", IsAutoIncrement = true)]
        public long Id { get; set; }

        [Annotations.Column("name")] public String Name { get; set; }

        [Annotations.Column("extend_data", TypeHandler = "Json")]
        public ExtendData Data { get; set; }

        public class ExtendData
        {
            public String Info { get; set; }
        }
    }

    public interface IColumnAnnotationRepository
    {
        ISqlMapper SqlMapper { get; }

        [Statement(Sql = "Select Top 1 T.* From t_column_annotation_entity T where T.id=@id")]
        ColumnAnnotationEntity GetEntity(long id);

        [Statement(Sql =
            "INSERT INTO t_column_annotation_entity(name,extend_data)VALUES(@Name,@Data);Select Scope_Identity();")]
        int Insert(ColumnAnnotationEntity entity);

        [Statement(Sql =
            "INSERT INTO t_column_annotation_entity(name,extend_data)VALUES(@Name,@Data);Select Scope_Identity();")]
        int Insert([Param("Name")] string name,
            [Param("Data", TypeHandler = "Json")] ColumnAnnotationEntity.ExtendData data);
    }