reject Deserialize(nil) with clear error

How to handle Deserialize(nil) is a judgment call.

sqlite3_deserialize(db, schema, NULL, 0, 0, ...) disconnects and starts fresh. But in database/sql world, connections are pooled, so that seems bad. But nil as an input is guaranteed to fail, possibly in ugly ways, if not handled explicitly.

Given that we're in Go, and creating a new DB is trivial, opt for safety and explicitness and early feedback, and declare Deserialize(nil) to be an error and handle it explicitly.

Merge request reports

Loading