go-gorm / go-gorm/datatypes

mysql JSONSet Build bool type to 1/0,expected true/false

Open
#285 1 comment 0 reactions 1 assignee Claimed by @jinzhu View on GitHub
Dominant language
Go
Stars
831
Forks
124
PR merge metrics
No merged PRs in 30d

Description

## GORM Playground Link

https://github.com/go-gorm/datatypes/pull/284

问题描述
```golang
set := datatypes.JSONSet("object")
set.Set("test_bool", meta.TestBool)
db.....Update("object", set)

```

执行后结果

```
{ "test_bool": 1}

```

修改
bool 类型直接构造为 SQL,而不是通过 statement AddVar 替换为占位符

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.