8000 manc95 (秀儿) · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
View manc95's full-sized avatar
💭
等以后你回想起17岁肯定比我们后悔
💭
等以后你回想起17岁肯定比我们后悔

Block or report manc95

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
manc95/README.md

D1 Manager

D1 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.

semantic-query-demo

Features

  • Multiple D1 Databases
  • List all tables in a database
  • Show table schema
  • Run SQL queries
  • Run Semantic Queries (OpenAI API or Cloudflare AI Worker)
  • Edit table data through UI
  • I18n support (English, Chinese, Spanish, Japanese) add more (Online Editor)
  • API support (see routes/api for details)

Setup

  1. Fork this repo
  2. Setup a Cloudflare Pages with the forked repo
    • Select the SveltKit framework preset.
    • Build command: npm run build
    • Build output directory: .svelte-kit/cloudflare
  3. Use Cloudflare Access to protect the your site
    • The default access rules only restrict access to preview pages, so make sure to add other urls you want protected.
  4. Bind databases to DB_* environment variables

bind-d1

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.

Environment Variables

Some plugins (e.g. Semantic Query) require additional environment variables to be set.

set-env-var

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.

Semantic Query

You can use OpenAI API or Cloudflare AI Worker to run Semantic Query.

OpenAI API:

  • 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.
  • OPENAI_MODEL: OpenAI API model for Semantic Query. Default to gpt-3.5-turbo-1106.

Cloudflare AI Worker:

  • AI: Bind a Cloudflare AI Worker to this variable.
  • CFAI_MODEL: Cloudflare AI Worker model for Semantic Query. Default to @cf/mistral/mistral-7b-instruct-v0.1.

Screenshots

tables

run-query

table-browser

add-record

semantic-query

Semantic Query uses OpenAI GPT-3.5 Turbo to translate natural language queries into SQL.

Popular repositories Loading

  1. workers-for-platforms-example workers-for-platforms-example Public

    Forked from cloudflare/workers-for-platforms-example

    A great place for platforms to get started on Cloudflare Workers!

    TypeScript 1

  2. url url Public

    Forked from whatwg/url

    URL Standard

    HTML 1

  3. vnts vnts Public

    Forked from vnt-dev/vnts

    vnt server

    Rust 1

  4. vntapp vntapp Public

    Forked from vnt-dev/VntApp

    Dart 1

  5. website website Public

    Forked from SunsongAeolus/website

    TypeScript

  6. Shadowrocket-ADBlock-Rules-Forever Shadowrocket-ADBlock-Rules-Forever Public

    Forked from Johnshall/Shadowrocket-ADBlock-Rules-Forever

    提供多款 Shadowrocket 规则,拥有强劲的广告过滤功能。每日 8 时重新构建规则。

0