Skip to content
/ d1-manager Public template
forked from JacobLinCool/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.

License

Notifications You must be signed in to change notification settings

hackheim/d1-manager

 
 

Repository files navigation

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 (with OPENAI_API_KEY env var set)
  • Edit table data through UI
  • I18n support (English, Chinese) add more
  • API support (see routes/api for details)

Setup

  1. Fork this repo
  2. Setup a Cloudflare Pages with the forked repo
  3. Use Cloudflare Access to protect the your site
  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.
  • 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

tables

run-query

table-browser

add-record

semantic-query

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

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Svelte 58.8%
  • TypeScript 37.2%
  • JavaScript 1.8%
  • Dockerfile 1.2%
  • HTML 0.5%
  • CSS 0.3%
  • Shell 0.2%