Skip to content

feat(tools): added rds, dynamodb, background color gradient - #2150

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/rds
Dec 1, 2025
Merged

feat(tools): added rds, dynamodb, background color gradient#2150
waleedlatif1 merged 3 commits into
stagingfrom
feat/rds

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • added rds, dynamodb, background color gradient

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Dec 1, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentPreviewCommentsUpdated (UTC)
docsReadyReadyPreviewCommentDec 1, 2025 9:40pm

@greptile-apps

greptile-appsBot commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR adds comprehensive Amazon RDS and DynamoDB integration to Sim, enabling database operations directly within workflows. The implementation includes secure parameterized queries, proper credential handling, and a minor UI enhancement for gradient support.

Key Changes

  • RDS Integration: Full CRUD operations (query, insert, update, delete, execute) with SQL injection prevention via parameterized queries and identifier sanitization
  • DynamoDB Integration: Complete DynamoDB operations (get, put, query, scan, update, delete) using AWS SDK Document Client
  • Security: Both integrations properly use user-only visibility for AWS credentials and implement secure query building
  • UI Enhancement: Changed backgroundColor to background CSS property in workflow and note blocks to support linear gradient backgrounds
  • Documentation: Added comprehensive MDX documentation for both tools with usage examples

Implementation Quality

The SQL injection concerns from previous review threads have been resolved. The RDS implementation now uses:

  • Parameterized queries with SqlParameter[] for all user-provided values
  • Identifier sanitization with regex validation for table/column names
  • Proper separation of structure (identifiers) and data (parameters)

The DynamoDB implementation follows AWS best practices using the Document Client with proper marshalling options.

Confidence Score: 5/5

  • This PR is safe to merge with no critical issues found
  • The implementation demonstrates excellent security practices with parameterized queries, proper input validation, correct credential visibility settings, and comprehensive error handling. The background gradient change is a simple, safe CSS property update. All previous SQL injection concerns have been addressed.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/api/tools/rds/utils.ts5/5Implements parameterized queries for RDS operations (INSERT, UPDATE, DELETE), properly sanitizing identifiers and using SQL parameters to prevent injection
apps/sim/app/api/tools/dynamodb/utils.ts5/5Implements DynamoDB operations using AWS SDK's Document Client with proper marshalling/unmarshalling options
apps/sim/blocks/blocks/rds.ts5/5Defines RDS block config with multi-operation support (query, insert, update, delete, execute) and proper JSON parsing in params transform
apps/sim/blocks/blocks/dynamodb.ts5/5Defines DynamoDB block config with comprehensive operation support (get, put, query, scan, update, delete) and proper JSON parsing
apps/sim/tools/rds/query.ts5/5RDS query tool definition with correct user-only visibility for AWS credentials per custom instruction requirements
apps/sim/tools/dynamodb/get.ts5/5DynamoDB get tool definition with correct user-only visibility for AWS credentials
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx5/5Changed backgroundColor to background CSS property to support gradient values in block icon styling
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/note-block/note-block.tsx5/5Changed backgroundColor to background CSS property to support gradient values in note block icon styling

Sequence Diagram

sequenceDiagram
participant User
participant WorkflowBlock
participant BlockConfig
participant APIRoute
participant Utils
participant AWS
User->>WorkflowBlock: Configure RDS/DynamoDB block
WorkflowBlock->>BlockConfig: Load block definition
BlockConfig-->>WorkflowBlock: Return subBlocks & tools config
User->>WorkflowBlock: Select operation & provide credentials
WorkflowBlock->>WorkflowBlock: Validate inputs
User->>WorkflowBlock: Execute workflow
WorkflowBlock->>BlockConfig: Transform params (parse JSON)
BlockConfig->>BlockConfig: Select appropriate tool based on operation
BlockConfig->>APIRoute: POST to /api/tools/{rds|dynamodb}/{operation}
APIRoute->>APIRoute: Validate request with Zod schema
APIRoute->>Utils: Create AWS client with credentials
Utils-->>APIRoute: Return configured client
alt RDS Operation
APIRoute->>Utils: Call executeInsert/Update/Delete/Statement
Utils->>Utils: Sanitize identifiers
Utils->>Utils: Build parameterized query with SqlParameter[]
Utils->>AWS: Send ExecuteStatementCommand to RDS Data API
AWS-->>Utils: Return query results
Utils->>Utils: Parse RDS response (rows + metadata)
else DynamoDB Operation
APIRoute->>Utils: Call getItem/putItem/queryItems/etc
Utils->>AWS: Send DynamoDB command via DocumentClient
AWS-->>Utils: Return operation results
Utils->>Utils: Unmarshall response data
end
Utils-->>APIRoute: Return formatted results
APIRoute->>APIRoute: Destroy client
APIRoute-->>WorkflowBlock: Return JSON response
WorkflowBlock-->>User: Display results (rows/items/count)
Loading

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

51 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment threadapps/sim/app/api/tools/rds/utils.ts Outdated
Comment threadapps/sim/app/api/tools/rds/utils.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

51 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
waleedlatif1 merged commit cb0c55c into stagingDec 1, 2025
9 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/rds branch December 1, 2025 21:42
@waleedlatif1waleedlatif1 mentioned this pull request Dec 1, 2025
10 tasks
Sign up for freeto 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

@waleedlatif1