Skip to content
A playground to experiment with API pagination methods
Go Python TSQL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
migrations
.gitignore
README.md
db.go
docker-compose.yml
export_events.py
go.mod
go.sum
main.go
models.go
update_events.py

README.md

API pagination playground

An experimentation in API pagination and its pitfalls.

There are three components:

  1. A Go backend API which handles requests
  2. A Python client who constantly hammers the API and updates & creates records.
  3. A Python client who tries to export all the data via API pagination.

You will need goose, docker-compose, Go and Python3.

  • go get -u github.com/pressly/goose/cmd/goose
  • docker-compose up
  • goose -dir migrations/ postgres "user=calendar dbname=postgres sslmode=disable password=calendar" reset
  • goose -dir migrations/ postgres "user=calendar dbname=postgres sslmode=disable password=calendar" up
  • go build

Then,

  • Start the API: ./api-pagination-playground
  • Start client who updates and posts data: python3 update_events.py
  • Try to export all records with the other client: python3 export_events.py
You can’t perform that action at this time.