{"id":27022690,"url":"https://github.com/srgchrksv/cloudflare-workers","last_synced_at":"2026-04-30T09:36:41.208Z","repository":{"id":286166297,"uuid":"960341628","full_name":"srgchrksv/cloudflare-workers","owner":"srgchrksv","description":"Cloudflare Worker + D1 Database example","archived":false,"fork":false,"pushed_at":"2025-04-05T08:39:54.000Z","size":70,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T18:11:48.613Z","etag":null,"topics":["cloudflare","cloudflareworkers","sql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srgchrksv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-04-04T09:13:08.000Z","updated_at":"2025-04-05T08:39:32.000Z","dependencies_parsed_at":"2025-04-09T18:11:36.254Z","dependency_job_id":null,"html_url":"https://github.com/srgchrksv/cloudflare-workers","commit_stats":null,"previous_names":["srgchrksv/cloudflare-workers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/srgchrksv/cloudflare-workers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srgchrksv%2Fcloudflare-workers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srgchrksv%2Fcloudflare-workers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srgchrksv%2Fcloudflare-workers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srgchrksv%2Fcloudflare-workers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srgchrksv","download_url":"https://codeload.github.com/srgchrksv/cloudflare-workers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srgchrksv%2Fcloudflare-workers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cloudflare","cloudflareworkers","sql"],"created_at":"2025-04-04T20:38:04.851Z","updated_at":"2026-04-30T09:36:41.203Z","avatar_url":"https://github.com/srgchrksv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Worker + D1 Database\n\nWas intereted to try use cloudlfare workers to deploy a service.\n\nBelow is the original readme for one of the example of usage:\n----\n\n[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/d1-template)\n\n![Worker + D1 Template Preview](https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/cb7cb0a9-6102-4822-633c-b76b7bb25900/public)\n\n\u003c!-- dash-content-start --\u003e\n\nD1 is Cloudflare's native serverless SQL database ([docs](https://developers.cloudflare.com/d1/)). This project demonstrates using a Worker with a D1 binding to execute a SQL statement. A simple frontend displays the result of this query:\n\n```SQL\nSELECT * FROM comments LIMIT 3;\n```\n\nThe D1 database is initialized with a `comments` table and this data:\n\n```SQL\nINSERT INTO comments (author, content)\nVALUES\n    ('Kristian', 'Congrats!'),\n    ('Serena', 'Great job!'),\n    ('Max', 'Keep up the good work!')\n;\n```\n\n\u003e [!IMPORTANT]\n\u003e When using C3 to create this project, select \"no\" when it asks if you want to deploy. You need to follow this project's [setup steps](https://github.com/cloudflare/templates/tree/main/d1-template#setup-steps) before deploying.\n\n\u003c!-- dash-content-end --\u003e\n\n## Getting Started\n\nOutside of this repo, you can start a new project with this template using [C3](https://developers.cloudflare.com/pages/get-started/c3/) (the `create-cloudflare` CLI):\n\n```\nnpm create cloudflare@latest -- --template=cloudflare/templates/d1-template\n```\n\nA live public deployment of this template is available at [https://d1-template.templates.workers.dev](https://d1-template.templates.workers.dev)\n\n## Setup Steps\n\n1. Install the project dependencies with a package manager of your choice:\n   ```bash\n   npm install\n   ```\n2. Create a [D1 database](https://developers.cloudflare.com/d1/get-started/) with the name \"d1-template-database\":\n   ```bash\n   npx wrangler d1 create d1-template-database\n   ```\n   ...and update the `database_id` field in `wrangler.json` with the new database ID.\n3. Run the following db migration to initialize the database (notice the `migrations` directory in this project):\n   ```bash\n   npx wrangler d1 migrations apply --remote d1-template-database\n   ```\n4. Deploy the project!\n   ```bash\n   npx wrangler deploy\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrgchrksv%2Fcloudflare-workers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrgchrksv%2Fcloudflare-workers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrgchrksv%2Fcloudflare-workers/lists"}