Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add Mysql&Postgres Json Like #225

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

wave2way
Copy link
Contributor

@wave2way wave2way commented Sep 12, 2023

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Add Likes function on JSONQueryExpression

User Case Description

`
type UserWithJSON struct {
gorm.Model
Name string
Attributes datatypes.JSON
}

DB.Create(&User{
Name: "json-1",
Attributes: datatypes.JSON([]byte({"name": "jinzhu", "age": 18, "tags": ["tag1", "tag2"], "orgs": {"orga": "orga"}})),
}

var result UserWithJSON
DB.First(&result, datatypes.JSONQuery("attributes").Likes("%jin%", "name"))
`

@wave2way
Copy link
Contributor Author

wave2way commented Sep 12, 2023

why the test container start failed with "Error: One or more containers failed to start." ?

@jinzhu jinzhu merged commit aa60862 into go-gorm:master Oct 26, 2023
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants