canonical / sqlair

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

Adjust saved reflection information #39

Closed Aflynn50 closed 1 year ago

Aflynn50 commented 1 year ago

This PR removes the usued fieldToTag map from the info struct and adds in an ordered list of tags: tags. This change is made to reflect how the info struct was used in the Prepare stage and makes the code slightly more efficient.

It fixed the bug where a panic would occur if an unexported field has a db tag. It now throws an error.

It stopstypeInfo from unnecessarley reflecting the value when only the type is used.

It changes the names structType and fieldType to typ as this is the more idiomatic way of doing things in Go (the struct they are fields of tells us what they are the type of).