database/option_test.go

40 lines
646 B
Go
Raw Normal View History

2024-08-09 18:26:30 +08:00
// Package database ...
//
// Description : database ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2024-08-09 18:19
package database
import (
"fmt"
2024-08-23 17:54:48 +08:00
"git.zhangdeman.cn/zhangdeman/database/define"
2024-08-09 18:26:30 +08:00
"testing"
)
func Test_optionToSql(t *testing.T) {
2024-08-23 17:54:48 +08:00
o := &define.Option{
2024-08-09 18:26:30 +08:00
In: nil,
NotIn: nil,
Where: map[string]any{
"name": []string{"zhang", "baicha"},
"age": 18,
},
Start: nil,
End: nil,
Like: map[string]string{
"name": "de",
},
NotLike: map[string]string{
"name": "zhang",
},
NotEqual: map[string]any{
"a": 123,
},
Order: nil,
OR: nil,
}
fmt.Println(optionToSql(o))
}