( db: AbstractQuery<S>, context: TContext, )
| 446 | } |
| 447 | |
| 448 | export function withQueryContext<S extends AnySchema, TContext>( |
| 449 | db: AbstractQuery<S>, |
| 450 | context: TContext, |
| 451 | ): AbstractQuery<S> { |
| 452 | if (typeof db.withContext === "function") return db.withContext(context); |
| 453 | |
| 454 | throw new Error( |
| 455 | "[FumaDB] Cannot apply query context to this query object. If you wrap an AbstractQuery, forward withContext so table policies keep using the wrapper.", |
| 456 | ); |
| 457 | } |
no outgoing calls