-
-
Notifications
You must be signed in to change notification settings - Fork 39
Add an interpreter base for function creation #1158
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
Conversation
3ee3aa2 to
205464c
Compare
|
Footnotes
|
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.
Overall seems pretty reasonable, a good start.
Main comment is that skipping backwards iteratively seems like an unnecessary complication, it should be possible to keep track of statements and jump to them directly.
205464c to
6cd631f
Compare
This adds the base of an interpreter, upon which
CREATE FUNCTIONandCREATE PROCEDUREwill convert their contents to. Only the interpreter portion is partially implemented, along with a temporary example function and accompanying test to ensure that it works.The next major step is to add parsing support for all of the statements that we'll need, as they do not yet exist (hence why the temporary example function's operations were manually created, although the conversion should result in the same output). The last major step will be to convert from the PL/pgSQL code to the operations that our interpreter expects.
The original intention was to implement as much of this in GMS as possible, however for now, the bulk of it will exist in Doltgres as I couldn't quite reconcile the proper way to implement it there without diving more fully into MySQL's
CREATE FUNCTIONandCREATE PROCEDUREsupport (rather than simply relying on memory). This is something that I'll revisit in a later PR, as I feel it'll be easier to do once I have a relatively complete implementation done in Doltgres.Related PR: