Enable running opencode on Node.js by adding platform-specific database adapters and replacing Bun-specific shell execution with cross-platform Process utility.
8 lines
234 B
TypeScript
8 lines
234 B
TypeScript
import { Database } from "bun:sqlite"
|
|
import { drizzle } from "drizzle-orm/bun-sqlite"
|
|
|
|
export function init(path: string) {
|
|
const sqlite = new Database(path, { create: true })
|
|
const db = drizzle({ client: sqlite })
|
|
return db
|
|
}
|