Files
lazy/cmd/main.go
2026-01-16 15:59:44 -05:00

47 lines
742 B
Go

package main
import (
"database/sql"
"fmt"
"time"
"code.jakeyoungdev.com/go/lazy"
)
func main() {
type Test struct {
Timer sql.NullTime `db:"timer"`
TestTime time.Time `db:"times"`
}
// 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: 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)
}