added checks for sql null types
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user