FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add execlastid implementation for mysql by yshrsmz · Pull Request #13 · sqlc-dev/sqlc-gen-typescript · GitHub

add execlastid implementation for mysql - #13

Merged
kyleconroy merged 5 commits into
sqlc-dev:mainfrom
yshrsmz:execlastid
Mar 3, 2024
Merged

add execlastid implementation for mysql#13
kyleconroy merged 5 commits into
sqlc-dev:mainfrom
yshrsmz:execlastid

Conversation

yshrsmz commented Feb 15, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

resolve #12

Added MySQL implementation of :execlastid annotation

Needs some guide for other dialects if I have to cover all dialects to merge this.

yshrsmz commented Feb 15, 2024

Copy link
Copy Markdown
Contributor Author

According to the node-pg issue, node-pg does not return last insert id, so can we just throw error in this case?

brianc/node-postgres#1269

Comment thread src/app.ts Outdated
}
case "pg": {
return pg;
return pg as any;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Instead of marking this as any, add a execlastidDecl method to the pg and postgres drivers that raise an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

thanks, fixed!: 2398fb0 (#13)

Comment thread src/drivers/mysql2.ts Outdated
Comment on lines +181 to +185
factory.createImportSpecifier(
false,
undefined,
factory.createIdentifier("ResultSetHeader")
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We should only import this if there is a execlastid query for the given file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

fixed: 8d3fcaf (#13)

yshrsmz requested a review from kyleconroy March 3, 2024 03:47

yshrsmz commented Mar 3, 2024

Copy link
Copy Markdown
Contributor Author

@kyleconroy Hi, thanks for the review. I have addressed your change requests. Please take a look 🙏

Copy link
Copy Markdown
Contributor

I just pushed some changes to fix the build, can you rebase on main?

yshrsmz commented Mar 3, 2024

Copy link
Copy Markdown
Contributor Author

@kyleconroy rebase done.

kyleconroy merged commit b79c5fa into sqlc-dev:main Mar 3, 2024
yshrsmz deleted the execlastid branch March 3, 2024 04:34
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support :execlastid query annotation

2 participants


Back | FazBrowse Home | New Git URL