-
Notifications
You must be signed in to change notification settings - Fork 845
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
support embedded schema for cassandra and sql update-schema #5195
Conversation
Do the |
thanks for catching! i missed this cuz the schema path is not required for that command, and everywhere we use it we always first run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working with me on some of this cleanup even though it wasn't from your work in the first place. The tool will be in a much better state after this!
What changed?
This change adds a flag to
temporal-sql-tool
andtemporal-cassandra-tool
'supdate-schema
andsetup-schema
to specify an embedded schema instead of a path to the schema directory or schema file.Why?
We want to embed the db schemas in the
temporal-sql-tool
andtemporal-cassandra-tool
withgo:embed
so that customers can simply specify which schema they want using a flag instead of having to copy the schema files to wherever they're running the db tool and passing the path to the schema.#2059
How did you test it?
I wrote a new unit test for reading the embedded file system, and the efs==nil codepath of the changed functions are all tested by the existing unit tests. I also updated the unit test for config validation to reflect the new changes.
I tested this locally with a locally running Postgres. Since the more complex changes are in
updatetask.go
, which is shared by the sql and the cassandra tool, I think there is no need to also test with a real cassandra db. I also built the cassandra command line tool and confirmed that the flags behaved as expected.Potential risks
Schema updates could fail. But the changes are pretty contained to the new
-s
flag which isn't used anywhere in production yet, so the risk is very low. The code for the-d
flag remained basically the same.Is hotfix candidate?
No