diff --git a/PGX-Support.md b/PGX-Support.md index 72963df..ddbff17 100644 --- a/PGX-Support.md +++ b/PGX-Support.md @@ -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) +} ``` \ No newline at end of file