Updated PGX Support (markdown)

Vinícius Garcia 2023-07-02 22:18:21 -03:00
parent afcdf45cad
commit ba77fdefe2

@ -21,11 +21,12 @@ The example query below also [available here][examples/pgxsupport] illustrates o
[examples/pgxsupport]: https://github.com/VinGarcia/ksql/blob/master/examples/pgxsupport/main.go#L92
```golang
func checkIfUserBelongsToTeams(ctx context.Context, db ksql.Provider, userID int, teamIDs []int) {
// Check if user belongs to either of the input teams:
var row struct {
Count pgtype.Int8 `ksql:"c"`
}
err = db.QueryOne(ctx, &row,
err := db.QueryOne(ctx, &row,
`SELECT count(*) as c
FROM users AS u
JOIN team_members AS tm
@ -40,4 +41,5 @@ The example query below also [available here][examples/pgxsupport] illustrates o
}
fmt.Printf("Count: %+v\n", row.Count.Int)
}
```