-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(walkthrough): minor clarifications #884
base: main
Are you sure you want to change the base?
Conversation
} | ||
err := client.Prisma.QueryRaw("SELECT post_id, count(*) as comments FROM `Comment` GROUP BY post_id").Exec(ctx, &res) | ||
err := client.Prisma.QueryRaw("SELECT post_id, count(*) as n_comments FROM `Comment` GROUP BY post_id").Exec(ctx, &res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe comments_count
?
@@ -109,7 +112,7 @@ To ensure compatibility with database and go types, you can use raw types. | |||
// note the usage of db.RawString, db.RawInt, etc. | |||
var res []struct{ | |||
ID db.RawString `json:"post_id"` | |||
Published db.RawBoolean `json:"published"` | |||
Comments db.RawInt `json:"comments"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments db.RawInt `json:"comments"` | |
Published db.RawBoolean `json:"published"` |
``` | ||
|
||
Note that the query uses `db.RawString` etc in the struct definition to maintain compatibility. Note also that the results are an array of structs, not a struct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this, would need a mention in the postgres part as well. Maybe I need to refactor this page with some mdx components to have a language switcher in the docs as it's a lot of duplicatoin here, but haven't gotten the chance
No description provided.