( db: AbstractQuery<S>, context: TContext, )
| 628 | } |
| 629 | |
| 630 | export function withQueryContext<S extends AnySchema, TContext>( |
| 631 | db: AbstractQuery<S>, |
| 632 | context: TContext, |
| 633 | ): AbstractQuery<S> { |
| 634 | if (typeof db.withContext === "function") return db.withContext(context); |
| 635 | |
| 636 | throw new Error( |
| 637 | "[FumaDB] Cannot apply query context to this query object. If you wrap an AbstractQuery, forward withContext so table policies keep using the wrapper.", |
| 638 | ); |
| 639 | } |
no outgoing calls