feat(plugins): native delete and export for the engines with no SQL - #2899
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
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.
Follows #2896, which stopped the app inventing
DROP TABLEfor engines that have no SQL. That change was the root-cause half: once the app stopped guessing, four gaps it had been papering over became visible. This closes all four.Elasticsearch and Weaviate export
ExportDataSourceAdapterasks the driver fordefaultExportQueryand, on nil, buildsSELECT * FROM "<object>". Elasticsearch and Weaviate implement neither that hook norstreamRows, so Export sent them a statement they have no parser for and the file came out empty.Both now answer with an export tag their own
streamRowsdecodes and pages:search_after, so an export is not capped at the 10,000-documentmax_result_window. The point-in-time also pins the index for the whole run, so a document written while it streams cannot shift the sort and be exported twice or skipped.GET /v1/objectsby offset.A tag rather than a query with a large
size, because the protocol's defaultstreamRowsrunsexecuteonce and buffers the whole result. That is fine for a grid page and not for an index.Kafka topic delete
Kafka had no
dropObjectStatement, so after #2896 a topic could not be deleted at all. It now answersDROP TOPIC <name>, which is also a KafkaQL verb, and the driver issues DeleteTopics.That needed more than a statement.
KafkaApiKeyhad no DeleteTopics case (API key 20) at all;KafkaClusterparsedcontrollerIdonly to print "yes" in the cluster view and had no way to reach the controller, which is the only broker that accepts the request; andKafkaErrorCodehad neitherNOT_CONTROLLERnorTOPIC_DELETION_DISABLED. All three are added. Capped at v5 deliberately: v6 addresses topics by UUID instead of by name, the same lineKafkaApiKeyalready draws for Fetch and Metadata.DROP TABLEstays a Kafka syntax error. A topic is not a table, and that text is exactly what the app used to invent for engines with no SQL, so accepting it would make the mistake look supported.Truncate is not offered. Kafka removes records by retention or by an offset per partition, neither of which empties a topic the way Truncate means.
DynamoDB table delete
PartiQL has no DDL, so the driver returned nil and the table could not be deleted. It now answers
DROP TABLE "<name>"andexecuteroutes that to theDeleteTableAPI. The spelling is deliberate: the confirmation shows the statement verbatim, and the generic classifier tiers a leadingDROPas destructive without needing a DynamoDB arm. The cached table description is dropped with it, or a table recreated under the same name would be read through the old key schema.Truncate stays unoffered: emptying a DynamoDB table means scanning it and deleting every item, which is a long billed job rather than a statement.
iOS
TableProMobile/Views/TableListView.swiftbuiltTRUNCATE TABLEandDROP TABLEin the view for every engine, gated only on the object being a view and on Safe Mode. On Redis the rows are keys, so a long-press offered Drop Table and sentDROP TABLE "session:42", which the driver tokenised as an unknown Redis command.The policy moved to
TableProConnectionLibrary, keyed by the raw database type id, and both apps read it. That target is one of five the two apps already link, and it carries no plugin ABI, so this needs nocurrentPluginKitVersionbump. A string key rather than aDatabaseTypebecause the two apps do not share that type: the Mac app has its own and iOS hasTableProCoreTypes.DatabaseType, and their constant lists have already drifted (36 versus 33, withElasticsearch,PGliteandTypesensemissing from the shared one).Tests
KafkaIntegrationTestsgains two cases that drop a topic through the driver against a real Apache Kafka broker and wait for it to leave the cluster listing. Hand-written wire protocol is only worth trusting against a real broker, andscripts/kafka-test-broker.shprovides one.KafkaQLTestscoversDROP TOPICand keepsDROP TABLEas a syntax error.DynamoDBOperationsTestsround-trips every generated drop back to its table name, refuses names DynamoDB could not have, and asserts the statement classifies destructive.SQLDDLFallbackPolicyTestson iOS asserts Redis is the only engine iOS ships without SQL DDL, walkingIOSDriverFactory.supportedTypes()so a new non-SQL driver fails it.Verified
Build PASS. 278 cases across 17 suites PASS, including 28 Kafka integration cases against a live broker. Elasticsearch, Weaviate, DynamoDB and Kafka plugin schemes each build.
swiftlint --strictintroduces no new violation in any changed file, checked by comparing each file against its state at HEAD.The iOS app does not build in this checkout, for a pre-existing reason: the vendored
oracle-niofails with a@TaskLocalmacro error. No Oracle file is in this change, and no error names a file it touches.Not in this change
ExportDataSourceAdapteralso fabricates a scopedSELECTfor a row-range export, on a path that never consultsdefaultExportQuery. Gating that one needs a scope-aware driver hook.SQLExportPluginwritesDROP IF EXISTSfor every engine, which needs an export-format flag rather than the DDL policy.SELECT * FROM topicis accepted as CONSUME sugar and exports only the newest 100 messages with no warning. Bounding it honestly is a product decision about what exporting a live topic should mean.SQLBuilder, the query editor's SELECT template andDataBrowserViewModelbuild literal SQL for every engine, so Redis row browsing there is broken beyond these two menu items.