DennisK
DennisK
Explore posts from servers
PPrisma
Created by samuelcole on 9/10/2024 in #help-and-questions
Optimize is not showing queries
Nope sorry, it is not OS.
32 replies
PPrisma
Created by DennisK on 9/10/2024 in #help-and-questions
Prisma Transactions stops working once you extend the client with Pulse, Optimize or Accelerate
It is just so buggy. You need to extend the client like this in order to get $on and $transaction to work. But when you will do that, the Extensions are not being picked up by the LSP or even not functioning at all
const client = new PrismaClient({
log: [
{ level: 'query', emit: 'event' },
{ level: 'error', emit: 'stdout' },
{ level: 'warn', emit: 'stdout' },
],
})

client.$extends(withAccelerate())
client.$extends(
withPulse({
apiKey: process.env.PULSE_API_KEY,
}),
)
client.$extends(withOptimize({ apiKey: process.env.OPTIMIZE_API_KEY }))

client.$on('query', async (e) => {
if (e.duration < logThreshold) return
const color =
e.duration < logThreshold * 1.1
? 'green'
: e.duration < logThreshold * 1.2
? 'blue'
: e.duration < logThreshold * 1.3
? 'yellow'
: e.duration < logThreshold * 1.4
? 'redBright'
: 'red'
const dur = chalk[color](`${e.duration}ms`)

console.info(`prisma:query - ${dur} - ${e.query}`)
})
const client = new PrismaClient({
log: [
{ level: 'query', emit: 'event' },
{ level: 'error', emit: 'stdout' },
{ level: 'warn', emit: 'stdout' },
],
})

client.$extends(withAccelerate())
client.$extends(
withPulse({
apiKey: process.env.PULSE_API_KEY,
}),
)
client.$extends(withOptimize({ apiKey: process.env.OPTIMIZE_API_KEY }))

client.$on('query', async (e) => {
if (e.duration < logThreshold) return
const color =
e.duration < logThreshold * 1.1
? 'green'
: e.duration < logThreshold * 1.2
? 'blue'
: e.duration < logThreshold * 1.3
? 'yellow'
: e.duration < logThreshold * 1.4
? 'redBright'
: 'red'
const dur = chalk[color](`${e.duration}ms`)

console.info(`prisma:query - ${dur} - ${e.query}`)
})
Makes me really wonder if it's worth the risk paying for these products for a production grade app
4 replies
PPrisma
Created by samuelcole on 9/10/2024 in #help-and-questions
Optimize is not showing queries
I have the same
32 replies
PPrisma
Created by DennisK on 9/10/2024 in #help-and-questions
Whenever you extend your PrismaClient with Pulse, you don't have access to $on anymore. Why?
No description
3 replies
PPrisma
Created by DennisK on 9/10/2024 in #help-and-questions
Supabase with Pulse and Accelerate
All right. So there is no connection pooler connection anymore since I also used the 5432 one to connect Supabase with Accelerate. Leaves the question: What is this connection pooler (the one of Supabase) actually doing? I am missing the knowledge so just asking 🙂 And will it be compatible with Prisma in the near future?
4 replies
PPrisma
Created by DennisK on 9/9/2024 in #help-and-questions
Is SQlite supported any time soon? Pulse & Accelerate
Ok! No worries. I am migrating all over to Supabase Postgres and using Pulse like this. Hope Supabase support will improve soon
4 replies
NNovu
Created by DennisK on 5/17/2024 in #💬│support
Does invoking a new Novu client hold a open connection?
Thanks! All is working.
8 replies
TTCTheo's Typesafe Cult
Created by DennisK on 9/5/2023 in #questions
Admin routes and security. How to set this up?
Ok thanks 🙂
9 replies
TTCTheo's Typesafe Cult
Created by DennisK on 8/8/2023 in #questions
Vercel builds errorring out due to Invalid Vercel URL.
Thanks! Fixed it
5 replies
TTCTheo's Typesafe Cult
Created by DennisK on 7/21/2023 in #questions
Eslint config is not picked up??!
deleted the whole overrides array and added
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
3 replies
TTCTheo's Typesafe Cult
Created by Simvolick on 7/7/2023 in #questions
headless cms to use with t3 stack?
love it
21 replies
TTCTheo's Typesafe Cult
Created by Simvolick on 7/7/2023 in #questions
headless cms to use with t3 stack?
sanity is even more customisable imo
21 replies
TTCTheo's Typesafe Cult
Created by machina on 7/17/2023 in #questions
Best sources for UI inspiration?
5 replies
TTCTheo's Typesafe Cult
Created by blackbriarmead on 7/13/2023 in #questions
Thoughts on Million.js?
Which is a great concept, but not just there. A lot of analytic issues will pop up when you will do that @lopen3
14 replies
TTCTheo's Typesafe Cult
Created by DennisK on 7/14/2023 in #questions
Loading state when quering profile data
Thanks! Look into that 🙂
5 replies