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

fix(typegraph): prisma where fields types #975

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

luckasRanarison
Copy link
Contributor

@luckasRanarison luckasRanarison commented Feb 5, 2025

Migration notes


  • The change comes with new or modified tests
  • Hard-to-understand functions have explanatory comments
  • End-user documentation is updated to reflect the change

Summary by CodeRabbit

  • New Features

    • Enhanced filtering functionality for strings with the addition of a format field in the StringFilter, allowing for customized string type definitions.
    • Added a custom string representation for StringType variants, improving clarity in type handling.
  • Tests

    • Introduced a test suite to validate the handling of invalid queries, ensuring proper error responses for incorrect input formats.

Copy link

linear bot commented Feb 5, 2025

Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

📝 Walkthrough

Walkthrough

The changes introduce significant updates to the StringFilter struct by adding a new public field format of type StringType, which allows for specifying the string format. The generate method has been modified to utilize this new field, affecting how the type_id is constructed. Additionally, the name method now returns a formatted string based on the format field. The Where struct's generate method has also been updated to construct the StringFilter with the format. A new test file has been added to validate the Prisma engine's handling of invalid UUID strings in GraphQL queries.

Changes

File(s) Change Summary
src/.../prisma/type_generation/filters.rs Added a public format field to StringFilter and updated its generate and name methods to utilize this field.
src/.../prisma/type_generation/where_.rs Modified the generate method in Where to instantiate StringFilter with an explicit format derived from prop.prop_type, changing the handling of prop_type to use references.
tests/.../invalid_query_test.ts Introduced a new test suite for validating the Prisma engine's behavior with invalid UUID strings in GraphQL queries, expecting a 400 error and a specific error message.
src/.../prisma.rs Added a new implementation of the Display trait for the StringType enum, providing custom string representations for its variants.

Sequence Diagram(s)

sequenceDiagram
  participant WG as Where Generator
  participant SF as StringFilter
  WG->>SF: Instantiate StringFilter with prop.prop_type
  SF->>SF: Call generate() using the format
  SF->>SF: Compose name() using format value
  SF-->>WG: Return generated filter
Loading
sequenceDiagram
  participant Test as Test Suite
  participant Prisma as Prisma Engine
  participant DB as Database
  Test->>Prisma: Initialize engine with connection string
  Test->>DB: Drop existing schemas and reapply migrations
  Test->>Prisma: Send findRecord query with invalid UUID
  Prisma->>DB: Validate query input
  DB-->>Prisma: Return error for invalid UUID format
  Prisma-->>Test: Return 400 error with detailed message
Loading

Possibly related PRs

  • fix: where type issues #958: The changes in this PR enhance the StringFilter struct and its methods, which relate to the modifications in the retrieved PR that update the instantiation of StringFilter in the Where struct's generate method.

Suggested reviewers

  • Natoandro
  • michael-0acf4

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@luckasRanarison luckasRanarison force-pushed the met-751-fix-where-string-param branch from 0f71084 to 87e2527 Compare February 5, 2025 07:56
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)
tests/runtimes/prisma/invalid_query_test.ts (2)

24-26: Fix typo in error message.

The error message contains a typo: "statisfy" should be "satisfy".

-        "string does not statisfy the required format 'uuid'",
+        "string does not satisfy the required format 'uuid'",

15-28: Consider adding more test cases.

The test could be expanded to cover more edge cases for string validation:

  • Empty string
  • Special characters
  • Different UUID formats
 await t.should("validate string types in where", async () => {
+  // Test empty string
+  await gql`
+    query {
+      findRecord(where: { id: "" }) {
+        id
+      }
+    }
+  `
+    .expectStatus(400)
+    .expectErrorContains(
+      "string does not satisfy the required format 'uuid'",
+    )
+    .on(e);
+
+  // Test special characters
+  await gql`
+    query {
+      findRecord(where: { id: "!@#$%^&*()" }) {
+        id
+      }
+    }
+  `
+    .expectStatus(400)
+    .expectErrorContains(
+      "string does not satisfy the required format 'uuid'",
+    )
+    .on(e);
+
   await gql`
     query {
       findRecord(where: { id: "invaliduuid" }) {
         id
       }
     }
   `
     .expectStatus(400)
     .expectErrorContains(
       "string does not satisfy the required format 'uuid'",
     )
     .on(e);
 });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47d1005 and 0f71084.

⛔ Files ignored due to path filters (27)
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where Post.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where Record.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where User.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • src/typegate/src/engine/typecheck/input.ts (3 hunks)
  • src/typegraph/core/src/runtimes/prisma/type_generation/filters.rs (2 hunks)
  • src/typegraph/core/src/runtimes/prisma/type_generation/where_.rs (2 hunks)
  • tests/runtimes/prisma/invalid_query_test.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/typegate/src/engine/typecheck/input.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: bulid-docker (linux/arm64, custom-arm)
  • GitHub Check: test-full
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: bulid-docker (linux/amd64, custom-ubuntu-large)
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: pre-commit
🔇 Additional comments (4)
src/typegraph/core/src/runtimes/prisma/type_generation/where_.rs (1)

89-103: LGTM! Improved type safety with explicit type_id.

The changes enhance type safety by explicitly passing type_id to StringFilter. This ensures proper type validation for string fields.

src/typegraph/core/src/runtimes/prisma/type_generation/filters.rs (3)

115-117: LGTM! Enhanced StringFilter with type_id.

The addition of type_id field makes the StringFilter more flexible by allowing external type specification.


121-122: LGTM! Proper type_id usage.

The code correctly uses the struct's type_id field for type generation.


146-146: LGTM! Unique filter names.

The name method now generates unique filter names by incorporating the type_id, preventing potential naming conflicts.

@luckasRanarison
Copy link
Contributor Author

luckasRanarison commented Feb 5, 2025

Also do you guys think we should reuse other scalar types?
EDIT: I think enforcing constraints in the where input MUST be done so all scalars should match the initial types.

Natoandro
Natoandro previously approved these changes Feb 5, 2025
@luckasRanarison luckasRanarison changed the title fix: prisma where string types fix: prisma where types Feb 5, 2025
@luckasRanarison luckasRanarison changed the title fix: prisma where types fix(typegraph): prisma where fields types Feb 5, 2025
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

🧹 Nitpick comments (1)
src/typegraph/core/src/runtimes/prisma/type_generation/filters.rs (1)

153-154: Consider tracking the full text search feature.

The TODO comment indicates a missing feature for full text search that depends on a preview feature.

Would you like me to create an issue to track the implementation of the full text search feature?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87e2527 and 2f1186d.

⛔ Files ignored due to path filters (35)
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__query_where_expr__tests__Post__QueryWhereExpr.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__query_where_expr__tests__User__QueryWhereExpr.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_one Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_one User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where Post.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where Record.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where User.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • src/typegraph/core/src/runtimes/prisma/type_generation/filters.rs (5 hunks)
  • src/typegraph/core/src/runtimes/prisma/type_generation/where_.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/typegraph/core/src/runtimes/prisma/type_generation/where_.rs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: test-full
  • GitHub Check: pre-commit
🔇 Additional comments (3)
src/typegraph/core/src/runtimes/prisma/type_generation/filters.rs (3)

68-77: LGTM! Well-structured constructor.

The from_type constructor provides a clean way to create filters from number types, with clear type mapping.


133-135: LGTM! Clean struct definition.

The struct is well-focused with a single responsibility.


355-358: LGTM! Proper use of new constructor.

The function correctly uses the new from_type constructor and maintains proper error handling.

@luckasRanarison
Copy link
Contributor Author

Oh, looking at the diff I think I did something wrong

Natoandro
Natoandro previously approved these changes Feb 6, 2025
Copy link
Contributor

@Natoandro Natoandro left a comment

Choose a reason for hiding this comment

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

Nice catch!

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 (1)
src/typegraph/schema/src/runtimes/prisma.rs (1)

77-79: Add tests for string type representations.

Since StringType is used in ScalarType::String and its string representation is crucial for schema generation, consider adding tests to verify the correct string output for each variant.

Would you like me to help generate test cases for the Display implementation? Here's an example of what could be added:

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_string_type_display() {
        assert_eq!(StringType::Plain.to_string(), "string");
        assert_eq!(StringType::Uuid.to_string(), "uuid");
        assert_eq!(StringType::DateTime.to_string(), "date-time");
    }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f1186d and 3e1b0ee.

⛔ Files ignored due to path filters (27)
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Post out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by Record out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__group_by User out.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_many User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one Post inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one Record inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__update_one User inp.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where Post.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where Record.snap is excluded by !**/*.snap
  • src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where User.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • src/typegraph/core/src/runtimes/prisma/type_generation/filters.rs (3 hunks)
  • src/typegraph/core/src/runtimes/prisma/type_generation/where_.rs (2 hunks)
  • src/typegraph/schema/src/runtimes/prisma.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/typegraph/core/src/runtimes/prisma/type_generation/where_.rs
  • src/typegraph/core/src/runtimes/prisma/type_generation/filters.rs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: test-full
  • GitHub Check: pre-commit
🔇 Additional comments (1)
src/typegraph/schema/src/runtimes/prisma.rs (1)

60-68: Add documentation for the Display implementation.

The implementation looks good and follows best practices. Consider adding documentation to explain the purpose and usage of these string representations.

Add documentation above the implementation:

+/// Implements Display for StringType to provide string representations
+/// that align with Prisma's type format specifications.
+/// - Plain -> "string"
+/// - Uuid -> "uuid"
+/// - DateTime -> "date-time"
 impl std::fmt::Display for StringType {

Let's verify that these string representations align with Prisma's expectations:

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