Skip to content

check onUpdateFn result for updates #4663

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eytienne
Copy link

check onUpdateFn result type within buildUpdateSet/buildUpdateQuery the same way it was done in buildInsertQuery in case of SQL returned directly

@eytienne
Copy link
Author

Fixes #2388
Replaces #2911 following comments from @sdarnell

@@ -149,7 +149,11 @@ export class GelDialect {
return sql.join(columnNames.flatMap((colName, i) => {
const col = tableColumns[colName]!;

const value = set[colName] ?? sql.param(col.onUpdateFn!(), col);
let value = set[colName];
if (!value) {

Choose a reason for hiding this comment

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

this check should be value === undefined (across all dialects)

Copy link
Author

Choose a reason for hiding this comment

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

oops, just fixed it

check onUpdateFn result type within buildUpdateSet/buildUpdateQuery the same way it was done in buildInsertQuery in case of SQL returned directly
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.

2 participants