feat(plugin-dynamodb): rewrite the DynamoDB driver with index-aware reads, typed edits and table management - #3077
Merged
Merged
Conversation
…eads, typed edits and table management
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
…rewrite # Conflicts: # CHANGELOG.md # TablePro/Core/Plugins/PluginManager.swift # TablePro/Resources/Localizable.xcstrings # TablePro/Views/Structure/CreateTableView.swift
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A rewrite of the DynamoDB driver. The old one read every table with a Scan, typed every edit as a String, dropped attributes it had not seen on the first page and paged by re-reading everything before the page. This one plans each read, keeps types, and adds table management.
Reading
URL.linesgoes through Foundation's single serialAsyncBytesqueue, which the Copilot LSP reader holds in a blocking pipe read, and exports hung behind it.Select: COUNT; the automatic full count is off for DynamoDB (exactRowCountIsBilledScan), and a failed count now shows its error on the tab and clears it on the next success.Editing
?, typed when it runs from the key schema and a consistent GetItem of the current item, so a Number stays a Number and a String Set stays a set.Editor
<Action> {request JSON}. BatchWriteItem resends unprocessed items and reports what is left after 10 attempts; BatchExecuteStatement reports per-statement failures.CancellationError, so the app reads it as a stop.Tables
CreateTablerequest. This is a new PluginKit hook pair,createTableFormSpec(schema:)andcreateTableStatements(for:schema:), with defaults that keep the column grid.UpdateTable, key types completed from the table and its items, refused rather than guessed when unknown). Editing an index in place and dropping the primary key or a local index are refused up front through two newPluginSchemaOperationcases,modifyIndexanddropIndex. Before this, an edit was saved as drop then add, and DynamoDB cannot create an index while the old one is still deleting, so the index was lost.CreateTablerequest plus TTL and PITR.Connections
evil.example#from an imported connection used to move every signed request, session token included, to another host. Plain HTTP is allowed only for a loopback custom endpoint, and redirects are refused.Statement gates
DynamoDB requests are classified per action and body for Safe Mode, MCP and the AI assistant: reads are safe, writes are writes, and requests that take data or a safeguard away (DeleteTable, dropping an index or replica, deletion protection or PITR off, enabling TTL, deleting items in a batch or transaction) are destructive. A body the classifier cannot read, or an action it does not know, is treated as the worst case. Its JSON depth limit matches the driver's, and a test keeps the two action lists equal.
PluginKit ABI
scripts/check-pluginkit-abi.shagainst the merge base reports 99 added lines and none removed: two protocol requirements with defaults, new public form types, and two cases on the non-frozenPluginSchemaOperation. Kit 33 is still unreleased (v0.75.0 shipped 32), so it covers this; every pluginInfo.plistis already 33 and the minimum is unchanged.Testing
AsyncBytes; it was confirmed red against the old code.AllPlugins, strict SwiftLint on every changed file, and the docs checks pass.DynamoDBLocalIntegrationTests(withscripts/dynamodb-test-local.sh) did not run: Docker on the build machine was unresponsive. They skip themselves when nothing answers on 127.0.0.1:18000, so CI is unaffected, but nothing in this PR was exercised against a real DynamoDB after the final round of changes.Review
The Codex review did not complete (it ran out of quota mid-run). A security review and a code review from separate agents read the diff; every finding was fixed except one, noted below.
Screenshots
Not captured. The plugin needs a DynamoDB endpoint and Docker was unavailable, so
docs/images/dynamodb-create-table*.pngare 1560x960 placeholders that need a real capture, anddynamodb-connection-form*.pngshould be re-captured to show the new auth method.Known limitations and follow-ups
ConsistentRead.LSPTransportandMCPStdioMessageTransportread their pipes withFileHandle.bytes, which shares that one serial queue, so they can block each other and any otherAsyncBytesreader in the app.