Skip to content

v0.4.0+commit.54dbdfe

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Feb 15:33
54dbdfe
nit: consistently close sql rows, check for errors (#34)

[Detail](https://detail.dev) reported a number of edge-case problems
with the data-loading logic in internal/schema. Fundamentally, I was
being lazy, and omitted some basic error checking.

- Need to `defer rows.Close()` after making a query
- Need to check `rows.Err()` after iterating through the rows.

This PR addresses these issues consistently throughout all the
data-loading code.

Additionally, with newer versions of golang, the compiler is able to
infer more
types when calling generic functions, so I've fixed all the editor
warnings
related to not needing to infer the types when calling the `Sort()`
method.

## Testing
- CI and existing unit tests.