@edgebasejs/adapter-d1
v0.1.11
Published
EdgeBase D1 database adapter for Cloudflare Workers
Readme
@edgebasejs/adapter-d1
Cloudflare D1 adapter for EdgeBase. Provides database helpers and schema initialization for D1.
Install
pnpm add @edgebasejs/adapter-d1What it provides
D1SyncDatabaseadapter for the sync engineinitializeDatabaseto create system tables and entity tables
Usage
import { D1SyncDatabase, initializeDatabase } from '@edgebasejs/adapter-d1';
// One-time setup
await initializeDatabase(db, schema);
// Use with the EdgeBase worker
const syncDb = new D1SyncDatabase(db);Notes
Use this adapter inside Cloudflare Workers (D1). For other databases, implement the same interface.
