Skip to content

A full query console for Cloudflare's D1 database product.

License

Notifications You must be signed in to change notification settings

isaac-mcfadyen/d1-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

D1 Console

A console/REPL for Cloudflare's D1 Database product.

NPM | GitHub

Supports all the features expected of a modern database client, including:

  • multiline queries
  • table-formatted query outputs
  • command history
  • the ability to save your Cloudflare credentials for later use (opt-in)

Usage

  • First, run d1-console login --account-id <ID> --api-token <TOKEN> to save your credentials for later use. To generate an API token, go to the API Tokens page on the Cloudflare dashboard. Your account ID can be found on any zone (domain) of your Cloudflare account.
  • You can now create a database using d1-console databases create <NAME>.
  • To query your new D1 database, you can use the d1-console -d <NAME> command.

In-REPL Commands

  • Aside from subcommands (such as d1-console databases create <name) you can also create, list, delete, and switch databases from within D1 Console. To view available commands, use the HELP command within D1 Console.

CI/CD

  • If you wish to use D1 Console in CI/CD pipelines, the flag --execute can be used to immediately execute a command passed in (e.g. --execute "SELECT * FROM USERS"). In addition, D1 Console will now prefer CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN environment variables over the saved authentication (if any).

Community

For more information, to get help, or just to chat about D1 and D1 Console, join us on the Cloudflare Developers Discord!

About

A full query console for Cloudflare's D1 database product.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •