Skip to content

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

@sunbeam27

Description

@sunbeam27

GORM Playground Link

#284

问题描述

	set := datatypes.JSONSet("object")
	set.Set("test_bool", meta.TestBool)
       db.....Update("object", set)

执行后结果

 { "test_bool": 1}

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions