{"id":25720029,"url":"https://github.com/gregwhitaker/rest-keysetpagination-example","last_synced_at":"2026-05-12T12:03:43.002Z","repository":{"id":82732620,"uuid":"326297757","full_name":"gregwhitaker/rest-keysetpagination-example","owner":"gregwhitaker","description":"Simple example of keyset pagination in a Spring Boot RESTful webservice.","archived":false,"fork":false,"pushed_at":"2021-01-03T23:31:08.000Z","size":170,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T17:41:26.597Z","etag":null,"topics":["example","jdbc","pagination","restful-api","spring-boot"],"latest_commit_sha":null,"homepage":"https://use-the-index-luke.com/no-offset","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregwhitaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-03T00:30:16.000Z","updated_at":"2024-08-04T23:08:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ee2ecb4-cb9f-4249-8296-dcca8d3f92b0","html_url":"https://github.com/gregwhitaker/rest-keysetpagination-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gregwhitaker/rest-keysetpagination-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Frest-keysetpagination-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Frest-keysetpagination-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Frest-keysetpagination-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Frest-keysetpagination-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregwhitaker","download_url":"https://codeload.github.com/gregwhitaker/rest-keysetpagination-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Frest-keysetpagination-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32938004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","jdbc","pagination","restful-api","spring-boot"],"created_at":"2025-02-25T17:36:25.043Z","updated_at":"2026-05-12T12:03:42.997Z","avatar_url":"https://github.com/gregwhitaker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rest-keysetpagination-example\n![Build](https://github.com/gregwhitaker/rest-keysetpagination-example/workflows/Build/badge.svg)\n\nAn example of [keyset pagination](https://use-the-index-luke.com/no-offset) in a RESTful webservice.\n\n## Prerequisites\nThis example requires a running PostgreSQL database.\n\nYou can start an instance as a Docker container by running the following command:\n\n    docker run -p 5432:5432 postgres\n\n## Building the Example\nRun the following command to build the example:\n\n    ./gradlew clean build\n\n## Running the Example\nFollow the steps below to run the example:\n\n1. Run the following command to start the example service:\n\n        ./gradlew bootRun\n        \n2. Run the following command to query a list of all of the employees in the company:\n\n        curl http://localhost:8080/employees\n        \n    If successful, you will receive 25 employee records from the database with a link containing a cursor to get the next 25 records.\n    \n        {\n          \"count\": 25,\n          \"employees\": [\n            ...\n          ],\n          \"links\": [\n            {\n              \"rel\": \"next\",\n              \"type\": \"GET\",\n              \"href\": \"/employees?cursor=VapqQ\"\n            }\n          ]\n        }\n    \n3. Adjust the url to add the next cursor to paginate through the results:\n\n        curl http://localhost:8080/employees?cursor=VapqQ\n        \n    If successful, you will retrieve employee records `26` - `50`:\n\n## Bugs and Feedback\nFor bugs, questions, and discussions please use the [Github Issues](https://github.com/gregwhitaker/rest-keysetpagination-example/issues).\n\n## License\nMIT License\n\nCopyright (c) 2021 Greg Whitaker\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Frest-keysetpagination-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregwhitaker%2Frest-keysetpagination-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Frest-keysetpagination-example/lists"}