sql: replace dbdesc/schemadesc/typedesc Immutable types with catalog interfaces#62755
Conversation
36840ad to
0b2d203
Compare
| } | ||
| return "" | ||
| } | ||
|
|
There was a problem hiding this comment.
These two new methods replace LookupSchema, I feel this is a better way to expose the contents of the Schemas map which is otherwise quite easy to misinterpret.
| func (desc *immutable) GetReferencingDescriptorID(refOrdinal int) descpb.ID { | ||
| return desc.ReferencingDescriptorIDs[refOrdinal] | ||
| } | ||
|
|
There was a problem hiding this comment.
These methods needed to be added to catalog.TypeDescriptor but they're straightforward getters.
|
Review guide: these changes are, for the most part, unremarkable. I commented on the parts of the diff which are interesting (albeit only slightly so). There are three commits, one per type, but it's not more difficult to review the whole diff IMHO. |
0b2d203 to
cc8fed6
Compare
|
Rebased to fix merge conflict. |
fqazi
left a comment
There was a problem hiding this comment.
Reviewed 4 of 14 files at r1, 45 of 45 files at r4, 21 of 21 files at r5, 39 of 39 files at r6.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @postamar)
cc8fed6 to
09e1a2d
Compare
|
Thanks for the review! Rebasing again, just to make sure. |
This commit makes schemadesc.Immutable private and replaces that type with catalog.SchemaDescriptor outside of that package, in an effort to virtualize catalog types. Partially addresses cockroachdb#62750. Release note: None
This commit makes typedesc.Immutable private and replaces that type with catalog.TypeDescriptor outside of that package, in an effort to virtualize catalog types. Partially addresses cockroachdb#62750. Release note: None
09e1a2d to
710e33a
Compare
|
Fixed merge conflict. |
This commit makes dbdesc.Immutable private and replaces that type with catalog.DatabaseDescriptor outside of that package, in an effort to virtualize catalog types. Partially addresses cockroachdb#62750. Release note: None
710e33a to
b33933e
Compare
|
bors r+ |
|
Build succeeded: |
This follows on a similar effort for tables: #59495
Fixes #62750