Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@prisma/extension-optimize
Advanced tools
This is the package for the [Prisma Client extension](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions?utm_source=github&utm_medium=optimize-readme), which enables the use of Prisma Optimize.
This is the package for the Prisma Client extension, which enables the use of Prisma Optimize.
Prisma Optimize enables developers to profile and get performance-related recommendations while developing applications with Prisma ORM.
It is part of the Prisma ecosystem, alongside other tools such as:
Prisma is leading Data DX, a philosophy that promotes simplicity in data-driven application development. Learn more on the Data DX manifesto.
You can explore Optimize with the following resources:
Prisma Optimize uses Prisma ORM's OpenTelemetry tracing functionality. In the generator
block of your Prisma schema, add the tracing preview feature:
generator client {
provider = "prisma-client-js"
+ previewFeatures = ["tracing"]
}
Then, generate the Prisma Client:
npx prisma generate
Install the latest versions of Prisma Client and the Optimize extension:
npm install @prisma/client@latest @prisma/extension-optimize
Generate an Optimize API key by following the instructions here and add it to your .env file:
OPTIMIZE_API_KEY="YOUR_OPTIMIZE_API_KEY"
Extend your existing Prisma Client instance with the Optimize extension:
import { PrismaClient } from "@prisma/client";
import { withOptimize } from "@prisma/extension-optimize";
const prisma = new PrismaClient().$extends(withOptimize({ apiKey: process.env.OPTIMIZE_API_KEY }));
Follow these steps to start generating query insights with Prisma Optimize:
In the Optimize dashboard, click the Start recording button, then run your app.
After your app runs and insights are generated for the desired queries, click the Stop recording button.
Explore individual query details by clicking on them, and check the Recommendations tab for any suggested improvements to enhance query performance.
NOTE: Use the AI Explainer feature to understand recommendations and apply them within your Prisma model context.
For a hands-on learning experience, try out the step-by-step example.
If you need assistance, reach out in the #help-and-questions channel on our Discord, or connect with our community to see how others are using Optimize.
FAQs
This is the package for the [Prisma Client extension](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions?utm_source=github&utm_medium=optimize-readme), which enables the use of Prisma Optimize.
The npm package @prisma/extension-optimize receives a total of 0 weekly downloads. As such, @prisma/extension-optimize popularity was classified as not popular.
We found that @prisma/extension-optimize demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.