added checks for sql null types

This commit is contained in:
2026-01-16 15:59:44 -05:00
parent 7fd2f60168
commit e8ceac6f88
2 changed files with 76 additions and 64 deletions

View File

@@ -1,13 +1,19 @@
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{},
@@ -16,7 +22,7 @@ func main() {
x, y := lazy.RandomGenerate(lazy.Config{
Query: "select * from table",
Example: lazy.Test{},
Example: Test{},
RowCount: 1,
})
if y != nil {