The problem was if you are trying to INSERT many rows, and some of those rows have different quantity of setters due to optional values, the INSERT query will fail with all VALUES must have the same number of terms in "INSERT INTO...
We needed to either guarantee that each Encodable will have the same number of setters OR force equivalent numbers of setters by adding NULL where the optional value is nil. This can be done with the encodeIfPresent methods on KeyedEncodingContainerProtocol in SQLiteKeyedEncodingContainer
Fixes #1130, original PR (by me) was #1048
The problem was if you are trying to INSERT many rows, and some of those rows have different quantity of setters due to optional values, the INSERT query will fail with
all VALUES must have the same number of terms in "INSERT INTO...
We needed to either guarantee that each
Encodable
will have the same number of setters OR force equivalent numbers of setters by adding NULL where the optional value is nil. This can be done with theencodeIfPresent
methods onKeyedEncodingContainerProtocol
inSQLiteKeyedEncodingContainer