-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add box results to generated table queries (#194)
This adds support for the `box_results` flag to tables as well as queries.
- Loading branch information
1 parent
1c0755e
commit de44900
Showing
7 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ func main() { | |
|
||
pgClient := models.NewPGClient(conn) | ||
|
||
_, err = pgClient.BulkInsertUser(ctx, []models.User{ | ||
ids, err := pgClient.BulkInsertUser(ctx, []models.User{ | ||
{ Nickname: "Jim", Email: "[email protected]" }, | ||
{ Nickname: "Bill", Email: "[email protected]" }, | ||
{ Nickname: "Stacy", Email: "[email protected]" }, | ||
|
@@ -30,11 +30,21 @@ func main() { | |
log.Fatal(err) | ||
} | ||
|
||
users, err := pgClient.ListUser(ctx, ids) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fmt.Printf("type of user result: %T\n", users[0]) | ||
fmt.Println("name 1:", users[0].Nickname) | ||
|
||
res, err := pgClient.GetUsersFromGmail(ctx) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fmt.Printf("type of user result: %T\n", res[0]) | ||
|
||
fmt.Println("users from gmail:", len(res)) | ||
fmt.Println("name 1:", res[0].Nickname) | ||
fmt.Println("name 2:", res[1].Nickname) | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[[table]] | ||
name = "users" | ||
box_results = true | ||
|
||
[[query]] | ||
name = "GetUsersFromGmail" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
type of user result: *models.User | ||
name 1: Jim | ||
type of user result: *models.User | ||
users from gmail: 2 | ||
name 1: Jim | ||
name 2: Bill |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters