Skip to content

Conversation

@dannyroosevelt
Copy link
Collaborator

@dannyroosevelt dannyroosevelt commented Jun 5, 2025

WHY

Summary by CodeRabbit

  • New Features
    • Added support for a new "SQL" property type in the control component, allowing users to input and configure SQL queries via a dedicated, styled textarea.
    • Introduced a new SQL control component for SQL query input, now available for use and customization.
  • Enhancements
    • Expanded customization options to include the new SQL control.
    • Updated public exports to include the new SQL control component.

@vercel
Copy link

vercel bot commented Jun 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jun 5, 2025 9:22pm
pipedream-docs ⬜️ Ignored (Inspect) Jun 5, 2025 9:22pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 5, 2025 9:22pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

Walkthrough

The changes introduce a new "sql" property type to the configurable properties system. This includes a new ControlSql React component for SQL input, updates to type definitions to support the new type, integration into the control rendering logic, extension of customization hooks, and public API export of the new component.

Changes

File(s) Change Summary
packages/connect-react/src/components/Control.tsx Added support for "sql" property type, rendering ControlSql for such props.
packages/connect-react/src/components/ControlSql.tsx Introduced new ControlSql React component for SQL query input and handling.
packages/connect-react/src/hooks/customization-context.tsx Extended CustomizableProps type with controlSql property for customization context.
packages/connect-react/src/index.ts Exported ControlSql component in the package's public API.
packages/sdk/src/shared/component.ts Removed commented-out "sql" type mention; no functional changes to types.
packages/connect-react/CHANGELOG.md Added changelog entry for version 1.2.0 documenting 'sql' prop type support.
packages/connect-react/package.json Updated version to 1.2.0.
packages/sdk/CHANGELOG.md Added changelog entry for version 1.6.6 documenting 'sql' prop type support in connect-react.
packages/sdk/package.json Updated version to 1.6.6.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Control
    participant ControlSql
    participant FormContext

    User->>Control: Render with prop.type = "sql"
    Control->>ControlSql: Render ControlSql
    ControlSql->>FormContext: Access form field and context
    User->>ControlSql: Enter SQL query in textarea
    ControlSql->>FormContext: onChange({ app, query, params })
Loading

Poem

In the garden of code, a new seed we sow,
A SQL control blooms, letting queries flow.
Type guards expanded, the context anew,
Now rabbits can query, as clever ones do!
With forms and with fields, our features grow bright,
Hippity-hop, SQL’s now in sight! 🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e59110d and 6d40539.

📒 Files selected for processing (1)
  • packages/sdk/src/shared/component.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/sdk/src/shared/component.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: test
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 27ae00a and 9e6006c.

📒 Files selected for processing (5)
  • packages/connect-react/src/components/Control.tsx (2 hunks)
  • packages/connect-react/src/components/ControlSql.tsx (1 hunks)
  • packages/connect-react/src/hooks/customization-context.tsx (2 hunks)
  • packages/connect-react/src/index.ts (1 hunks)
  • packages/sdk/src/shared/component.ts (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/connect-react/src/components/Control.tsx (2)
packages/connect-react/src/components/ControlSql.tsx (1)
  • ControlSql (6-64)
packages/connect-react/src/index.ts (1)
  • ControlSql (11-11)
packages/connect-react/src/components/ControlSql.tsx (3)
packages/connect-react/src/index.ts (1)
  • ControlSql (11-11)
packages/connect-react/src/hooks/form-context.tsx (1)
  • useFormContext (55-64)
packages/connect-react/src/hooks/customization-context.tsx (1)
  • useCustomize (207-278)
🔇 Additional comments (12)
packages/sdk/src/shared/component.ts (3)

89-91: LGTM! SQL property type follows established patterns.

The ConfigurablePropSql type definition is consistent with other configurable property types, properly extending BaseConfigurableProp and using Defaultable<string> for default value support.


106-106: LGTM! Properly integrated into the union type.

The addition of ConfigurablePropSql to the ConfigurableProp union type maintains consistency with the existing type system.


127-128: LGTM! Structured value mapping is appropriate for SQL queries.

The PropValue mapping for "sql" type to { app: string; query: string; params: any[]; } provides a structured approach that can include metadata about the target database app and parameterized queries, which is well-suited for SQL query management.

packages/connect-react/src/index.ts (1)

11-11: LGTM! Export follows established patterns.

The ControlSql export is properly placed alphabetically among other control exports and follows the same pattern as existing components.

packages/connect-react/src/components/Control.tsx (2)

14-14: LGTM! Import follows established patterns.

The import of ControlSql is consistent with other control component imports and maintains alphabetical ordering.


86-87: LGTM! Switch case integration is consistent.

The addition of the "sql" case to the switch statement follows the same pattern as other control types, simply returning the appropriate component instance.

packages/connect-react/src/hooks/customization-context.tsx (2)

32-32: LGTM! Import maintains alphabetical ordering.

The import of ControlSql is properly placed in alphabetical order among other control component imports.


77-77: LGTM! Customization type integration is consistent.

The addition of controlSql to CustomizableProps follows the exact same pattern as other controls, properly combining ComponentProps<typeof ControlSql> with FormFieldContext<ConfigurableProp> to enable full customization support.

packages/connect-react/src/components/ControlSql.tsx (4)

1-6: LGTM! Clean component structure.

The imports and component definition follow React best practices. The component appropriately uses context hooks rather than props for configuration.


27-35: LGTM! Well-structured change handler.

The change handler correctly transforms the query string into the expected structured SQL object format. The comment about empty params array is helpful for future maintenance.


37-51: Excellent SQL-specific styling choices.

The base styles are well-thought-out for SQL input:

  • Monospace font for better code readability
  • Appropriate minimum height and vertical resize capability
  • Good use of theme values for consistency

53-63: LGTM! Proper textarea implementation with accessibility.

The textarea element includes all necessary attributes for accessibility and form integration:

  • id and name for proper form association
  • required based on prop optionality
  • Appropriate placeholder text
  • Proper integration with customization system

dannyroosevelt and others added 5 commits June 5, 2025 11:27
Remove SQL prop type definitions from SDK to separate
into standalone PR, keeping only connect-react component changes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@dannyroosevelt dannyroosevelt changed the title Danny/connect react/sql Adding support for the sql prop type in connect-react Jun 5, 2025
@dannyroosevelt dannyroosevelt merged commit ff5e01a into master Jun 5, 2025
8 checks passed
@dannyroosevelt dannyroosevelt deleted the danny/connect-react/sql branch June 5, 2025 21:33
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.

1 participant