0.1.1 • Published 2 months ago

d1-driver v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

d1-driver

🌤️ 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

0.1.1

2 months ago

0.1.0

2 months ago

0.0.3

2 months ago

0.0.2

2 months ago

0.0.1

2 months ago