canonical / sqlair

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

Change switch/case in Prepare methods of typeInfo #103

Closed Aflynn50 closed 10 months ago

Aflynn50 commented 10 months ago

The switch/case statements in prepareInput and prepareOutput contain repeated code and repeated error message that can be factored out into methods on typeInfo.

The local function addColumns in prepareOutput is removed and calls are replaced with the explicit code since with these changes it only added cognitive overhead.

This means that the error messages change slightly but any context lost here will be added back with PR #99 where we add the relevant raw SQL to the error.