(target, prop)
| 81 | { internal: context === undefined ? internal : { ...internal, context } }, |
| 82 | { |
| 83 | get(target, prop) { |
| 84 | if (prop === "internal") return target.internal; |
| 85 | if (prop === "withContext") { |
| 86 | return (nextContext: ExecutorOwnerPolicyContext) => makeDb(nextContext); |
| 87 | } |
| 88 | if (!queryMethods.has(prop)) return undefined; |
| 89 | |
| 90 | return async (...args: unknown[]) => { |
| 91 | const actual = await start(); |
| 92 | const actualDb = |
| 93 | context === undefined ? actual.db : withQueryContext(actual.db, context); |
| 94 | const method = Reflect.get(actualDb, prop) as (...innerArgs: unknown[]) => unknown; |
| 95 | return method.apply(actualDb, args); |
| 96 | }; |
| 97 | }, |
| 98 | }, |
| 99 | ) as FumaDb; |
| 100 |
nothing calls this directly
no test coverage detected