( adapterFactory: SqlDriverAdapterFactory, )
| 64 | } |
| 65 | |
| 66 | export const bindSqlAdapterFactory = ( |
| 67 | adapterFactory: SqlDriverAdapterFactory, |
| 68 | ): ErrorCapturingSqlDriverAdapterFactory => { |
| 69 | const errorRegistry = new ErrorRegistryInternal() |
| 70 | |
| 71 | const boundFactory: ErrorCapturingSqlDriverAdapterFactory = { |
| 72 | adapterName: adapterFactory.adapterName, |
| 73 | provider: adapterFactory.provider, |
| 74 | errorRegistry, |
| 75 | connect: async (...args) => { |
| 76 | const ctx = await wrapAsync(errorRegistry, adapterFactory.connect.bind(adapterFactory))(...args) |
| 77 | return ctx.map((ctx) => bindAdapter(ctx, errorRegistry)) |
| 78 | }, |
| 79 | } |
| 80 | |
| 81 | copySymbolsFromSource(adapterFactory, boundFactory) |
| 82 | |
| 83 | return boundFactory |
| 84 | } |
| 85 | |
| 86 | // *.bind(adapter) is required to preserve the `this` context of functions whose |
| 87 | // execution is delegated to napi.rs. |
nothing calls this directly
no test coverage detected