{"actions":{"bootstrapAndRun":{"effect":"installs rote if missing, inspects, prepares, and asks before running","href":"https://play.modiqo.ai/install?play=lgoyal6/query-in-loop@1.2.0","method":"GET","rel":"https://rote.dev/rels/bootstrap-and-run","requiresConsent":true,"responseMediaType":"text/x-shellscript"},"inspect":{"command":"rote play inspect https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0","effect":"read-only"},"installCliOnly":{"effect":"installs the rote CLI, nothing else","href":"https://play.modiqo.ai/install","method":"GET","rel":"https://rote.dev/rels/install-cli","requiresConsent":true,"responseMediaType":"text/x-shellscript"},"run":{"command":"rote play run https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0","effect":"executes the play locally after consent","headless":{"approvalAssertion":"--yes","approvalRequiredBeforeInvocation":true,"commandTemplate":"rote play run https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0 <name=value...> --yes","stdinPolicy":"never pipe input to automate the interactive Ready selector"},"requiresConsent":true}},"description":"Answers one question about a codebase: where does it issue a query, or any other call that leaves the process, once per item of a collection it already has. The N+1 query is the most common performance bug in application code and it never shows up on a dev machine with ten rows, so it survives review and arrives in production as a page that takes nine seconds. Four tiers are separated because they are four different conversations: a database query inside a for/while/forEach/comprehension body (cursor.execute, session.query, db.Query, db.QueryRow, prisma.x.findUnique, knex, .findOne, a driver .execute, a repository .findById); an HTTP call or an obviously remote SDK method in the same place (requests, httpx, fetch, axios, http.Get, an LLM or AWS or vendor client); an ORM relationship lazy load, which is the version people cannot see, where iterating a query result and touching a related object issues a SELECT per row unless the query eager-loaded it; and an await inside a sequential for over an array in JS/TS,","distribution":{"digest":"sha256:fcbea88eef06da8e35c784db5cf3f0fabdb40a8a819379439405b8947eec7161","mediaType":"application/vnd.modiqo.rote-flow","size":46181,"verifiedBy":"rote verifies the downloaded archive against this digest before it runs"},"effects":{"credentialsProvidedBy":"runner","credentialsRemainLocal":true,"declaredWrites":[],"publisherReceivesCredentials":false},"id":"https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0","inputPolicy":{"optionalWithDefault":"show_default_and_accept_override","optionalWithoutDefault":"omit_unless_supplied","required":"ask","secrets":"collect_locally_outside_conversation"},"links":{"docs":"https://rote.dev","page":"https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0","protocol":"https://play.modiqo.ai/.well-known/rote","self":"https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0.json"},"name":"query-in-loop","owner":{"kind":"user","slug":"lgoyal6"},"parameters":[{"description":"Directory tree whose sources should be audited for a query or remote call issued once per item","example":".","input":{"allowCustom":true,"choices":[],"label":"Root"},"name":"root","required":true,"type":"string"},{"default":"8","description":"How many directory levels below root to search for source files","example":"3","input":{"allowCustom":true,"choices":[],"label":"Depth"},"name":"depth","required":false,"type":"string"}],"preparation":[{"action":{"command":"rote play inspect https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0 --json","effect":"read-only"},"step":1,"type":"inspect_local_readiness"},{"references":["/parameters"],"step":2,"type":"collect_parameters"},{"references":["/parameters","/requirements","/effects"],"step":3,"type":"review"},{"consentBoundary":"the user approves the exact play and parameter values","references":["/parameters","/requirements","/effects"],"step":4,"type":"obtain_run_consent"},{"action":{"command":"rote play run https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0","headlessCommandTemplate":"rote play run https://play.modiqo.ai/lgoyal6/query-in-loop@1.2.0 <name=value...> --yes"},"preservesAcquisitionBoundaries":["adapter_selection","oauth_dcr","google_discovery","static_token_setup","runtime_security_checks"],"requiresConsent":true,"step":5,"type":"run"}],"producedBy":{"roteVersion":"0.78.0"},"publishedAt":"2026-09-04T04:32:37.118958+00:00","reference":"lgoyal6/query-in-loop@1.2.0","requirements":{"adapters":[],"browser":{"dependencies":[],"runtime":false,"signIn":false},"localTools":["bash","python3","find","grep","sort","wc","tr","cat","mktemp","rm"],"roteCli":{"minimumVersion":"0.62.0"},"sessions":false},"resolution":"pinned","schema":"rote.play.v1","stats":{"downloads":1,"installs":0},"steps":{"count":2,"names":["analyze","discover"]},"title":"query-in-loop","type":"play","version":"1.2.0","visibility":"public"}