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

Fix set null value on string property #97

Merged

Conversation

alustrement-bob
Copy link
Contributor

What kind of change does this PR introduce?

This PR skip the null check on the expected type of a table column if it's a string.

What is the current behavior?

Because reflexion does not make difference between string and string?, updating text column with a null value failed :

System.ArgumentException: Expected Value to be of Type: String, instead received: .
at Supabase.Postgrest.Table`1.Set(Expression`1 keySelector, Object value)

What is the new behavior?

If a new value is of type string, the null check is bypassed.

Additional context

This should be improved with NullabilityInfoContext (https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-7/#libraries-reflection-apis-for-nullability-information), but not available with netstandard2.0

@acupofjose acupofjose merged commit b27827d into supabase-community:master May 23, 2024
1 check passed
@acupofjose
Copy link
Contributor

LGTM! Thanks for the contribution @alustrement-bob

@alustrement-bob alustrement-bob deleted the fix-string-null-value branch May 23, 2024 18:47
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