pip-services3-go / pip-services3-postgres-go

Postresql components for Pip.Services in Golang
MIT License
0 stars 0 forks source link

Total value for paging not populated with functional value #7

Closed antonio-alexander closed 2 years ago

antonio-alexander commented 2 years ago

https://github.com/pip-services3-go/pip-services3-postgres-go/blob/b1826291e3101cf4a5a07587cfa94ff54f0d4be3/persistence/PostgresPersistence.go#L678

As coded the total value will always be zero, and even though is non nil (won't panic). When paging parameters set total to true, the output is never the number of items in the page, but zero.

levichevdmitry commented 2 years ago

Hi, @antonio-alexander! Main idea for "Total" value is return nil, if in request page param "Total" field is false. In other cases we always return real value of record count.

I fixed mistake in pip-services3-postgres-go/persistence/PostgresPersistence.go and made new release v1.2.8.

antonio-alexander commented 2 years ago

Awesome, thanks!