-
Notifications
You must be signed in to change notification settings - Fork 10
Support anonymous blocks for new Oracle dialect #53
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
@MasterOdin be good to get eyes on this briefly before merging, but it's working. Going to use in BKS either way |
}); | ||
|
||
describe('identifying statements with anonymous blocks', () => { | ||
it('should identify a create table then a block', () => { |
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.
why have this test repeated here and in parser/oracle.spec.ts
? Given that identify
is a relative shallow operation over the result of the parser, I'd rather just beef up the asserts there, and get rid of this test.
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.
Just as an idiot check to be honest. Costs very little, gives me some assurances
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.
For example, I changed the execution type that this returns, the tests reflect that. Nothing wrong with over testing.
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.
For all the tests in test/parser/oracle.spec.ts
, I think it would be good to have test:
- Number of statements
- Type of each statement
- Start of each statement
- End of each statement
So that it's nice and uniform, and we're testing the full scope of things.
test/parser/oracle.spec.ts
Outdated
expect(result.body[0].type).to.eq('ANON_BLOCK'); | ||
expect(result.body[0].start).to.eq(0); | ||
expect(result.body[0].end).to.eq(120); | ||
expect(result.body.length).to.eql(2); |
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.
I think this should be the first assert where if there were no statements found, then we'd get an undefined
error for a test failure, which isn't as meaningful imo.
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.
Yes I reorganized this incorrectly, moving the other way around
I'll address these couple of issues, then I'll merge it. |
@MasterOdin I've added a few changes:
I don't think this change requires a major version bump, as the new execution and statement types are only valid for Oracle, so no behavior has changed for any other databases. |
@MasterOdin I'll merge this tomorrow if you don't have any other changes. |
Oracle supports statement-level blocks (because...reasons)
This adds support for them.
It also adds oracle as a dialect