import type * as MysqlClient from "@effect/sql-mysql2/MysqlClient"; import type { AnyRelations, EmptyRelations } from "drizzle-orm"; import type { EffectMysql2Database } from "drizzle-orm/effect-mysql2"; import type { EffectDrizzleMySqlConfig } from "drizzle-orm/mysql-core/effect/utils"; import * as Effect from "effect/Effect"; import type * as Redacted from "effect/Redacted"; import type { MySQLConfig } from "../SQL/MySQL.ts"; /** * Open a Drizzle/MySQL database from a connection URL using the * `drizzle-orm/effect-mysql2` integration. * * ```typescript * const conn = yield* Cloudflare.Hyperdrive.Connect(Hyperdrive); * const db = yield* Drizzle.MySQL(conn.connectionString, { relations }); * * fetch: Effect.gen(function* () { * const rows = yield* db.select().from(users); * }); * ``` * * The pool opens on the first query of an execution, is reused for every * query in it, and closes when the event settles (see * {@link makeExecutionMemo}); plan/deploy never connect. Workers defaults * ({@link resolveMySQLConfig}) are overridden via `config.client`: * * ```typescript * const db = yield* Drizzle.MySQL(connectionString, { * relations, * client: { poolConfig: { ssl: { rejectUnauthorized: true } } }, * }); * ``` * * @binding */ export declare const MySQL: (connectionString: Effect.Effect, E, R>, config?: EffectDrizzleMySqlConfig & { /** * Overrides for the underlying `@effect/sql-mysql2` client — pool * options (e.g. `poolConfig.ssl` for a direct TLS connection), * `disablePreparedStatements`, `maxConnections`, and friends. */ readonly client?: Omit; }) => Effect.Effect & { $client: MysqlClient.MysqlClient; }, never, never>; //# sourceMappingURL=MySQL.d.ts.map