canonical / sqlair

Friendly type mapping for SQL databases
Apache License 2.0
17 stars 9 forks source link

Move input and output argument validation to typeinfo package #134

Closed Aflynn50 closed 8 months ago

Aflynn50 commented 8 months ago

This PR moves the sections of BindInputs and ScanArgs that validate the arguments from the user to the typeinfo package. The new functions return the typeToValue map that is used by BindInputs and ScanArgs.

The error messages returned by the two validation functions are made consistent and the two functions are changed to match in shape even though they are subtly different.

A test is also added for nil maps as arguments, since this was not previously checked.