Skip to content

Conversation

ghost
Copy link

@ghost ghost commented May 23, 2024

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
@acupofjose
Copy link
Contributor

LGTM! Thanks for the contribution @alustrement-bob

@ghost ghost 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.

1 participant