Skip to content

feat(nosql): add record creation - #208

Open
thomhurst wants to merge 2 commits into
floci-io:mainfrom
thomhurst:feat/207-database-add-record
Open

feat(nosql): add record creation#208
thomhurst wants to merge 2 commits into
floci-io:mainfrom
thomhurst:feat/207-database-add-record

Conversation

@thomhurst

@thomhurst thomhurst commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add shared JSON Add record modal for DynamoDB and Cosmos DB NoSQL
  • add generic NoSQL item creation route and DynamoDB PutItem adapter support
  • validate DynamoDB S, N, and B keys while preserving large numeric keys
  • keep Cosmos document editor focused on updates and prefill required create fields

Testing

  • pnpm lint
  • pnpm type-check
  • pnpm build
  • focused API tests: 57 passed
  • pnpm test: 728 passed; 1 pre-existing Windows-only ZIP test failure from CRLF parsing of unzip -Z1 output

Closes #207

image image

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds shared JSON-based record creation for DynamoDB and Cosmos DB, with a generic NoSQL creation API and DynamoDB key-aware marshalling.

  • Adds the NoSQL item creation route, client method, and adapter contract.
  • Implements DynamoDB PutItem support with validation for string, numeric, and binary keys.
  • Adds a reusable record modal and integrates it into the DynamoDB and Cosmos DB explorers.
  • Rejects unquoted unsafe integer keys before DynamoDB marshalling while preserving quoted large numeric keys.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported unsafe numeric key rounding is prevented before marshalling, while quoted large numeric keys retain their exact value.

Important Files Changed

Filename Overview
packages/api/src/adapter-aws/AwsDynamoDbAdapter.ts Adds key-schema-aware DynamoDB item creation and resolves the previously reported large numeric key precision issue.
packages/api/src/routes/clouds.ts Adds the generic HTTP endpoint that dispatches NoSQL item creation through CloudProxyService.
packages/api/src/service/CloudProxyService.ts Adds provider-neutral dispatch and unsupported-operation handling for NoSQL item creation.
packages/frontend/src/components/JsonRecordModal.tsx Adds the shared JSON-object record creation dialog with parsing, pending-state, and error handling.
packages/frontend/src/components/DynamoDbTableExplorer.tsx Integrates DynamoDB record creation with schema-derived key templates and query invalidation.
packages/frontend/src/components/CosmosNoSqlPanel.tsx Moves Cosmos creation into the shared modal and prefills the document ID and partition-key structure.

Sequence Diagram

sequenceDiagram
    actor User
    participant Modal as JSON Record Modal
    participant Client as Cloud Proxy Client
    participant Route as NoSQL Items Route
    participant Service as CloudProxyService
    participant Adapter as Provider Adapter
    participant Store as DynamoDB or Cosmos DB
    User->>Modal: Enter JSON record
    Modal->>Modal: Parse and validate JSON object
    Modal->>Client: Submit document
    Client->>Route: POST /clouds/:cloud/services/nosql/resources/:id/items
    Route->>Service: putNoSqlItem(cloud, resourceId, document)
    Service->>Adapter: putNoSqlItem(resourceId, document)
    Adapter->>Store: Create or upsert item
    Store-->>Adapter: Stored item
    Adapter-->>Modal: Normalized NoSqlItem
    Modal-->>User: Close and refresh selection
Loading

Reviews (2): Last reviewed commit: "fix(dynamodb): reject unsafe numeric key..." | Re-trigger Greptile

Comment thread packages/api/src/adapter-aws/AwsDynamoDbAdapter.ts
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.

Add record insertion modal for NoSQL databases

1 participant