Skip to content

Commit

Permalink
(fix) update pagination docs for upper and lower boundries
Browse files Browse the repository at this point in the history
  • Loading branch information
tphoney committed Aug 6, 2024
1 parent ef63d21 commit d9216cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ Returns an SDP reference for the item
GloballyUniqueName Returns a string that defines the Item globally. This a
combination of the following values:

* scope
* type
* uniqueAttributeValue
* scope
* type
* uniqueAttributeValue

They are concatenated with dots (.)

Expand Down Expand Up @@ -209,7 +209,7 @@ Sources that encountered errors will send errors on the `query.{uuid}` subject o

First install the dependencies:

```
```shell
npm i

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
Expand Down
11 changes: 6 additions & 5 deletions util.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ message PaginationRequest {
// The number of items to return in a single page. The minimum is 10 and the maximum is 100.
int32 pageSize = 1;

// The page number to return. the first page is 0.
// The page number to return. the first page is 1.
// if the page number is larger than the total number of pages, the last page is returned.
// if the page number is negative, the first page 0 is returned.
// if the page number is negative, the first page 1 is returned.
int32 page = 2;
}

message PaginationResponse {
// The number of items in the current page
// The number of items requested to be returned in a single page. NB this is not the number of items returned, this is the number of items requested to be returned.
// the minimum is 10 and the maximum is 100.
int32 pageSize = 1;

// The total number of items available. Expensive to calculate https://www.cybertec-postgresql.com/en/pagination-problem-total-result-count/
// this is done as a separate query
int32 totalItems = 2;

// The current page number
// The current page number, NB if the user provided a negative page number, this will be 1, if the user provided a page number larger than the total number of pages, this will be the last page.
int32 page = 3;

// The total number of pages available. based on the totalItems and pageSize.
Expand Down

0 comments on commit d9216cc

Please sign in to comment.