fix/allow-many-rows #1

Merged
jake merged 8 commits from fix/allow-many-rows into main 2025-09-26 22:58:51 +00:00
Showing only changes of commit 428381545d - Show all commits

View File

@@ -28,10 +28,10 @@ func GenerateRandomResults(query string, exampleObj any, keyVal any, rowCount in
retType := reflect.TypeOf(exampleObj) retType := reflect.TypeOf(exampleObj)
maxFieldCount := retType.NumField() maxFieldCount := retType.NumField()
columns := make([]string, 0, maxFieldCount) columns := make([]string, 0, maxFieldCount)
rows := make([][]driver.Value, 0, maxFieldCount) rows := make([][]driver.Value, 0)
//double loop here to allow for multiple rows
for y := 0; y < rowCount; y++ { for y := 0; y < rowCount; y++ {
rows[y] = make([]driver.Value, 0)
for x := 0; x < maxFieldCount; x++ { for x := 0; x < maxFieldCount; x++ {
field := retType.Field(x) field := retType.Field(x)
dbTag := field.Tag.Get("db") dbTag := field.Tag.Get("db")