Comments (5)
Prisma actually uses prepared statements under the hood and also caches and reuses them.
I hence renamed the issue a tiny bit to make this a request for "manually managing" prepared statements.
from prisma.
Prisma actually uses prepared statements under the hood and also caches and reuses them.
I hence renamed the issue a tiny bit to make this a request for "manually managing" prepared statements.
If so, suppose if I have a conditional parameter like this
const isUsername = true
const username = "kavya"
PrismaClient.users.findUnique(
isUsername ? { where: { username } } : { where: { email: username } }
);
// there can be two different prepared sql query which are
// 1) select x,y,z from users where username="kavya"
// 2) select x,y,z from users where email="kavya"
Is this handled by prisma caching mechanism? like which query to select form cache.
It gets even more complicated when using multiple conditional statement in complex queries.
from prisma.
Yes, when executing these different "paths" different queries are generated - and the correct prepared statement from the cache is used for each case.
from prisma.
Alright, that's nice but still we need a manual prepared statement feature to optimize queries further and remove redundant overhead. Are contributors actively working on this?
from prisma.
We at Prisma are not.
from prisma.
Related Issues (20)
- TypedSQL for Microsoft SQL Server
- License info missing in generated client
- NOT filters with nested nullable relations behave differently for 1:1 and 1:many relations
- deep nested data takes 6-10 min. to be created
- `prisma db pull` doesn't set relation field as optional with `ON DELETE CASCADE` HOT 1
- Getting error when i try to Insert when single table have multiple foreign key in same filed HOT 1
- Error: Could not parse schema engine response: SyntaxError: Unexpected token '/'
- SessionTokenError & PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware
- Relation referencee `String @id @default(dbgenerated("uuidv7()")) @db.Uuid` make relations crash
- Prisma Query Engine has paniced. HOT 1
- Oops, an unexpected error occurred! Error in Schema engine. Reason: ...src\walkers\column.rs:74:61] called `Option::unwrap()` on a `None` value
- About the bug of "findMany" function HOT 2
- @prisma/[email protected] has no exported member "PrismaClient" HOT 2
- Setting include relation to `undefined` returns all relations instead of none HOT 5
- node opentelemetry parent span not respected in prisma.$on('query', ...) HOT 1
- Unable to use prisma in cloudflare workers(serverless) HOT 1
- Add RethinkDB support HOT 1
- Consider not requiring '@prisma/engines' and other packages when running CLI commands HOT 2
- Running ALTER TYPE ... ADD VALUE ... with prisma on cockroachDB causes prisma migrate dev/deploy to hang indefinitely HOT 1
- PNPM update HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma.