datatypes
datatypes copied to clipboard
GORM Customized Data Types Collection
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.3.4 to 1.3.9. Commits dedd1d2 feat: custom type implements autoIncrement (#121) bfee27c feat: gorm.Index was intruduced in v1.23.7 of gorm.io/gorm (#118) 237572f fix: handle database type array...
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.3.2 to 1.3.6. Commits 14d485e feat: custom type implements autoIncrement (#83) 7f572a3 Upgrade gorm.io/gorm eaced4b feat: CurrentSchema (#82) 93bd25e Merge pull request #81 from go-gorm/fix_shard_db aa2eef5 feat:...
# The Question How we can application IN statement that in SQL with JSON query? If I have a people table, and it has a column of JSON data type,...
## Your Question Is there a way to build an SQL query that searches multiple-values (not multiple keys) in a JSON array? ``` SELECT * FROM table WHERE JSON_CONTAINS(obj->'$.array_of_ints', [1,2,3]);...
  
## GORM Playground Link Print before deposit: {"type":"object","labelWidth":120,"displayType":"row","properties":{"b":{"title":"b","type":"array","widget":"multiSelect","description":"","required":true,"disabled":false,"readOnly":false,"items":{"type":"string"},"enum":["\"'dev-01'\"","\"'dev-02'\"","\"'dev-03'\""],"enumNames":["dev-01","dev-02","dev-03"],"props":{"showSearch":true,"filterOption":true,"optionFilterProp":"label"}},"a":{"title":"a","type":"string","widget":"select","description":"","required":false,"disabled":false,"readOnly":false,"api":"staff","enum":["a","b","c"],"enumNames":["早","中","晚"],"props":{"showSearch":true,"filterOption":true,"optionFilterProp":"label"}},"c":{"title":"ceshi","type":"string","widget":"select","required":false,"disabled":false,"readOnly":false,"api":"hostname","props":{"showSearch":true,"filterOption":true,"optionFilterProp":"label"}}}} After inserting into the database: {"type": "object", "labelWidth": 120, "properties": {"a": {"api": "staff", "enum": ["a", "b", "c"], "type": "string", "props": {"showSearch": true,...
update
- [ok] Do only one thing - [ok] Non breaking API changes - [ok] Tested ### What did this pull request do? Void use const Variable. ### User Case Description
## Describe the feature It would be nice to have an ability to change some port of the json, just like the original features "json_set/jsonreplace/jsoninsert/jsonremove" do in mysql. Something like...
DB.Create(&User{ Name: "json-1", Attributes: datatypes.JSON([]byte(`{"name": "jinzhu", "age": 18, "tags": ["tag1", "tag2"], "orgs": {"orga": "orga"}}`)), } 查询tags里,是否有tag1,怎么做呢?谢谢!
## Your Question In the documentation it talks about how to go from time.Time to datatypes.Date() - insert a time into database. Reference: https://github.com/go-gorm/datatypes/ https://github.com/go-gorm/datatypes/blob/master/date.go But to retrieve a date...