Skip to content

Expose getters from CREATE statements#2087

Open
chibenwa wants to merge 1 commit into
apache:4.xfrom
chibenwa:create-statement-getters
Open

Expose getters from CREATE statements#2087
chibenwa wants to merge 1 commit into
apache:4.xfrom
chibenwa:create-statement-getters

Conversation

@chibenwa
Copy link
Copy Markdown
Contributor

@chibenwa chibenwa commented May 10, 2026

Hello from Apache James.

Apache James runs a Cassandra backend and we uses a light and modular table declaration system allowing aggregating tables defined everywhere in the code. It just wraps com.datastax.oss.driver.api.querybuilder.schema.CreateTableWithOptions and allow dependency injection to do it's job.

We are able to create missing table and create them on the fly.

However we often add colomns onto existing tables and we currently fails at correcting it: admin needs to run the ALTER statement itself. And I would love to go from our table definitions and be able to asses if the existing table matches it - and see if we need to create extra coloms or not.

I was faced with 2 bad options:

  • parse the create statement myself (brittle! Hacky!)
  • Wrap the CreateTableWithOptions definition, rewrite the javadriver boiler plate doing so and modify my 31+ call sites and break the extensions of all our users.

I chose to try to contribute this upstream: being able to reliable describe the table that we wishes to operate on. To me at the very least this seems like a general need and is the minimal friction angle of attack to my problem.

If you have remarks I'm happy to make this work evolve.

Cheers,

Benoit

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