batched-queries

Guides placement of batchedQuery reads between browser components and server handlers.

2|1|Updated Jun 28, 2026
One-click install
npx skills add https://github.com/lxsmnsyc/overwander --skill batched-queries-lxsmnsyc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: batched-queries
Source: https://github.com/lxsmnsyc/overwander/tree/main/.agents/skills/batched-queries
Command: npx skills add https://github.com/lxsmnsyc/overwander --skill batched-queries-lxsmnsyc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers in this codebase can misuse batchedQuery by batching reads on the server across separate requests, which adds latency, couples unrelated requests to shared failures, and breaks transaction semantics. This Skill defines where batched reads belong and what to use instead. ## Core Features & Use Cases - Browser-side batching guidance: Use batchedQuery where many components read one key each as they mount, such as list rows, cards, lobby parties, or history pages, following patterns like getCaughtBatched and getTeamBatched. - Server-side alternatives: Replace cross-request batching with single multi-key queries like readCaughtMany, readStacksIn, or where id = any(${ids}) that run inside the transaction. - Setup rules: Configure key for object queries, limit for URL-based .in('id', ids) reads, return a Map from the callback, and read results through settled to avoid suspending lists on refetch. - Use Case: When reviewing a pull request that wraps requireUid in a batched read on the server, apply this Skill to reject it and recommend a direct multi-key query instead. ## Quick Start Ask the AI to review a data read that fetches one key at a time and decide whether it should use batchedQuery or a single multi-key server query.

Frequently Asked Questions about batched-queries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I batch multiple single-key reads into one query?▼

Use batchedQuery in the browser where many components each read one key as they mount, such as list rows or lobby parties. Every call made in the same moment merges into one read of all keys, so twenty reads become one.

When should I use batchedQuery vs a multi-key server query?▼

Use batchedQuery only in the browser where calls reliably arrive together. On the server, read many keys with one direct query like readCaughtMany or where id = any(${ids}), which is simpler and runs inside the transaction.

Why should I avoid batching queries across server requests?▼

Serverless instances mean separate requests may never land together, so the batch only adds a timer. When they do land together, one failed query fails every request in the batch, including other players' requests.

Can I use batchedQuery inside a database transaction?▼

No. The batched read runs a moment later on its own connection, without the transaction's locks or its writes. Inside a transaction, query many keys directly with a single list-based query instead.

How do I configure batchedQuery for object keys and URL-limited reads?▼

Provide a key option for object queries since only identical objects dedupe without it, and set a limit such as 50 for reads that put ids in a URL like Supabase .in('id', ids). Have the callback return a Map keyed by id for O(1) lookup.