Skip to content

Commit

Permalink
Merge pull request #20 from JacobLinCool/feat-json-mode
Browse files Browse the repository at this point in the history
update to use json mode
  • Loading branch information
JacobLinCool authored Nov 30, 2023
2 parents 5a63eb8 + 3072d11 commit fe0598d
Show file tree
Hide file tree
Showing 20 changed files with 1,628 additions and 1,671 deletions.
12 changes: 6 additions & 6 deletions .changeset/three-shoes-hunt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

First Release for Web UI and API

- [x] Multiple D1 Databases
- [x] List all tables in a database
- [x] Show table schema
- [x] Run SQL queries
- [x] I18n support (English, Chinese)
- [x] API support
- [x] Multiple D1 Databases
- [x] List all tables in a database
- [x] Show table schema
- [x] Run SQL queries
- [x] I18n support (English, Chinese)
- [x] API support
13 changes: 3 additions & 10 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ overrides:
parser: svelte

plugins:
- ./node_modules/@trivago/prettier-plugin-sort-imports/lib/src/index.js
- ./node_modules/prettier-plugin-svelte/plugin.js
- ./node_modules/prettier-plugin-tailwindcss/dist/index.js
pluginSearchDirs: false

importOrder:
- "^node:"
- "^[^@.]"
- "^@"
- "^\\."
- prettier-plugin-tailwindcss
- prettier-plugin-organize-imports
- prettier-plugin-svelte
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ D1 Manager is a web UI and API for Cloudflare D1, a serverless SQL database. It

## Features

- [x] Multiple D1 Databases
- [x] List all tables in a database
- [x] Show table schema
- [x] Run SQL queries
- [x] Run Semantic Queries (with `OPENAI_API_KEY` env var set)
- [ ] Create new table through UI
- [x] Edit table data through UI
- [ ] Custom SQL scripts
- [x] I18n support (English, Chinese) [add more](./locales/)
- [x] API support (see [routes/api](./src/routes/api/) for details)
- [x] Multiple D1 Databases
- [x] List all tables in a database
- [x] Show table schema
- [x] Run SQL queries
- [x] Run Semantic Queries (with `OPENAI_API_KEY` env var set)
- [x] Edit table data through UI
- [x] I18n support (English, Chinese) [add more](./locales/)
- [x] API support (see [routes/api](./src/routes/api/) for details)

## Setup

Expand All @@ -36,7 +34,9 @@ Some plugins (e.g. Semantic Query) require additional environment variables to b

Also, there are some configuration options that can be set through environment variables.

- `SHOW_INTERNAL_TABLES`: Show internal tables (`splite_*` and `d1_*`) in the UI.
- `SHOW_INTERNAL_TABLES`: Show internal tables (`splite_*` and `d1_*`) in the UI.
- `OPENAI_API_KEY`: OpenAI API key for Semantic Query.
- `OPENAI_API_URL`: You may use this with Cloudflare AI Gateway to proxy requests to OpenAI API.

## Screenshots

Expand All @@ -50,4 +50,4 @@ Also, there are some configuration options that can be set through environment v

![semantic-query](./images/semantic-query.png)

> Semantic Query uses OpenAI Codex to translate natural language queries into SQL.
> Semantic Query uses OpenAI GPT-3.5 Turbo to translate natural language queries into SQL.
73 changes: 38 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,51 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "vitest",
"lint": "prettier --ignore-path .gitignore --check **/*.{ts,js,json,yaml,yml,svelte,html,css} && eslint .",
"format": "prettier --ignore-path .gitignore --write **/*.{ts,js,json,yaml,yml,svelte,html,css}",
"lint": "prettier --ignore-path .gitignore --check . && eslint .",
"format": "prettier --ignore-path .gitignore --write .",
"upload": "pnpm build && wrangler pages publish --project-name d1-manager .svelte-kit/cloudflare",
"tail": "wrangler pages deployment tail --project-name d1-manager"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@cloudflare/workers-types": "^4.20230518.0",
"@ai-d/aid": "^0.1.3",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@cloudflare/workers-types": "^4.20231121.0",
"@iconify/svelte": "^3.1.4",
"@playwright/test": "^1.35.1",
"@sveltejs/adapter-cloudflare": "^2.3.0",
"@sveltejs/kit": "^1.20.4",
"@tailwindcss/typography": "^0.5.9",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"autoprefixer": "^10.4.14",
"csv-parse": "^5.4.0",
"csv-stringify": "^6.4.0",
"daisyui": "^3.1.1",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"@playwright/test": "^1.40.1",
"@sveltejs/adapter-cloudflare": "^2.3.3",
"@sveltejs/kit": "^1.27.6",
"@tailwindcss/typography": "^0.5.10",
"@types/debug": "^4.1.12",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"autoprefixer": "^10.4.16",
"csv-parse": "^5.5.2",
"csv-stringify": "^6.4.4",
"daisyui": "^4.4.14",
"debug": "^4.3.4",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte3": "^4.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"openai": "^3.3.0",
"postcss": "^8.4.24",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.1",
"prettier-plugin-tailwindcss": "^0.3.0",
"svelte": "^3.59.1",
"svelte-check": "^3.4.3",
"svelte-i18n": "^3.6.0",
"tailwindcss": "^3.3.2",
"lint-staged": "^15.1.0",
"openai": "^4.20.1",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"prettier-plugin-tailwindcss": "^0.5.7",
"svelte": "^4.2.8",
"svelte-check": "^3.6.2",
"svelte-i18n": "^4.0.0",
"tailwindcss": "^3.3.5",
"theme-change": "2.5.0",
"tslib": "^2.5.3",
"typescript": "^4.9.5",
"vite": "^4.3.9",
"vitest": "^0.28.5",
"wrangler": "^3.1.0",
"zod": "^3.21.4"
"tslib": "^2.6.2",
"typescript": "^5.3.2",
"vite": "^5.0.4",
"vitest": "^0.34.6",
"wrangler": "^3.17.1",
"zod": "^3.22.4"
},
"lint-staged": {
"*.{ts,js,json,yaml,yml,svelte,html,css}": [
Expand All @@ -71,5 +74,5 @@
"bugs": {
"url": "https://github.com/JacobLinCool/d1-manager/issues"
},
"packageManager": "pnpm@8.6.3"
"packageManager": "pnpm@8.11.0"
}
Loading

0 comments on commit fe0598d

Please sign in to comment.