Skip to content
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

Bug: can't insert None in an Option field #400

Open
2 tasks done
Qubut opened this issue Mar 4, 2025 · 0 comments
Open
2 tasks done

Bug: can't insert None in an Option field #400

Qubut opened this issue Mar 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Qubut
Copy link

Qubut commented Mar 4, 2025

Describe the bug

When trying to insert an Object w/ an option field the undefined value is being inserted as a NULL causing an error:

Error: Failed to insert Data ResponseError: There was a problem with the database: Found NULL for field address, with record customer:⟨john-smith⟩, but expected a option<string>`

the field address hier is undefined which translates to NONE but in the error it says it found NULL.

Steps to reproduce

  1. create a table w/ an option field
  2. insert a record using the SDK w/ undefined in the optional field

Expected behaviour

The record should be inserted successfully.

SurrealDB version

2.1.2 on Surreal Cloud

JavaScript SDK version

1.2.1

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Qubut Qubut added the bug Something isn't working label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant