{"id":13815739,"url":"https://github.com/JacobLinCool/d1-manager","last_synced_at":"2025-05-15T09:33:34.491Z","repository":{"id":97687522,"uuid":"608246343","full_name":"JacobLinCool/d1-manager","owner":"JacobLinCool","description":"D1 Manager is a web UI and API for Cloudflare D1, a serverless SQL database. It provides a web interface for managing databases, tables, and records, as well as an AI assistant to help you write query in natural language.","archived":false,"fork":false,"pushed_at":"2024-07-31T19:37:46.000Z","size":5839,"stargazers_count":388,"open_issues_count":24,"forks_count":177,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-04T04:09:24.693Z","etag":null,"topics":["cloudflare-pages","d1","database","gpt","sql"],"latest_commit_sha":null,"homepage":"https://d1-manager.pages.dev","language":"Svelte","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/JacobLinCool.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":"2023-03-01T16:11:31.000Z","updated_at":"2024-08-04T03:56:45.000Z","dependencies_parsed_at":"2023-04-15T20:03:15.987Z","dependency_job_id":"8c0887e0-cbf0-436b-9296-4a11f067988f","html_url":"https://github.com/JacobLinCool/d1-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fd1-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fd1-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fd1-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fd1-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JacobLinCool","download_url":"https://codeload.github.com/JacobLinCool/d1-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225342832,"owners_count":17459484,"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":["cloudflare-pages","d1","database","gpt","sql"],"created_at":"2024-08-04T04:03:58.203Z","updated_at":"2025-05-15T09:33:34.478Z","avatar_url":"https://github.com/JacobLinCool.png","language":"Svelte","readme":"# D1 Manager\n\nD1 Manager is a web UI and API for Cloudflare D1, a serverless SQL database. It provides a user-friendly interface for managing databases, tables, and records, as well as an API for performing operations programmatically. D1 Manager simplifies database management, enabling users to focus on their data.\n\n[![semantic-query-demo](./images/semantic-query-demo.gif)](https://storage.jacoblin.cool/semantic-query-demo.mp4)\n\n## Features\n\n- [x] Multiple D1 Databases\n- [x] List all tables in a database\n- [x] Show table schema\n- [x] Run SQL queries\n- [x] Run Semantic Queries (OpenAI API or Cloudflare AI Worker)\n- [x] Edit table data through UI\n- [x] I18n support (English, Chinese, Spanish, Japanese) [add more](./locales/) ([Online Editor](https://fink.inlang.com/github.com/JacobLinCool/d1-manager))\n- [x] API support (see [routes/api](./src/routes/api/) for details)\n\n## Setup\n\n1. Fork this repo\n2. Setup a **Cloudflare Pages** with the forked repo\n    - Select the **SveltKit** framework preset.\n    - Build command: `npm run build`\n    - Build output directory: `.svelte-kit/cloudflare`\n3. Use **Cloudflare Access** to protect the your site\n    - The default access rules only restrict access to preview pages, so make sure to add other urls you want protected.\n4. **Bind databases** to `DB_*` environment variables\n\n![bind-d1](./images/bind-d1.png)\n\n\u003e Note: You can bind multiple databases to the manager. In theis example, `DB` will be `default` in the UI, and `DB_test` will be `test`.\n\n### Environment Variables\n\nSome plugins (e.g. Semantic Query) require additional environment variables to be set.\n\n![set-env-var](./images/set-env-var.png)\n\nAlso, there are some configuration options that can be set through environment variables.\n\n- `SHOW_INTERNAL_TABLES`: Show internal tables (`splite_*` and `d1_*`) in the UI.\n\n#### Semantic Query\n\nYou can use OpenAI API or Cloudflare AI Worker to run Semantic Query.\n\nOpenAI API:\n\n- `OPENAI_API_KEY`: OpenAI API key for Semantic Query.\n- `OPENAI_API_URL`: You may use this with Cloudflare AI Gateway to proxy requests to OpenAI API.\n- `OPENAI_MODEL`: OpenAI API model for Semantic Query. Default to `gpt-4.1-mini`.\n\nCloudflare AI Worker:\n\n- `AI`: Bind a Cloudflare AI Worker to this variable.\n- `CFAI_MODEL`: Cloudflare AI Worker model for Semantic Query. Default to `@cf/mistral/mistral-7b-instruct-v0.1`.\n\n## Screenshots\n\n![tables](./images/tables.png)\n\n![run-query](./images/run-query.png)\n\n![table-browser](./images/table-browser.png)\n\n![add-record](./images/add-record.png)\n\n![semantic-query](./images/semantic-query.png)\n\n\u003e Semantic Query uses OpenAI GPT-4.1 Mini to translate natural language queries into SQL.\n","funding_links":[],"categories":["Svelte"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJacobLinCool%2Fd1-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJacobLinCool%2Fd1-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJacobLinCool%2Fd1-manager/lists"}