Julian1001
Julian1001
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Julian1001 on 1/14/2024 in #questions
Efficient Strategies for Updating Notification Badge in Next.js: Polling vs Server-Sent events
I'm creating a bell icon in a header component with a badge to show unread notifications. The header is part of the layout displayed on every page, I'm unsure how to update it due to the cache. I don't need the badge to show instantly when there is an update; there can be a short delay. In terms of approach If I create a server component that grabs the unread count, it stays the same unless you hard refresh the page. If I do a client component that polls an API route, it would be inefficient. If I use server-sent events, then every user would open up a connection to the API route with the unread count, so that would be a lot of connections. Can anyone think of something simpler?
1 replies
DTDrizzle Team
Created by Julian1001 on 6/19/2023 in #help
Introspect command failing
I'm setting up Drizzle for the first time, I'm trying to get the introspect command to run with mysql / planetscale. When I run introspect I get "Expected undefined or a fully resolved URL string to be returned for the "responseURL" from the "drizzle-kit/loader.mjs 'load'" function but got instance of String.". Has anyone seen this one before? package.json
"scripts": {
"introspect": "drizzle-kit introspect:mysql"
}
"scripts": {
"introspect": "drizzle-kit introspect:mysql"
}
Config
export default {
schema: './src/db/*',
out: './drizzle',
driver: 'mysql2',
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
},
} satisfies Config
export default {
schema: './src/db/*',
out: './drizzle',
driver: 'mysql2',
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
},
} satisfies Config
17 replies