MCPcopy Create free account
hub / github.com/Effect-TS/effect / plan

Function plan

packages/sql/sqlite-node/test/SqlEventJournal.test.ts:443–446  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

441 const sql = yield* SqliteClient.make({ filename: ":memory:" })
442 yield* SqlEventJournal.make().pipe(Effect.provideService(SqlClient.SqlClient, sql))
443 const plan = (query: string) =>
444 sql.unsafe<{ detail: string }>(`EXPLAIN QUERY PLAN ${query}`).pipe(
445 Effect.map((rows) => rows.map((row) => row.detail.replace(/INDEX \S+/, "INDEX <index>")))
446 )
447 assert.deepStrictEqual({
448 conflicts: yield* plan(
449 "SELECT * FROM effect_event_journal WHERE event IN ('a', 'b') AND primary_key IN ('a', 'b') AND timestamp > 0"

Callers 1

Calls 3

pipeMethod · 0.65
mapMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected