testShim.ts overview
Alchemy’s D1 client over an in-memory SQLite database, for tests: the provider’s own PreparedStatement over a fake of the workerd binding, whose batch runs in one transaction rolled back on failure, as D1’s does. Excluded from the build.
Exports Grouped by Category
utils
RawD1 (type alias)
A raw binding from makeRawD1.
Signature
type RawD1 = ReturnType<typeof makeRawD1>
clientOver
Alchemy’s D1 client over a (deferred) raw binding, built the way the provider builds its own: PreparedStatements over the binding, and batch as one call of the binding’s batch.
Signature
declare const clientOver: (binding: Effect.Effect<RawD1>) => QueryDatabaseClient
makeRawD1
A fake of workerd’s raw D1 binding over a fresh in-memory SQLite database.
Signature
declare const makeRawD1: () => {
prepare: (sql: string) => RawStatement
batch: (statements: ReadonlyArray<RawStatement>) => Promise<Array<{ results: ReadonlyArray<unknown> }>>
exec: (sql: string) => Promise<undefined>
}
makeTestD1
A fresh in-memory database behind Alchemy’s D1 client.
Signature
declare const makeTestD1: () => QueryDatabaseClient
runtimeContext
Alchemy’s runtime context, as an event carries it. Nothing here reads it.
Signature
declare const runtimeContext: Layer.Layer<RuntimeContext, never, never>