polardb的oracle兼容模式,字段无法解析 返回

SqlSugar 沟通中
8 341

polardb的oracle兼容模式,创建了数据表,其中包含Date类型字段(例如pubdate字段类型为date),在使用sqlsugar读表的时候报错,错误信息是:
Unhandled exception. SqlSugar.SqlSugarException: SqlSugarException.NotSupportedException: "sys.date" Type NotSupported, DbBindProvider.GetPropertyTypeName error.


请添加相关支持

热忱回答8

  • fate sta fate sta VIP0
    1个月前

    我处理一下 

    0 回复
  • fate sta fate sta VIP0
    1个月前

    你用DbType是什么

    0 回复
  • @fate sta:谢谢,是SqlSugarCore这个包

    0 回复
  • @fate sta:我用的DbType = DbType.PostgreSQL

    0 回复
  • fate sta fate sta VIP0
    1个月前

    SqlSugarCore 5.1.4.176-preview20


    过五分钟后 ,勾一下预览安装 20的预览版本

    0 回复
  • @fate sta:感谢修复,我安装了预览版本后,问题暂未解决。

    报错Trace信息是

    Unhandled exception. SqlSugar.SqlSugarException: SqlSugarException.NotSupportedException: "sys.date" Type NotSupported, DbBindProvider.GetPropertyTypeName error.

       at SqlSugar.Check.ThrowNotSupportedException(String message)

       at SqlSugar.PostgreSQLDbBind.GetPropertyTypeName(String dbTypeName)

       at SqlSugar.IDataReaderEntityBuilder`1.BindMethod(ILGenerator generator, EntityColumnInfo columnInfo, Int32 ordinal)

       at SqlSugar.IDataReaderEntityBuilder`1.BindField(ILGenerator generator, LocalBuilder result, EntityColumnInfo columnInfo, String fieldName)

       at SqlSugar.IDataReaderEntityBuilder`1.CreateBuilder(Type type)

       at SqlSugar.DbBindAccessory.<>c__DisplayClass4_0`1.<GetEntityList>b__1()

       at SqlSugar.ReflectionInoCore`1.GetOrCreate(String cacheKey, Func`1 create)

       at SqlSugar.ReflectionInoCacheService.GetOrCreate[V](String cacheKey, Func`1 create, Int32 cacheDurationInSeconds)

       at SqlSugar.DbBindAccessory.GetEntityList[T](SqlSugarProvider context, IDataReader dataReader)

       at SqlSugar.DbBindProvider.DataReaderToList[T](Type type, IDataReader dataReader)

       at SqlSugar.QueryableProvider`1.GetData[TResult](Boolean isComplexModel, Type entityType, IDataReader dataReader)

       at SqlSugar.QueryableProvider`1.GetData[TResult](KeyValuePair`2 sqlObj)

       at SqlSugar.QueryableProvider`1._ToList[TResult]()

       at SqlSugar.QueryableProvider`1.ToList()



    我的client初始化代码是

    _dbClients[connectionString.Name] = new SqlSugarClient(new ConnectionConfig()

    {

        ConnectionString = connectionString.ConnectionString,

        DbType = DbType.PostgreSQL, 

        IsAutoCloseConnection = true,

    });


    polardb(Oracle语法兼容)里面的字段如下图
    image.png


    当前SqlSugar版本5.1.4.176-preview20


    请问问题出在哪里,谢谢。

    0 回复
  • fate sta fate sta VIP0
    1个月前

    SqlSugarCore 5.1.4.176-preview22

    这次应该可以了

    0 回复
  • @fate sta:可以了,点赞!

    0 回复