Socket
Socket
Sign inDemoInstall

d1-driver

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    d1-driver

🌤️ Cloudflare D1 External Fetch Compatible Driver


Version published
Weekly downloads
955
increased by47.15%
Maintainers
1
Install size
36.7 kB
Created
Weekly downloads
 

Readme

Source

d1-driver

npm-version npm-license npm-download-month npm-min-size

🌤️ Cloudflare D1 External Fetch Compatible Driver

Installation

npm i d1-driver

Usage

import { D1 } from 'd1-driver'

// Create a new instance of D1
const d1 = new D1('YOUR_CLOUDFLARE_ACCOUNT_ID', 'YOUR_CLOUDFLARE_API_KEY')

// List all databases
const db_list = await d1.list()

const db_uuid = db_list[0].uuid

// Get a database by UUID
await d1.get(db_uuid)

// Create a new database
await d1.create('new_database_name')

// Delete a database by UUID
await d1.delete(db_uuid)

// Query a database
await d1.query(db_uuid, 'SELECT * FROM table_name')

License

MIT

Keywords

FAQs

Last updated on 28 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc