-
Notifications
You must be signed in to change notification settings - Fork 17
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
add execlastid implementation for mysql #13
Conversation
According to the node-pg issue, node-pg does not return last insert id, so can we just throw error in this case? |
src/app.ts
Outdated
@@ -77,10 +83,10 @@ function createNodeGenerator(driver?: string): Driver { | |||
return mysql2; | |||
} | |||
case "pg": { | |||
return pg; | |||
return pg as any; |
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.
Instead of marking this as any
, add a execlastidDecl
method to the pg
and postgres
drivers that raise an error.
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.
thanks, fixed!: 2398fb0
(#13)
src/drivers/mysql2.ts
Outdated
factory.createImportSpecifier( | ||
false, | ||
undefined, | ||
factory.createIdentifier("ResultSetHeader") | ||
), |
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.
We should only import this if there is a execlastid
query for the given file.
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.
fixed: 8d3fcaf
(#13)
@kyleconroy Hi, thanks for the review. I have addressed your change requests. Please take a look 🙏 |
I just pushed some changes to fix the build, can you rebase on main? |
@kyleconroy rebase done. |
resolve #12
Added MySQL implementation of
:execlastid
annotationNeeds some guide for other dialects if I have to cover all dialects to merge this.