Skip to content

Conversation

@MylesDev
Copy link
Contributor

@MylesDev MylesDev commented Jul 9, 2025

Hello!

I came across an issue where java.util.List is not imported for private static <T> @Nullable List<T> getList(@NonNull ResultSet rs, int col, Class<T[]> as) throws SQLException {

This may have been missed during testing as the import is provided when queries return multiple results, as I discovered this on a query that had nullable values, but not multiple results.

I did think about adding this to https://github.com/tandemdude/sqlc-gen-java/blob/master/internal/codegen/queries.go#L129, as java.util.Arrays is imported there, but I wasn't sure as it could result in unused imports. If you'd prefer it there, let me know.

@tandemdude
Copy link
Owner

Thanks for the PR(s)! All looks good to me.

@tandemdude tandemdude merged commit b40fc1f into tandemdude:master Jul 10, 2025
1 of 2 checks passed
@MylesDev MylesDev deleted the fix/import-list-nullable-helpers branch July 10, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants