{"_id":"@appu2778/prisma-query-lens","_rev":"4-07db30de7a916d5f9bcff93e2b230f46","name":"@appu2778/prisma-query-lens","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.3":{"name":"@appu2778/prisma-query-lens","version":"1.0.3","keywords":["prisma","query","analyzer","static-analysis","typescript","n+1","sql"],"author":{"name":"appu2778"},"license":"MIT","_id":"@appu2778/prisma-query-lens@1.0.3","maintainers":[{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"}],"bin":{"query-lens":"bin/start.js"},"dist":{"shasum":"704b08d55b53b45d040daba91f45b7e5bc4e77f5","tarball":"https://registry.npmjs.org/@appu2778/prisma-query-lens/-/prisma-query-lens-1.0.3.tgz","fileCount":6,"integrity":"sha512-F0+So17qP/3vxYwIxytie53JLeQPFUnQYRSRaL21nLCO4Ucc0yXekyN6OxgTK8w+w1la6Vq0XsoMI3FY6SNIZQ==","signatures":[{"sig":"MEUCIFkmXFM+kkh1GKUR7cygmsPZRpi+vEAN//Er+Mw92sRQAiEA4wNhrjQb9qp0MOvtayxX37zIeI9DK5tA3B1rBsIIeJU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40357},"main":"server.js","engines":{"node":">=18.0.0"},"scripts":{"start":"node server.js"},"_npmUser":{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"},"_npmVersion":"10.9.2","description":"Find all Prisma queries inside any function — including sub-functions — via a browser UI","directories":{},"_nodeVersion":"22.17.0","dependencies":{"ts-morph":"21.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/prisma-query-lens_1.0.3_1778697496756_0.4739650533940838","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@appu2778/prisma-query-lens","version":"1.0.5","keywords":["prisma","query","analyzer","static-analysis","typescript","n+1","sql"],"author":{"name":"appu2778"},"license":"MIT","_id":"@appu2778/prisma-query-lens@1.0.5","maintainers":[{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"}],"bin":{"query-lens":"bin/start.js"},"dist":{"shasum":"087dc890e3a5b2c513f624a1ce9bbafe669f2cec","tarball":"https://registry.npmjs.org/@appu2778/prisma-query-lens/-/prisma-query-lens-1.0.5.tgz","fileCount":14,"integrity":"sha512-r6AYRSbvkRavB80UExcr8l85Wcb9C7/zXpRC4t619JVBvSr9nvswSyjieuh8bQZI3VZFnzkP9o2LTKFeINz9Lw==","signatures":[{"sig":"MEQCIFz5t8GgiZ1S6kMGrLOH6CJzqOVe1AKrcFUD028mzkTqAiA1MadOQO94JdOz/lxxIOa9S8TbwX8nH2mQtSZAWdp5Tg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":525045},"main":"server.js","engines":{"node":">=18.0.0"},"scripts":{"dev":"vite","test":"node --test \"cli/tests/*.test.js\"","build":"vite build","start":"node server.js"},"_npmUser":{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"},"_npmVersion":"10.9.2","description":"Find all Prisma queries inside any function — including sub-functions — via a browser UI","directories":{},"_nodeVersion":"22.17.0","dependencies":{"dagre":"0.8.5","react":"18.3.1","ts-morph":"21.0.1","react-dom":"18.3.1","reactflow":"11.11.4"},"_hasShrinkwrap":false,"devDependencies":{"vite":"5.4.11","jsdom":"^29.1.1","vitest":"2.1.8","fast-check":"3.22.0","typescript":"5.6.3","@types/dagre":"0.7.52","@types/react":"18.3.12","@types/react-dom":"18.3.1","@vitejs/plugin-react":"4.3.1","@testing-library/react":"16.0.0","vite-plugin-singlefile":"2.1.0","@testing-library/jest-dom":"6.6.3","@testing-library/user-event":"14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/prisma-query-lens_1.0.5_1778961815627_0.4872775724006724","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@appu2778/prisma-query-lens","version":"1.0.6","keywords":["prisma","query","analyzer","static-analysis","typescript","n+1","sql"],"author":{"name":"appu2778"},"license":"MIT","_id":"@appu2778/prisma-query-lens@1.0.6","maintainers":[{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"}],"bin":{"query-lens":"bin/start.js"},"dist":{"shasum":"040b3f63d629e76f8c6b415eed5b205483e5eb2c","tarball":"https://registry.npmjs.org/@appu2778/prisma-query-lens/-/prisma-query-lens-1.0.6.tgz","fileCount":17,"integrity":"sha512-AHa8bALyoAdqHI8z9KlJUGu4yANot9pkezrMAEhU6I4px9vcRP83oGh0NYtdox8+LvZB4wS2938tRzEpENyCRg==","signatures":[{"sig":"MEUCICbTfPKaq1nU2eD9B2fo90FskSIVPrlNcRAsO+SkKQZmAiEArQwNoUZSelhmbaotLKvpSwOsbFOqZji23yRrrcEEtJw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":552189},"main":"server.js","engines":{"node":">=18.0.0"},"scripts":{"dev":"vite","test":"node --test \"cli/tests/*.test.js\"","build":"vite build","start":"node server.js"},"_npmUser":{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"},"_npmVersion":"10.9.2","description":"Find all Prisma queries inside any function — including sub-functions — via a browser UI","directories":{},"_nodeVersion":"22.17.0","dependencies":{"dagre":"0.8.5","react":"18.3.1","ts-morph":"21.0.1","react-dom":"18.3.1","reactflow":"11.11.4"},"_hasShrinkwrap":false,"devDependencies":{"vite":"5.4.11","jsdom":"^29.1.1","vitest":"2.1.8","fast-check":"3.22.0","typescript":"5.6.3","@types/dagre":"0.7.52","@types/react":"18.3.12","@types/react-dom":"18.3.1","@vitejs/plugin-react":"4.3.1","@testing-library/react":"16.0.0","vite-plugin-singlefile":"2.1.0","@testing-library/jest-dom":"6.6.3","@testing-library/user-event":"14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/prisma-query-lens_1.0.6_1779008233461_0.1554298882585563","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@appu2778/prisma-query-lens","version":"1.0.7","description":"Find all Prisma queries inside any function — including sub-functions — via a browser UI","main":"server.js","bin":{"query-lens":"bin/start.js"},"scripts":{"start":"node server.js","test":"node --test \"cli/tests/*.test.js\"","build":"vite build","dev":"vite"},"keywords":["prisma","query","analyzer","static-analysis","typescript","n+1","sql"],"author":{"name":"appu2778"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/thepandeyaarpit/prisma-query-lens.git"},"engines":{"node":">=18.0.0"},"dependencies":{"dagre":"0.8.5","react":"18.3.1","react-dom":"18.3.1","reactflow":"11.11.4","ts-morph":"21.0.1"},"devDependencies":{"@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.0.0","@testing-library/user-event":"14.5.2","@types/dagre":"0.7.52","@types/react":"18.3.12","@types/react-dom":"18.3.1","@vitejs/plugin-react":"4.3.1","fast-check":"3.22.0","jsdom":"^29.1.1","typescript":"5.6.3","vite":"5.4.11","vite-plugin-singlefile":"2.1.0","vitest":"2.1.8"},"_id":"@appu2778/prisma-query-lens@1.0.7","gitHead":"c34baecb6477c85c852b6463ca86c70216600d19","bugs":{"url":"https://github.com/thepandeyaarpit/prisma-query-lens/issues"},"homepage":"https://github.com/thepandeyaarpit/prisma-query-lens#readme","_nodeVersion":"22.17.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-tPy0jMRsK3KhSjJbQXDi4hiGHCEoLJTC4MTI3tSJYqg/yfWCFekpDB5Om0UC/jp60TaWbg/AAfvrNC7Tu+EJBg==","shasum":"b887957436301d67a1ca15c882c90b75e6393fb5","tarball":"https://registry.npmjs.org/@appu2778/prisma-query-lens/-/prisma-query-lens-1.0.7.tgz","fileCount":17,"unpackedSize":552310,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCs7LoyFh+FYkGG85NWZz9FA5aTHYLH/K53udHDkwmLWQIgfy9ntJn1puc+SI1rqJ/+Bn2NFMS9NnOsMmzn6nj/FUw="}]},"_npmUser":{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"},"directories":{},"maintainers":[{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prisma-query-lens_1.0.7_1779811111484_0.5232181566249849"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T18:38:16.677Z","modified":"2026-05-26T15:58:31.799Z","1.0.3":"2026-05-13T18:38:16.931Z","1.0.5":"2026-05-16T20:03:35.837Z","1.0.6":"2026-05-17T08:57:13.646Z","1.0.7":"2026-05-26T15:58:31.699Z"},"author":{"name":"appu2778"},"license":"MIT","keywords":["prisma","query","analyzer","static-analysis","typescript","n+1","sql"],"description":"Find all Prisma queries inside any function — including sub-functions — via a browser UI","maintainers":[{"name":"appu2778","email":"writetoarpitpandeya@gmail.com"}],"readme":"# 🔍 Query Lens v1.4.0\n\n**Visualize and Optimize Prisma Query Execution Flows in Real-Time.**\n\nQuery Lens is a powerful developer tool that analyzes your codebase to find every Prisma query triggered by a specific function, including all sub-functions and nested calls. It provides both an interactive visual graph and a detailed list view to help you identify performance bottlenecks like N+1 risks.\n\n---\n\n## 🆕 Recent CLI Upgrades & Updates (v1.4.0)\n\nQuery Lens has been upgraded with a powerful, developer-friendly **Interactive CLI Optimizer & Autofixer**!\n\n### ⚡ Key Interactive CLI Additions:\n\n- **Interactive CLI REPL**:\n  Launch the CLI tool in any target project terminal with `query-lens --cli` to search queries and inspect optimizations inside a live REPL.\n- **Deterministic Offline N+1 Loop Batching Auto-Fixer**:\n  No API keys required! Query Lens features a highly sophisticated AST transformation engine. When you run `use query <id> and auto-fix` on an N+1 loop warning, it automatically rewrites performance-bottlenecked loops, moves individual Prisma calls out of loops, batches primary keys (like UUIDs/IDs), and implements bulk operations like `updateMany` or `findMany` with `in` filters.\n- **Restored Grok AI Optimization & Autofixer (Optional)**:\n  Integrate your xAI Grok API key inside a global `.env` file to leverage advanced context-aware AI rewrites on complex query blocks.\n- **Global Key Configurations**:\n  Configure your developer credentials once inside the Query Lens tool folder (`query-lens-web/.env`) to use the credentials across all project workspaces seamlessly.\n- **Premium Clean Local Fallback**:\n  Beautiful, developer-friendly UX fallback indicators silence complex error stacks during network or billing limitations, providing a polished terminal feel.\n\n---\n\n## 🚀 Key Features\n\n### 📊 Interactive Execution Graph\n\n- **Visual Flow**: See your entire execution path mapped out as a directed graph.\n- **Intelligent Highlighting**: Click any node to highlight its downstream children and fade out unrelated paths.\n- **Interactive MiniMap**: Navigate complex graphs with ease using the pannable and zoomable mini-map.\n- **Auto-Layout**: Built-in `dagre` layout engine ensures clean, readable graphs regardless of complexity.\n\n### 📜 Classic List View\n\n- **Structured Metadata**: View exact line numbers, file paths, and call depths for every query.\n- **Operation Insights**: Color-coded badges for different operation types (Read, Create, Update, Delete, Raw).\n- **SQL Inspection**: View the generated SQL for any Prisma query with one click.\n\n### ⚡ Performance & Optimization\n\n- **N+1 Detection**: Automatic visual warnings for queries running inside loops (N+1 risks).\n- **Optimization Suggestions**: Get actionable advice on adding `select`, `take`, or `skip` to improve performance.\n- **Persistence**: Shared state across views ensures your analysis remains intact when switching between Graph and List modes.\n\n### 🌍 Universal Access\n\n- **Terminal Integration**: Run `query-lens` from the terminal of any project to start the analyzer instantly.\n- **Browser-Based UI**: Access all features through a sleek, modern web interface with zero configuration required.\n\n---\n\n## ⚙️ Setup & Usage\n\n### 🌎 Global Installation (Recommended)\n\nYou can install Query Lens globally to use it anywhere on your machine:\n\n```bash\nnpm install -g @appu2778/prisma-query-lens\n```\n\nOnce installed, simply run:\n\n```bash\nquery-lens\n```\n\n### 🛠️ Local Development Setup\n\n1. **Clone & Install**:\n\n```bash\nnpm install\n```\n\n2. **Launch**:\n\n```bash\nnpm start\n```\n\nOpen your browser at `http://localhost:4242`\n\n---\n\n## 📖 How to Use\n\n1.  **Function Name**: Enter the name of the function you want to analyze (e.g., `automaticMessage`).\n2.  **File Path**: Provide the **full absolute path** to the file containing that function.\n    - **Windows Example**: `D:\\myproject\\src\\services\\automatic-message.ts`\n    - **Mac/Linux Example**: `/home/user/myproject/src/services/automatic-message.ts`\n3.  **Workspace Root**: (Optional) Provide the root folder of your project where `package.json` resides.\n4.  **Analyze**: Click the **Analyze** button to start the scan.\n\n---\n\n## 📈 Analytics & Data Points\n\n| Column                | Description                                                            |\n| :-------------------- | :--------------------------------------------------------------------- |\n| **Total Queries**     | Every Prisma query found across all sub-functions in the call chain.   |\n| **N+1 Risks**         | Critical count of queries identified inside loops or iterative blocks. |\n| **Models**            | All Prisma models touched during the execution of the target function. |\n| **Functions Scanned** | The full depth of the call chain followed during analysis.             |\n| **Max Depth**         | The maximum recursion depth reached by the static analysis engine.     |\n\n### Detailed Query Cards\n\nIn the Classic List View, each card provides:\n\n- **Prisma Method**: Precise method used (`findMany`, `create`, `upsert`, etc.).\n- **Model Name**: The target database model.\n- **Query Arguments**: Full visibility into `where`, `select`, `include`, and pagination options.\n- **Location**: The exact function name and line number in the source file.\n- **Generated SQL**: Direct access to the raw SQL output (click \"Show SQL\").\n\n---\n\n## 🏷️ Keywords\n\n`prisma` `query` `analyzer` `static-analysis` `typescript` `n+1` `sql`\n\n---\n\n## 🛡️ License\n\nBuilt with ❤️ by **Arpit Pandeya** for the Prisma Developer Community. MIT License.\n# prisma-query-lens\n","readmeFilename":"README.md","homepage":"https://github.com/thepandeyaarpit/prisma-query-lens#readme","repository":{"type":"git","url":"git+https://github.com/thepandeyaarpit/prisma-query-lens.git"},"bugs":{"url":"https://github.com/thepandeyaarpit/prisma-query-lens/issues"}}