Giter Club home page Giter Club logo

d1-console's People

Contributors

helloimalastair avatar isaac-mcfadyen avatar ytkg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

d1-console's Issues

Local database feature

Would be great to also be able to access local databases when using Wrangler.

Wrangler stores its local SQLite database at sqlite3 .wrangler/state/v3/d1/miniflare-D1DatabaseObject/ab43d37f48135ef454cdb4895268c4c8817c5f76a0ae8db115f478b15ca263a5.sqlite.

When starting d1-console with --local or -l, it should connect to the local database instead (no need for API keys). Most of the implementation would be in queryDatabase or queryDatabaseApi), where instead of fetch you would access the local SQLite database using https://www.npmjs.com/package/better-sqlite3

Quiet Mode / Debug Info to Stderr

Heya,

I would like to query D1 and get the json output in a shell stream.

For the following query I can't seem to get only the JSON data (without the Welcome to D1 Console!) and other info lines.

d1-console query -d example --execute 'SELECT * FROM sqlite_master;' --json
D1 Console v1.4.4
Welcome to D1 Console!
Enter a query followed by a semicolon to run it on the database. Multiple queries seperated by a semicolon will be run as a transaction (batch).
For more information, enter HELP;
Now querying database example (b0855cca-e921-4c9b-bff5-4f944581094d)
[
  {
    "type": "table",
    "name": "d1_kv",
    "tbl_name": "d1_kv",
    "rootpage": 2,
    "sql": "CREATE TABLE d1_kv (key TEXT PRIMARY KEY, value TEXT NOT NULL)"
  },
  {
    "type": "index",
    "name": "sqlite_autoindex_d1_kv_1",
    "tbl_name": "d1_kv",
    "rootpage": 3,
    "sql": null
  }
]

I tried adding 2>/dev/null to the command in order to send stderr to the bit bin, unfortunately that doesn't work ๐Ÿ˜ข

Some suggestions:

  • add a -silent mode as per spatialite
  • send informational messages to stderr instead of stdout
spatialite --help |& grep silent
   -silent              suppress the welcome message

Feature Request: d1-console login

Hi! First, love d1-console :) I could barely use D1 without it!

It'd be cool if there was a command to re-auth, like d1-console login - I accidently entered the wrong account ID and had to find where it was storing the creds to fix it ($HOME/.d1).

Along with this, d1-console whoami might be helpful, to see what I'm logged in as (I have multiple CF accounts.)

Thanks!

Cloudflare token permissions

Hi can you please help me understand what all permissions are needed while creating the API key for d1-console?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.