-
-
Notifications
You must be signed in to change notification settings - Fork 39
Draft of tables as types #2009
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
base: main
Are you sure you want to change the base?
Draft of tables as types #2009
Conversation
d174508 to
8e15b99
Compare
|
|
zachmu
left a comment
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.
Seems like a reasonable path forward for this feature
| conflicts.ClearContextValues = ClearContextValues | ||
| plpgsql.GetTypesCollectionFromContext = GetTypesCollectionFromContext | ||
| id.RegisterListener(sequenceIDListener{}, id.Section_Table) | ||
| typecollection.GetSqlTableFromContext = GetSqlTableFromContext |
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 less defensible when it's not cross-codebase. Probably need to refactor core a bit to remove the necessity of this. My guess is that these utility methods aren't really part of the core package, and the core and type collection packages could both depend on them in a new home.
Direction of the Doltgres-side of changes for adding tables as types (which includes GMS changes since we do not support tables being treated as values for parameters outside of aggregate/window functions).
In general, table types are not serialized within the type collection, only the resulting type ID (created based on the table ID) is serialized in locations that need to reference the type. The table type is currently constructed every time we need to fetch it from the type collection. Inside the type collection, we first check if a given type ID is contained in the map. If not, then we check the root (obtained from the context) for a matching table name and construct the table type.