-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Since this project is already integrated with Drizzle ORM, I believe we can easily extend its database support. By utilizing Hyperdrive, we can add compatibility for not only Cloudflare D1 but also for Postgres and MySQL.
/**
* Generic Drizzle database configuration (internal)
*/
interface DrizzleConfig<Fn extends (...args: any) => any> {
/** Drizzle database instance */
db: ReturnType<Fn>;
/** Adapter options (provider omitted) */
options?: Omit<DrizzleAdapterConfig, "provider">;
}
export interface WithCloudflareOptions extends CloudflarePluginOptions {
/**
* D1 database for primary storage, if that's what you're using.
*/
d1?: DrizzleConfig<typeof d1Drizzle>;
/** Postgres database configuration for Hyperdrive */
postgres?: DrizzleConfig<typeof postgresDrizzle>;
/** MySQL database configuration for Hyperdrive */
mysql?: DrizzleConfig<typeof mysqlDrizzle>;
/** KV namespace for secondary storage */
kv?: KVNamespace<string>;
}
I will open a PR for this shortly. Thank you!
zpg6
Metadata
Metadata
Assignees
Labels
No labels