-
Notifications
You must be signed in to change notification settings - Fork 550
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
Added ability to parse STRUCT and MAP fields as well as nested arrays #966
Conversation
…th bracket styles. Additionally, a speculative fix for double end greater than bracket
Thank you @scarman-db -- I'll check this out in the next few days |
Pull Request Test Coverage Report for Build 6138442724
💛 - Coveralls |
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.
Thank you for the PR @scarman-db -- I am not quite sure what feedback you are looking for
This PR is failing CI
Also, I think there needs to be more doc comments to match the existing code style as ell as tests for the new Map
, Struct
and BracketArray
structs
/// Enums | ||
Enum(Vec<String>), | ||
/// Set | ||
Set(Vec<String>), | ||
/// Map |
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.
Can you please provide a link to what SQL dialect supports this syntax?
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] | ||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] | ||
pub struct StructField { |
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.
Can you please add docstrings that explain what this struct is for (with an example SQL snippet)
@@ -257,6 +259,7 @@ pub struct Parser<'a> { | |||
options: ParserOptions, | |||
/// ensure the stack does not overflow by limiting recursion depth | |||
recursion_counter: RecursionCounter, | |||
max_depth: usize, |
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.
Please document what this field is foe.
Also, could you please explain why you didn't use the counter in RecusionCounter
?
Marking as draft as this PR is no longer waiting on feedback |
Similar PR here #1003 |
I wanted feedback on the approach, but I looked at the other PR and it seems a bit more well thought out than mine. I'd suggest we can close this PR, but also for the other PR to add a test for the nesting arrays structs. |
Thank you @scarman-db -- sorry for the delay in reviewing this PR |
This PR has additions for parsing table columns with fields such as
Additionally, this has the ability to parse back for some SQL dialects that use
[]
instead of theARRAY<T>
syntax adding the "SquareBracketedArrayinstead of just
Array`I also have a potential solution to the nested bracket issue, but I have no added it to Maps and structs although it should just work (I have to write tests a well) but I more was not happy with the manner in which I implemented this and I am looking for some suggestions on how to better structure this.