Code Monkey home page Code Monkey logo

d1-jdbc-driver's Introduction

D1 JDBC Driver

A JDBC driver for Cloudflare's D1 Database product!

JDBC is the technology that drives popular database tools such as Jetbrains' database functionality integrated into their editors and Datagrip, their standalone DB editor.

These tools all require a JDBC driver, an adapter that interfaces between the GUI and the Database.

The D1 JDBC Driver interfaces between these IDEs and Cloudflare's D1, and provides:

  • ๐Ÿ” Powerful and automatic schema introspection capabilities
  • โœ๏ธ SQL statement execution, along with auto-formatted results
  • ๐Ÿ”  Support for all of the Datatype Affinities that SQLite supports (NUMERIC, TEXT, etc)

Known issues:

  • Editing data directly via the table-like interface is not supported. Editing data via SQL is still supported.
  • Foreign keys are not currently shown in the introspection window, although they are still there and working as normal.

For more info and to get help, join us on the Cloudflare Developers Discord!

Installation instructions:

  1. Download the latest release of the D1 JDBC Driver from here.
  2. Move the .jar file to somewhere on your computer where you can store it permanently.
  3. Open Datagrip (or another Jetbrains tool) and add a new Database Driver. (Figure 1)
  4. Name it D1 JDBC Driver. Click on the plus sign beside Driver Files, select Custom JARs, then navigate to and choose the downloaded .jar file.
  5. Select org.isaacmcfadyen.D1Driver from the dropdown. (Figure 2)
  6. Go to the Options tab, scroll down to the bottom, and change the Dialect to SQLite. This is required for proper auto-complete functionality. (Figure 3)
  7. Go to the Data Sources panel, add a new Data Source, and select D1 JDBC Driver as the source. (Figure 4)
  8. Enter the URL, in the format jdbc:d1://<UUID> where <UUID> is the ID of the D1 database you were given at creation. For the User field, enter your Cloudflare Account ID, and for the Password field enter an API Token with the D1 Edit scope. (Figure 5)
  9. Hit Test Connection. If all is good, you should see a green message saying that the connection succeeded! If it failed, try going back through these steps and making sure you didn't make a typo. If you need help, join us on the Cloudflare Developers Discord. (Figure 6)

Figure 1:
Figure 1

Figure 2:
Selecting Driver Class

Figure 3:
Selecting Dialect

Figure 4:
Selecting Data Source

Figure 5:
Example of Authentication

Figure 6:
Connection Succeeded

d1-jdbc-driver's People

Contributors

isaac-mcfadyen avatar

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.