Sqlite - views and nullability of calculated averages
I have a sqlite table that contains a view with a calculated average and Linqpad detects this column as being "not null" or double rather than Double?, hence C# queries fail with an error like
The data is NULL at ordinal 1. This method can't be called on NULL values. Check using IsDBNull before calling.
I asked claude to produce a small demo to create a sqlite database in the temporary folder. See https://share.linqpad.net/hrjbta4a.linq
Comments
-
Looks like we need an option to make all view columns nullable.
I'll add this to the next beta.
-
This is now implemented in 9.12.1. Go to connection properties and enable Make All View Columns Nullable. Let me know how you get on.
-
Works perfectly. Thank you.
