0.0.2 • Published 5 months ago

pocket-d1 v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

Pocket D1

pocket-d1 is a simple utility to preview cloudflare D1 Databases in an easy-to-use UI as well as provide a REST API to interact with the database.

The UI is a fork of pocketbase and the project uses teenybase for automatically generated APIs for the database.

Usage

Install and run in the cloudflare project with wrangler.toml with a d1 database

npm i pocket-d1 && npx pocket-d1 start --remote

And navigate to the link in the console.

CLI

Navigate to the directory with wrangler.toml file with a database UUID and run the following command to start the local server:

npx pocket-d1 start --db MY_DB

where MY_DB is the database binding in the wrangler.toml file.

This will start a local server at http://localhost:3147 and print the viewer and editor credentials that can be used to access the DB.

By default, the local database is used, to use the remote database use the --remote flag.

npx pocket-d1 --remote start --db MY_DB