Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/douyacun/gorm_where
根据结构体自动拼接gorm语句
https://github.com/douyacun/gorm_where
Last synced: 16 days ago
JSON representation
根据结构体自动拼接gorm语句
- Host: GitHub
- URL: https://github.com/douyacun/gorm_where
- Owner: douyacun
- Created: 2023-07-04T08:17:08.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-04T08:23:39.000Z (over 1 year ago)
- Last Synced: 2024-11-11T12:26:31.016Z (3 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# gorm-where
根绝struct tag自动拼接sql语句
## tag用法
```go
type AccountQuery struct {
Keyword string `json:"keyword" session:"name,op:like"`
Id string `json:"id" session:"id,op:equal"`
IdList []string `json:"id_list" session:"id,op:in"`
LtId int64 `json:"lt_uid" session:"id,op:lt"`
GtId int64 `json:"gt_uid" session:"id,op:gt"`Page int `es:"page" json:"page" session:"page"`
PageSize int `json:"page_size" session:"page_size"`
Sort string `json:"sort" session:"sort_by"`
NoCount bool `json:"no_count" session:"no_count"`
}
```