-
Notifications
You must be signed in to change notification settings - Fork 9
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
Make it possible to get and set superseding schema info #130
Conversation
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.
This looks great.
I wondered if some of this should be implemented in iglu-scala-core instead of iglu-server. For example, the deserializers and serializers. Maybe the definition of SelfDescribingSchema
needs to change? Might we need to use similar serializers/deserializers in igluctl?
But I'm also fine to merge this as-is, and then tackle it in iglu-scala-core at another time, only if needed.
body JSON NOT NULL | ||
body JSON NOT NULL, | ||
|
||
supersededby VARCHAR(128) NULL |
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.
This is a nit, but superseded_by
(with underscore) is more in-keeping with the other column names.
for { | ||
existing <- db.getSchema(schema.self).map(_.isDefined) | ||
_ <- if (existing) db.updateSchema(schema.self, schema.schema, isPublic) | ||
else db.addSchema(schema.self, schema.schema, isPublic) | ||
_ <- updateSupersedingVersion(schema.self, s) |
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.
Have you considered what happens if addSchema
is successful but updateSupersedingVersion
is unsuccessful? It struck me that nothing runs inside a transaction.
I'm not saying this is a problem. Please just confirm the database can't end up in an inconsistent state?
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.
In that case, it would be like superseding info wasn't submitted at all. I don't think it would lead to inconsistent state.
I thought about it but I couldn't be sure if we should do it or not since |
Details are in #129