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

Add support for --statement with mutual exclusion to --table and --alter #364

Open
morgo opened this issue Dec 24, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@morgo
Copy link
Collaborator

morgo commented Dec 24, 2024

In our automation, we inspect statements and detect which engine to execute them with. For example, a CREATE TABLE or a DROP TABLE are applied directly, but an ALTER TABLE goes to the spirit engine.

The problem with this is, what do you do with a CREATE INDEX statement? Well, we've decided to rewrite it to an ALTER TABLE (which is possible via the TiDB parser..)

But an alternative view of the layering here is that Spirit should do this detection and be able to execute all statements. This would allow us to maintain less logic in our internal systems, since no doubt others have the same use-case and can help maintain it.

Thus, I propose adding a new command line option for --statement which is mutually exclusive to --table and --alter. We inherited --alter from gh-ost, but in future I think it's reasonable that we can default to and promote --statement instead.

@morgo morgo added the enhancement New feature or request label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant