Skip to content

Conversation

@amotl
Copy link
Contributor

@amotl amotl commented Feb 12, 2026

About

While the CrateDB source adapter is using crate://, based on CrateDB's SQLAlchemy dialect, the destination adapter is using cratedb://, based on dlt-postgres. In this spirit, CrateDB's source vs. destination adapters are using totally different implementations and protocols.

The idea is to at least harmonize the "naming things" details on database addressing concerns, so it becomes less confusing for users, and less of an anomaly for the [new] product landing page generator.

-- https://getbruin.com/product/ingestion/

References

Review

Also FYI, @seut, @matriv, @surister, @hammerhead, and @zolbatar.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

ssl = "false"
if sslmode.lower() in ["require", "verify-ca", "verify-full"]:
ssl = "true"
uri = uri.replace(f"sslmode={sslmode}", f"ssl={ssl}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String replacement is unsafe - will replace any occurrence of sslmode={value} in the entire URI, including passwords or hostnames containing this substring.

Use parsed_uri._replace() and urlencode() like other URI transformations in this file (lines 156-158, 172-175):

Suggested change
uri = uri.replace(f"sslmode={sslmode}", f"ssl={ssl}")
query_params["ssl"] = [ssl]
del query_params["sslmode"]
uri = parsed_uri._replace(query=urlencode(query_params, doseq=True)).geturl()
Prompt To Fix With AI
This is a comment left during a code review.
Path: ingestr/src/sources.py
Line: 240:240

Comment:
String replacement is unsafe - will replace any occurrence of `sslmode={value}` in the entire URI, including passwords or hostnames containing this substring.

Use `parsed_uri._replace()` and `urlencode()` like other URI transformations in this file (lines 156-158, 172-175):

```suggestion
                query_params["ssl"] = [ssl]
                del query_params["sslmode"]
                uri = parsed_uri._replace(query=urlencode(query_params, doseq=True)).geturl()
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The patch was improved accordingly.

@amotl amotl force-pushed the cratedb-balance-addressing branch from 4855029 to 8e0537f Compare February 12, 2026 23:03
While the source adapter is using `crate://`, based on CrateDB's
SQLAlchemy dialect, the destination adapter is using `cratedb://`,
based on `dlt-postgres`. In this spirit, CrateDB's source vs.
destination adapters are using totally different implementations and
protocols.

The idea is to at least harmonize the "naming things" details on
database addressing concerns, so it becomes less confusing for users,
and less of an anomaly for the [new] product landing page generator.

-- https://getbruin.com/product/ingestion/
@amotl amotl force-pushed the cratedb-balance-addressing branch from 8e0537f to 4f41067 Compare February 12, 2026 23:09
@amotl amotl changed the title CrateDB: Add protocol scheme alias cratedb:// for source adapter CrateDB: Accept protocol scheme alias cratedb:// for source adapter Feb 12, 2026
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.

1 participant