Skip to content

Commit a50e862

Browse files
committed
更新文档:达梦最新驱动已经支持TEXT类型使用string接收
1 parent e23e90c commit a50e862

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
v1.7.7
2+
- 更新文档:达梦最新驱动已经支持TEXT类型使用string接收
23
- 升级decimal到1.4.0
34
- 接收值的entity参数为nil,抛出错误
45
- dv.InterfaceData已过时,修改为dv.IsNil()

ICustomDriverValueConver.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type ICustomDriverValueConver interface {
4545
ConverDriverValue(ctx context.Context, columnType *sql.ColumnType, tempDriverValue driver.Value, structFieldType *reflect.Type) (interface{}, error)
4646
}
4747

48-
// RegisterCustomDriverValueConver 注册自定义的字段处理逻辑,用于驱动无法直接转换的场景,例如达梦的 TEXT 无法直接转化成 string
48+
// RegisterCustomDriverValueConver 注册自定义的字段处理逻辑,用于驱动无法直接转换的场景.
4949
// dialectColumnType 值是 Dialect.字段类型,例如: dm.TEXT
5050
// 一般是放到init方法里进行注册
5151
func RegisterCustomDriverValueConver(dialectColumnType string, customDriverValueConver ICustomDriverValueConver) error {
@@ -131,7 +131,7 @@ func (dmtext CustomDMText) ConverDriverValue(ctx context.Context, columnType *sq
131131
132132
return &str, errReadString
133133
}
134-
// RegisterCustomDriverValueConver 注册自定义的字段处理逻辑,用于驱动无法直接转换的场景,例如达梦的 TEXT 无法直接转化成 string
134+
// RegisterCustomDriverValueConver 注册自定义的字段处理逻辑,用于驱动无法直接转换的场景.
135135
// 一般是放到init方法里进行注册
136136
func init() {
137137
// dialectColumnType 值是 Dialect.字段类型 ,例如 dm.TEXT

README_zh.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ zorm对国产数据库的适配不遗余力,遇到没有适配或者有问题的
3838
### 达梦(dm)
3939
- 配置zorm.DataSourceConfig的 ```DriverName:dm ,Dialect:dm```
4040
- 达梦数据库驱动: gitee.com/chunanyong/dm
41-
- 达梦的TEXT类型会映射为dm.DmClob,string不能接收,需要实现zorm.ICustomDriverValueConver接口,自定义扩展处理
41+
- ~~达梦的TEXT类型会映射为dm.DmClob,string不能接收,需要实现zorm.ICustomDriverValueConver接口,自定义扩展处理~~
42+
- 达梦最新驱动已经支持TEXT类型使用string接收,不需要自定义扩展了
4243
```go
4344
import (
4445
// 00.引入数据库驱动
@@ -98,7 +99,7 @@ func (dmtext CustomDMText) ConverDriverValue(ctx context.Context, columnType *sq
9899

99100
return &str, errReadString
100101
}
101-
// RegisterCustomDriverValueConver 注册自定义的字段处理逻辑,用于驱动无法直接转换的场景,例如达梦的 TEXT 无法直接转化成 string
102+
// RegisterCustomDriverValueConver 注册自定义的字段处理逻辑,用于驱动无法直接转换的场景.
102103
// 一般是放到init方法里进行注册
103104
func init() {
104105
// dialectColumnType 值是 Dialect.字段类型 ,例如 dm.TEXT

0 commit comments

Comments
 (0)