-
Notifications
You must be signed in to change notification settings - Fork 856
feat: DC-5298 migrate "date-types" #7181
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
Conversation
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
WalkthroughAdds a new MDX documentation page on PostgreSQL DATE types under the Dataguide section and updates the spellchecker configuration to include “Dataguide” in ignored words. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
Comment |
Deploying docs with
|
| Latest commit: |
954303b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9d33f799.docs-51g.pages.dev |
| Branch Preview URL: | https://feat-dc-5298-dataguide-migra.docs-51g.pages.dev |
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.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/300-date-types.mdx(1 hunks)content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/index.mdx(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Documentation Checks
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/index.mdx
[error] 2-2: cspell: Unknown word 'Dataguide'. Command: cspell --config ./cSpell.json "content/**/*.mdx" --no-progress
[error] 3-3: cspell: Unknown word 'Dataguide'. Command: cspell --config ./cSpell.json "content/**/*.mdx" --no-progress
[error] 14-14: cspell: Unknown word 'Dataguide'. Command: cspell --config ./cSpell.json "content/**/*.mdx" --no-progress
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: runner / linkspector
- GitHub Check: Check internal links
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx
Show resolved
Hide resolved
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx
Show resolved
Hide resolved
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/index.mdx
Show resolved
Hide resolved
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/theme/DocCard/styles.module.scss (1)
44-46: Themax-width: 100%rule is redundant.Block-level elements like
<p>already havemax-width: 100%by default. This rule has no effect unless you plan to change the display property or add additional constraints in the future.Consider removing it unless it serves as an explicit declaration for future modifications:
- -.cardDescription { - max-width: 100%; -}src/theme/DocCard/index.tsx (1)
74-74: Consider externalizing the hardcoded Dataguide description.Hardcoding a special case for "Dataguide" directly in the component creates tight coupling and doesn't scale if more categories need custom descriptions.
Consider one of these approaches:
- Add the description directly in the sidebar configuration where the Dataguide category is defined
- Create a configuration object mapping labels to descriptions
- Use frontmatter metadata in the index page
Example of approach #2:
const CATEGORY_DESCRIPTIONS: Record<string, string> = { Dataguide: "Learn how databases work, how to choose the right one, and how to use databases with your applications to their full potential." }; function CardCategory({ item }: { item: PropSidebarItemCategory }): JSX.Element | null { const href = findFirstSidebarItemLink(item); if (!href) { return null; } const description = item.description ?? CATEGORY_DESCRIPTIONS[item.label] ?? ""; return <CardLayout href={href} icon="🗃️" title={item.label} description={description} />; }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/theme/DocCard/index.tsx(1 hunks)src/theme/DocCard/styles.module.scss(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: runner / linkspector
- GitHub Check: Check internal links
fd08582 to
9a71334
Compare
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.
Actionable comments posted: 3
♻️ Duplicate comments (2)
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx (2)
175-181: Drop the stray comma in the AGE() example.The trailing comma before FROM breaks the query.
- AGE('2000-01-01', published_date), + AGE('2000-01-01', published_date)
300-303: Correct the DATE_TRUNC syntax.Missing comma and source argument; as written it’s invalid.
-DATE_TRUNC('datepart' field); +DATE_TRUNC('datepart', source_expression);You already provide a valid concrete example below; keeping this syntax block correct prevents copy/paste errors.
🧹 Nitpick comments (1)
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx (1)
9-10: Fix possessive: "people's ages".Small grammar tweak for clarity.
-The ability to store date values inside of your database allows you to add a time element to your queries and analysis of your data. It is important to know how to work with date types in your respective database so that you can be accurate in your reporting whether it's order information, peoples' ages, or any other use case. +The ability to store date values inside of your database allows you to add a time element to your queries and analysis of your data. It is important to know how to work with date types in your respective database so that you can be accurate in your reporting whether it's order information, people's ages, or any other use case.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
cSpell.json(1 hunks)content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx(1 hunks)content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/index.mdx(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/index.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
- cSpell.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Check internal links
- GitHub Check: runner / linkspector
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx
Show resolved
Hide resolved
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx
Show resolved
Hide resolved
9a71334 to
954303b
Compare
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.
Actionable comments posted: 1
♻️ Duplicate comments (4)
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx (4)
175-179: Remove the trailing comma in the AGE() example.There’s still a trailing comma after
AGE('2000-01-01', published_date)so the query is invalid. Please drop it.Apply this diff:
- AGE('2000-01-01', published_date), + AGE('2000-01-01', published_date)
236-242: Fix DATE_PART description and syntax.Line 236 still says “subquery” and omits the quotes around the field argument, so readers copy incorrect SQL. Please use the accurate wording and syntax.
Apply this diff:
-The `DATE_PART()` function in PostgreSQL is used to subquery for subfields from a date or time value. +The `DATE_PART()` function in PostgreSQL extracts subfields from a date or time value. @@ -SELECT DATE_PART(field, source); +SELECT DATE_PART('field', source);
300-303: Correct DATE_TRUNC syntax (missing comma).
DATE_TRUNC('datepart' field);still omits the comma, so anyone copying it will get a syntax error. Please include the comma and source expression placeholder.Apply this diff:
-DATE_TRUNC('datepart' field); +DATE_TRUNC('datepart', source);
72-79: Use PostgreSQL terminology (TIMESTAMP, not DATETIME).Line 72 still refers to
DATETIME, which PostgreSQL doesn’t have. This misleads readers copying the example. Please switch the wording to cast fromTIMESTAMPtoDATE.Apply this diff:
-If the time is not of interest, you can also specify to only return the date with double colons `::` to cast a `DATETIME` value to the `DATE` value: +If the time is not of interest, you can cast the timestamp to a date using double colons `::`:
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
cSpell.json(1 hunks)content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx
[style] ~9-~9: This phrase is redundant. Consider using “inside”.
Context: ...ction The ability to store date values inside of your database allows you to add a time ...
(OUTSIDE_OF)
[style] ~57-~57: As a shorter alternative for ‘able to’, consider using “can then”.
Context: ...s of the DATE type in PostgreSQL, you are then able to use functions working with the informat...
(BE_ABLE_TO)
[style] ~57-~57: ‘off of’ might be wordy. Consider a shorter alternative.
Context: ... through some common functions building off of the table introduced in the prior secti...
(EN_WORDINESS_PREMIUM_OFF_OF)
[grammar] ~100-~100: There might be a mistake here.
Context: ...meters: 1. the value you want to format 2. the template that defines the output for...
(QB_NEW_EN)
[grammar] ~127-~127: There might be a mistake here.
Context: ...e things like the tenure of an employee or time since the publishing of a book. I...
(QB_NEW_EN)
[style] ~172-~172: As a shorter alternative for ‘able to’, consider using “can also”.
Context: ...ent date to subtract and calculate. You are also able to pass two dates into the function to cal...
(BE_ABLE_TO)
[style] ~218-~218: To make your writing concise, consider an alternative.
Context: ... row) ``` This is a useful function to be aware of when you may only need a portion of a d...
(AWARE_OF)
[style] ~222-~222: This phrase is redundant. Consider using “inside”.
Context: ...s important to know how date data works inside of your database. Having a grasp on the wa...
(OUTSIDE_OF)
[grammar] ~276-~276: There might be a mistake here.
Context: ...nth, or day from a date type as well as specify quarter. The basic syntax looks as fol...
(QB_NEW_EN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: runner / linkspector
- GitHub Check: Check internal links
Fixes #DC-5298
Summary by CodeRabbit
Documentation
Chores