feat(plugin-teradata): add Teradata Vantage support#1888
Conversation
…ing frame from deadlocking
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dec820bc0d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var frame: [UInt8] = [0x80 | opcode.rawValue] | ||
| let length = payload.count | ||
| if length < 126 { | ||
| frame.append(UInt8(length)) |
There was a problem hiding this comment.
Mask client WebSocket frames before sending
When SSL mode is enabled, TeradataTLSTransport.send wraps every LAN message with WebSocketFrame.encodeBinary. This encoder writes an unmasked frame (no MASK bit and no 4-byte masking key); RFC 6455 servers are required to close unmasked client-to-server frames, so TLS/HTTPS Teradata connections can complete the HTTP upgrade and then fail on the first protocol message. Please set the mask bit and mask payloads for client frames.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| func executeUserQuery(query: String, rowCap: Int?, parameters: [PluginCellValue]?) async throws -> PluginQueryResult { | ||
| try await execute(query: query) |
There was a problem hiding this comment.
Preserve row caps and parameters in user queries
When the app forwards a parameterized or auto-limited user query, this override discards both rowCap and parameters and sends the raw SQL. For queries where limit injection is not possible (or parameterized queries with ? placeholders), Teradata will either fetch every row without setting isTruncated or send literal placeholders instead of binding values; delegate to executeParameterized when parameters are present and trim/set isTruncated for rowCap like the default plugin implementation.
Useful? React with 👍 / 👎.
| + "RENAME \(identifier(oldColumn.name)) TO \(identifier(newColumn.name))" | ||
| } | ||
| guard let definition = generateColumnDefinitionSQL(column: newColumn) else { return nil } | ||
| return "ALTER TABLE \(qualified(table)) ADD \(definition)" |
There was a problem hiding this comment.
Use modify DDL instead of adding duplicate columns
When a column edit changes type/null/default without renaming, this returns ALTER TABLE ... ADD ... using the existing column name. The schema editor will therefore issue an add-column statement for a column that already exists, so normal edits fail with duplicate-column errors instead of applying the change.
Useful? React with 👍 / 👎.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Adds Teradata Vantage support as a registry-only driver, written from scratch in native Swift. It speaks the Teradata wire protocol directly, so there is no ODBC driver or JDBC jar to install. Closes #1867.
Teradata does not publish its driver-core source, and every native Teradata client ships under a license that forbids embedding or redistribution, so the usual "pre-built
.a+ C bridge" pattern is legally blocked. A pure-Swift wire-protocol driver is the only native, self-contained, license-clean option.What works
TDNEGOalso works;LDAP/KRB5/JWTreport a clear "unsupported" error instead of failing obscurely.SecTrust).DBC.*V. Databases and users are both namespaces, so there is no schema layer under them.TOP/QUALIFY ROW_NUMBER()pagination (Teradata has noLIMIT).CREATE MULTISET TABLE ... PRIMARY INDEX).Architecture
Packages/TableProCore/Sources/TableProTeradataCore/: the pure-Swift protocol engine (~20 files). BigUInt MontgomerymodPow, Diffie-Hellman, AES-GCM, LAN/parcel/DER codecs, the WebSocket-over-TLS transport, record decoding,DBC.*Vschema queries, and column-type mapping. No external dependencies beyond Foundation / Network / Security / CryptoKit.Plugins/TeradataDriverPlugin/: theDriverPlugin+PluginDatabaseDriverbundle bridging the core to TablePro (connection, schema, editing, DDL, SSL mapping). Registry-only, tagplugin-teradata-v*, no PluginKit ABI bump.DatabaseType.teradata, the registry-defaults snapshot,build-plugin.yml,release-all-plugins.sh, docs, and a brand icon.Testing
TableProTeradataCorecover the protocol codecs, WebSocket framing and accept-key, DH key exchange, record decoding (including DECIMAL), SQL builders, SSL-mode mapping, logon-mechanism gating, the failed-query loop, and error formatting.SELECT 1, catalog browse, DECIMAL/DATE/TIMESTAMP columns, the full INSERT/UPDATE/DELETE/ALTER/DROP cycle, and TLS in Required and Verify Identity modes.Notes for review