davsclaus opened a new pull request, #3151:
URL: https://github.com/apache/camel-kamelets/pull/3151

   _Claude Code on behalf of Claus Ibsen_
   
   A batch of Kamelets rewritten to the documentation standard proposed in 
#3140, `docs/modules/ROOT/pages/documenting.adoc`, like #3141–#3150.
   
   This batch has 21 database Kamelets and 12 partial pages:
   - the sinks and sources for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, 
Snowflake and Databricks;
   - Cassandra, Couchbase and MongoDB, including 
`mongodb-changes-stream-source`.
   
   The seven SQL databases are described in the same words, so a reader learns 
the pattern once.
   
   ## How they were checked
   
   **Every one was run against the database in Docker**, except Snowflake and 
Databricks, which need an account. Those two were checked against the template 
and the component documentation, and only started. The images used:
   - PostgreSQL 17, MySQL 8.4, MariaDB 11, SQL Server 2022 and Oracle Free 23;
   - Cassandra 5 and Couchbase 7.6;
   - MongoDB 8, including a single-node replica set for the change stream.
   
   ## Facts that were missing or wrong before
   
   - **SQL sinks:**
     - the body is one JSON object;
     - `:#name` in the query takes that field, or else the header of that name;
     - a JSON array, plain text or a missing field fails.
   - **SQL sources:**
     - one message per row, as JSON text;
     - without `consumedQuery`, the same rows come back on every poll;
     - when the next step fails for a row, the row is read again.
   - **SQL Server and Oracle:**
     - SQL Server with the default `encrypt=true` needs 
`trustServerCertificate=true` for a self-signed certificate;
     - Oracle's `databaseName` is the service name, and its column names come 
out in upper case.
   - **Partial pages:** several listed options that do not exist (`period`, 
`serverName`), or were generic text with a `v1alpha1` binding and no query.
   - **`cassandra-sink`:** takes a JSON array of the values for the `?` 
markers, in order. Its partial page said the opposite.
   - **`couchbase-sink`:** with the default `autoStartId=true`, the IDs restart 
at `startingId` on every start, so earlier documents are overwritten.
   - **`mongodb-sink`:**
     - inserts only, and a duplicate `_id` fails; its partial page claimed 
upsert through headers;
     - TLS is on by default.
   - **`mongodb-source`:** needs a capped collection.
   - **`mongodb-changes-stream-source`:** sends only changes after it starts, 
and an update gives `null`.
   
   ## Found on the way, not changed here
   
   - **SQL sources:** `consumedQuery` is not wrapped in `RAW()`. A `+` becomes 
a space, and an `&` stops the start.
   - **All SQL Kamelets:** a `?` anywhere in `query` stops the start, even 
inside a quoted literal, because the query is the path of the address. This is 
described as a limitation.
   - **`cassandra-*`:** `cql` is not `RAW()`, with the same `+` problem.
   - **`cassandra-source`'s output is not usable.** It marshals the driver's 
`Row` objects, which gives `{"columnDefinitions":…,"formattedContents":"[id:1, 
…]"}`. This is the same on 4.23 and 4.24. The description says what really 
comes out.
   - **`mongodb-sink`:** the `db-upsert` and `ce-dbupsert` headers do nothing, 
because the operation is fixed to `insert`.
   - **`couchbase-*`:** `couchbasePort` and `protocol` have no effect; `https` 
connects without TLS.
   - **`mariadb-source` and `sqlserver-source`:** declare `spec.types.in` where 
a source needs `out`.
   - **JDBC drivers:** missing from `spec.dependencies` for MySQL, MariaDB, 
Oracle and SQL Server, since #2589. They work only because Camel JBang adds 
them.
   - **Types and defaults:**
     - `serverPort` and `connectionPort` are typed `string`;
     - `cassandra-sink` `consistencyLevel` defaults to `ANY`, the weakest write 
level;
     - `couchbase-source` defaults to the `beer` sample bucket's design 
document.
   - **Commonly needed component options these Kamelets do not expose:**
     - max rows per poll, batch insert, and the connection pool for SQL;
     - `sslmode`/`useSSL` for PostgreSQL, MySQL and MariaDB;
     - the datacenter and TLS for Cassandra;
     - scope/collection for Couchbase;
     - upsert, `authSource` and `mongodb+srv` for MongoDB.
   
     These are for a follow-up.
   
   ## Notes for review
   
   - No template, type, default or required list was changed. The `dataTypes` 
blocks are `headers` only, with no `default`.
   - `KameletsCatalogTest.testSupportedHeaders`: the catalog now returns the 
headers these Kamelets declare instead of those of their components. The 
changed counts:
     - SQL sinks 9 → 2; SQL sources 0 → 1
     - `couchbase-sink` 2 → 1
     - `mongodb-sink` 12 → 1
   - This PR is based on `main`; if #3140 merges first, I will rebase it and 
regenerate the index.
   
   `./mvnw clean install` from the root passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to