5dc8b4ef29
Enable running opencode on Node.js by adding platform-specific database adapters and replacing Bun-specific shell execution with cross-platform Process utility.
9 lines
226 B
TypeScript
9 lines
226 B
TypeScript
import { DatabaseSync } from "node:sqlite"
|
|
import { drizzle } from "drizzle-orm/node-sqlite"
|
|
|
|
export function init(path: string) {
|
|
const sqlite = new DatabaseSync(path)
|
|
const db = drizzle({ client: sqlite })
|
|
return db
|
|
}
|