Skip to content

Conversation

@carlagn
Copy link
Contributor

@carlagn carlagn commented Oct 14, 2025

Fixes #DC-5298

Summary by CodeRabbit

  • Documentation

    • Added “Working with dates in PostgreSQL” guide covering DATE type basics, defaults, inserts/queries, key functions (NOW, CURRENT_DATE, casting), formatting with TO_CHAR, interval calculations and AGE, EXTRACT/DATE_PART/to_date/DATE_TRUNC usage, FAQs, and practical examples.
  • Chores

    • Updated spell-check dictionary to recognize “Dataguide.”

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
Docs — Dataguide: Date types
content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/03-date-types.mdx
Adds a new MDX guide on PostgreSQL DATE types, covering storage, defaults, inserts/queries, functions (NOW, CURRENT_DATE, CAST), formatting (TO_CHAR), intervals/AGE, EXTRACT/DATE_PART/DATE_TRUNC, FAQs, and examples.
Tooling — Spellcheck config
cSpell.json
Adds "Dataguide" to ignoreWords list (retains existing entries).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly identifies the Jira ticket and the primary change of migrating the “date-types” documentation, directly reflecting the PR’s scope of adding and updating the PostgreSQL date types guide in the docs.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 14, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2b7c440 and b2ccb2d.

📒 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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: The max-width: 100% rule is redundant.

Block-level elements like <p> already have max-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:

  1. Add the description directly in the sidebar configuration where the Dataguide category is defined
  2. Create a configuration object mapping labels to descriptions
  3. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ad8dab and fd08582.

📒 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

@carlagn carlagn force-pushed the feat/DC-5298-dataguide-migration-3 branch from fd08582 to 9a71334 Compare October 14, 2025 10:44
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between fd08582 and 9a71334.

📒 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

@carlagn carlagn force-pushed the feat/DC-5298-dataguide-migration-3 branch from 9a71334 to 954303b Compare October 15, 2025 08:01
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 from TIMESTAMP to DATE.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9a71334 and 954303b.

📒 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

@carlagn carlagn merged commit 5830bb9 into main Oct 15, 2025
8 checks passed
@carlagn carlagn deleted the feat/DC-5298-dataguide-migration-3 branch October 15, 2025 08:13
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.

3 participants