$ CLOUDFLARE_API_TOKEN=[YOUR-API-TOKEN] CLOUDFLARE_D1_DATABASE_ID=[YOUR-D1-DATABASE-ID] CLOUDFLARE_D1_TABLE_NAME=[YOUR-D1-TABLE-NAME] CLOUDFLARE_ACCOUNT_ID=[YOUR-ACCOUNT-ID] go run main.go
Prerequisite
Before executing this example code, you need to create your database and table in Cloudflare D1. You also must create your API token to access the API.