42 lines
626 B
Go
42 lines
626 B
Go
// Package database ...
|
|
//
|
|
// Description : database ...
|
|
//
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
//
|
|
// Date : 2024-08-09 18:19
|
|
package database
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func Test_optionToSql(t *testing.T) {
|
|
type args struct {
|
|
o *Option
|
|
}
|
|
o := &Option{
|
|
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))
|
|
}
|