canonical / sqlair

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

Rework typeinfo to allow for slices #124

Closed Aflynn50 closed 7 months ago

Aflynn50 commented 7 months ago

Change the interfaces in typeInfo to allow for slice type to be naturally supported (this PR does not itself add support for slices).

This PR adds Input and Output interfaces to the typeinfo package. These break up the existing Member into more natural separate parts. A new interface ValueLocator replaces the Member interface (since slice ranges are not "members" of anything).

The typeinfo.Info interface is replaced with a private arg interface. The Info type was previously used to generate the Member values. It has been replaced with a struct, ArgInfo which can be generated by typeinfo.GenerateArgInfo(...). This ArgInfo acts as a black box containing type information which can be requested by the expr package via new methods on it.

The testing for typetnfo has been completely redone. The old tests have been removed and new, more complete, tests added. The error messages have not been changed in this PR where avoidable.