poc for sql null types
This commit is contained in:
40
cmd/main.go
Normal file
40
cmd/main.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.jakeyoungdev.com/go/lazy"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
// res, err := lazy.RandomStruct(lazy.StructConfig{
|
||||
// Query: "insert into test (one, two) values (?, ?), (?, ?)",
|
||||
// Example: test{},
|
||||
// RowCount: 2,
|
||||
// })
|
||||
|
||||
x, y := lazy.RandomGenerate(lazy.Config{
|
||||
Query: "select * from table",
|
||||
Example: lazy.Test{},
|
||||
RowCount: 1,
|
||||
})
|
||||
if y != nil {
|
||||
panic(y)
|
||||
}
|
||||
fmt.Printf("%+v", x)
|
||||
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
|
||||
// fmt.Println(res)
|
||||
|
||||
// t, ok := res.MockStructs[0].(test)
|
||||
// if !ok {
|
||||
// fmt.Println("errrrrrr")
|
||||
// }
|
||||
|
||||
// fmt.Println(t.One)
|
||||
// fmt.Println(t.Two)
|
||||
}
|
||||
Reference in New Issue
Block a user