Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stillmatic
Copy link
Contributor

No description provided.

@stillmatic stillmatic marked this pull request as ready for review June 19, 2023 17:55
@stillmatic stillmatic changed the title chore: minor - doc update docs(walkthrough) Jun 19, 2023
@stillmatic stillmatic changed the title docs(walkthrough) docs(walkthrough): minor clarifications Jun 19, 2023
}
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)
Copy link
Owner

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"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants