Skip to content

feat: export PoolBatchResults, ErrBatchResults, ErrRows and ErrRow#2491

Closed
grachevko wants to merge 1 commit intojackc:masterfrom
grachevko:master
Closed

feat: export PoolBatchResults, ErrBatchResults, ErrRows and ErrRow#2491
grachevko wants to merge 1 commit intojackc:masterfrom
grachevko:master

Conversation

@grachevko
Copy link
Contributor

Exports previously internal error wrapper types (ErrBatchResults, ErrRows, ErrRow) and adds PoolBatchResults constructor.

We implement custom connection pool logic combined with sqlc and currently we have to duplicate internal pgx error wrapper implementations.

Is this type of change acceptable?

@jackc
Copy link
Owner

jackc commented Jan 31, 2026

I'd prefer to keep these types as internal implementation details if possible. We don't currently expose the concrete types for non-error responses either.

Does this unblock functionality you need or is the goal to reduce some duplicated code?

@grachevko
Copy link
Contributor Author

I'd prefer to keep these types as internal implementation details if possible. We don't currently expose the concrete types for non-error responses either.

This PR not expose any types, only constructors, which returns already exposed interfaces. Types keep internal.

Does this unblock functionality you need or is the goal to reduce some duplicated code?

Only reduce duplicates

@jackc
Copy link
Owner

jackc commented Feb 11, 2026

I'd prefer to keep these types as internal implementation details if possible. We don't currently expose the concrete types for non-error responses either.

This PR not expose any types, only constructors, which returns already exposed interfaces. Types keep internal.

Ah. I see now.

Does this unblock functionality you need or is the goal to reduce some duplicated code?

Only reduce duplicates

In general, I prefer to avoid increasing the API surface area unless the functionality cannot be built outside of pgx or the need is extremely common. In this case, since the functionality can be built outside and it is not an extremely common request, I'd rather not merge this.

@jackc jackc closed this Feb 11, 2026
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