stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.72k stars 1.57k forks source link

Fix #1247 support nil case when decoding optionals #1248

Closed Chris-Stockbridge closed 7 months ago

Chris-Stockbridge commented 8 months ago

1247 describes a bug where decoding a nil value in an optional throws an error when nil is a valid response.

This same bug occurs with arrays or structs encoded to either optional string or data types.

Testing

I added a unit test "test_insert_custom_encodable_type" which demonstrates the issue. The current master branch fails when decoding a nil value.