Column parsing and updated table parsing#89
Open
not-night-but wants to merge 11 commits intocoresql:mainfrom
Open
Column parsing and updated table parsing#89not-night-but wants to merge 11 commits intocoresql:mainfrom
not-night-but wants to merge 11 commits intocoresql:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was implemented specifically for the ability to edit results in Beekeeper. It adds the ability to identify the selected columns in a select statement. It doesn't try to map or figure out what table the column actually comes from, we do that in Beekeeper (and I don't think that should be this library's responsibility). It simply lists out the top level comma separated columns defined in the select, their tables, schemas, and aliases (if any of those exist), and whether or not it is considered a wildcard (
*ortable.*).Along with that, table parsing previously just added the first token after a
FROMorJOINkeyword to the array as a string. This was an issue as, if a table was qualified by a schema, the schema would be the table in the array. Now we do a bit more parsing to possibly qualify those tables, as well as collect alias information. So now we output an object that includes the table name, schema, database, and alias if they are present.On Beekeeper's end, this allows us to do some mapping between a query result and the data that is returned from identifier to allow for constructing update statements to edit based on results.