-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
[libsql] Add null check to normalizeRow #1050
Conversation
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.
Please add a test that verifies this behavior.
@dankochetov We do have type-tests for this, but this behaviour is kinda weird, ideally, we shouldn't have a I have changed the PR to throw an error incase we use Let me know, if the error message is good to go. Code used to reproduce the error: const x = {
id: "asd",
createdAt: new Date().toISOString(),
email: "[email protected]",
emailVerified: new Date().toISOString(),
updatedAt: new Date().toISOString(),
name: "asdasd",
picture: "asdasd",
username: "asdoihsdfo",
};
const newUser = await db
.insert(users)
.values(x)
.onConflictDoUpdate({
target: users.email,
set: {
email: `${new Date().getTime()}@gmail.com`,
id: `${new Date().getTime()}-sodhfoh`,
updatedAt: new Date().toString(),
name: `askd${new Date().getTime()}`,
},
})
// no returning()
.get()
console.log(newUser.id); The following images show when In webstorm In vscode. |
closing out his PR since the purpose of this was fulfilled elsewhere. |
A simple null check for normalizeRow function in libsql.
Fixes: #1049
let me know if this is a correct fix, I'm happy to learn more about this and implement any suggestions.
Thanks.