Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Include foreign keys in opencdc record #64

Open
nickchomey opened this issue Oct 19, 2024 · 2 comments
Open

Feature: Include foreign keys in opencdc record #64

nickchomey opened this issue Oct 19, 2024 · 2 comments
Labels
source related to the source connector

Comments

@nickchomey
Copy link

Feature description

It would be helpful if foreign keys were included in the opencdc record, to allow for automatic recreation of relationships in the destination connector. Not sure if it should be in the metadata key , or a subkey of "Key"

If it isn't already available in the row info that currently gets extracted from mysql, it would probably make sense to just extract it once and store it in the pipeline/schema somehow, rather than redundantly checking for it on each row iteration.

@lovromazgon
Copy link
Contributor

This sounds like you would like to transmit the schema information, is that right? Conduit currently only focuses on transmitting data, it does not make an effort to sync schemas from the source to the destination. To a degree that's possible using the schema support, but that doesn't really include relationships, since we are using Avro to represent the schema, and that doesn't include a way to represent foreign keys. Can you create the expected schema and relationships on the destination in advance before starting the Conduit pipeline?

This seems related to the schema changes discussion: ConduitIO/conduit#1762.

@nickchomey
Copy link
Author

nickchomey commented Oct 23, 2024

Yes, that's the idea. I don't think it would need to be anything other than Avro strings in order to be useful by processors and destination connectors.

Creating the destination schemas in advance is surely possible, but not always. I can foresee use cases in which you just want to connect to the source and have it auto-create the schemas, including relationships.

Having said this, I don't think that I'll personally use this as my source db doesn't really use foreign keys. But I'd like to offer the option in the destination connector, for others to take advantage of.

I'll likely specify relationships in a json file that either the destination connector will read from at runtime, or in a wasm processor. Likely the former though, to avoid the overhead and complexity of a wasm processor.

@alarbada alarbada added the source related to the source connector label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source related to the source connector
Projects
None yet
Development

No branches or pull requests

3 participants