Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inline query and mutation blocks #17

Open
sujayakar opened this issue Sep 19, 2024 · 0 comments
Open

Add inline query and mutation blocks #17

sujayakar opened this issue Sep 19, 2024 · 0 comments

Comments

@sujayakar
Copy link
Contributor

await step.inlineQuery(async (ctx) => {
  ...
});
let id;
await step.inlineMutation(async (ctx) => {
  const doc = await ctx.db.get(id); // can reference things in closure
  id = doc.nextId; // can even set things in closure w/o affecting determinism.
  await ctx.db.patch(doc._id, { nextId: null });
});

to maintain determinism, we'd journal each operation in a block.

this may interact poorly with transaction size limits -- we may want to find a way to be defensive and throw an error before the workflow mutation hits the global limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant