-
Notifications
You must be signed in to change notification settings - Fork 613
fix: use simplified queries for key decrements #3804
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
Changes from all commits
385ae45
8ac4b5d
744846d
174b4d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- name: UpdateKeyCreditsDecrement :exec | ||
| UPDATE `keys` | ||
| SET remaining_requests = CASE | ||
| WHEN remaining_requests >= sqlc.arg('credits') THEN remaining_requests - sqlc.arg('credits') | ||
| ELSE 0 | ||
| END | ||
| WHERE id = ?; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| -- name: UpdateKeyCreditsIncrement :exec | ||
| UPDATE `keys` | ||
| SET remaining_requests = remaining_requests + sqlc.arg('credits') | ||
| WHERE id = ?; | ||
Flo4604 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| -- name: UpdateKeyCreditsSet :exec | ||
| UPDATE `keys` | ||
| SET remaining_requests = sqlc.narg('credits') | ||
| WHERE id = ?; |
Uh oh!
There was an error while loading. Please reload this page.