{"id":27961820,"url":"https://github.com/eliteengineer0/sql-db","last_synced_at":"2025-05-07T19:12:23.575Z","repository":{"id":287735288,"uuid":"965638523","full_name":"EliteEngineer0/sql-db","owner":"EliteEngineer0","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-13T15:49:06.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T19:12:23.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/EliteEngineer0.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,"zenodo":null}},"created_at":"2025-04-13T15:49:04.000Z","updated_at":"2025-04-13T15:49:07.000Z","dependencies_parsed_at":"2025-04-13T16:51:58.266Z","dependency_job_id":null,"html_url":"https://github.com/EliteEngineer0/sql-db","commit_stats":null,"previous_names":["eliteengineer0/sql-db"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteEngineer0%2Fsql-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteEngineer0%2Fsql-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteEngineer0%2Fsql-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteEngineer0%2Fsql-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EliteEngineer0","download_url":"https://codeload.github.com/EliteEngineer0/sql-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252940929,"owners_count":21828769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-05-07T19:12:22.657Z","updated_at":"2025-05-07T19:12:23.520Z","avatar_url":"https://github.com/EliteEngineer0.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Worker + D1 Database\n\n[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/sql-db)\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/sql-db#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/sql-db\n```\n\nA live public deployment of this template is available at [https://sql-db.templates.workers.dev](https://sql-db.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 \"main\":\n   ```bash\n   npx wrangler d1 create main\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 main\n   ```\n4. Deploy the project!\n   ```bash\n   npx wrangler deploy\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliteengineer0%2Fsql-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliteengineer0%2Fsql-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliteengineer0%2Fsql-db/lists"}