@everystack/server 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/plugin.ts +4 -0
package/package.json
CHANGED
package/src/plugin.ts
CHANGED
|
@@ -466,9 +466,13 @@ export function dbPlugin(options: DbPluginOptions): Plugin {
|
|
|
466
466
|
const { eq, and, or, gt, lt, gte, lte, ne, count, sum, avg, sql, desc, asc } =
|
|
467
467
|
await import('drizzle-orm');
|
|
468
468
|
const evalContext: Record<string, unknown> = {
|
|
469
|
+
ctx,
|
|
469
470
|
db: ctx.db, schema: ctx.schema,
|
|
470
471
|
eq, and, or, gt, lt, gte, lte, ne, count, sum, avg, sql, desc, asc,
|
|
471
472
|
};
|
|
473
|
+
// Expose plugin-contributed context (notifications, rpc, etc.)
|
|
474
|
+
if (ctx.notifications) evalContext.notifications = ctx.notifications;
|
|
475
|
+
if (ctx.rpc) evalContext.rpc = ctx.rpc;
|
|
472
476
|
const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
|
|
473
477
|
const fn = new AsyncFunction(
|
|
474
478
|
...Object.keys(evalContext),
|