tldraw
@tldraw.com
7 months ago This is so wild btw
💬 0
♻️ 0
❤️ 4
This is so wild btw
Yes, already >50% of tickets gone!
If you're using Postgres, you don't need a separate database to deal with documents.
JSONB in Postgres gives you document-store flexibility + ACID compliance + fast GIN indexes, all without adding complexity to your stack.
You don't need to split your data across DBs when PG already solves it ✌️
That's where @effect-ts.bsky.social shines. I'm using it for this particular use case extensively in various projects where the same code is used across web/node/service workers.
Even natively supports transferable objects (i.e. moving memory instead of copying).
Here is an example schema:
Want to get a sense of what the Tuist team and our community find interesting in the Swift ecosystem and beyond? Click subscribe 😉 tuist.dev/newsletter
Clerk’s Next.js SDK utilizes middleware to protect routes, but did you know you can build your own middleware for security, logging, and many other use cases?
Learn all about Next.js middleware and how you can use it in our latest article:
clerk.com/blog/what-i...
Check out our Live Preview docs:
directus.io/docs/guides...
Tired of the "publish-and-pray" method when building sites?
That's why we built Live Preview!
• Watch your changes appear instantly on your actual site
• Preview on desktop AND mobile without deploying
• Share preview links and get team feedback in seconds
No surprises – just save and see. 🧑🏻🍳💋
ugggghhhh i feel good for the readcv folks but man this is a bummer read.cv/a-new-chapter
Prisma Postgres offers a lot more than realtime as well. Check out what you can get done with a Prisma Postgres database 🚀
pris.ly/ppg
If you'd like to see a deeper dive on integrating the realtime features of Prisma Postgres into your Next.js application, have a look at our video tutorial ✌️
youtu.be/di_xN8D7eAU
Now let's say there's some other systems operating which are responsible for making the database write for new messages.
When they do, those new messages will go to our screen immediately 🙌
The key in the `streamNewMessages` function is that we're looking for any events with a type of `create` and then emitting the data from that event (using `event.created`).
Now we can pick this up in the client and set new messages to be rendered 👀
To get realtime happening in the browser based off of new events from the database, we can use something like socket.io.
Let's run a small side server which looks for database change events and emits them with socket.io.
At this point, we're able to receive events that happen when changes occur in our database 🎉
But we're not yet set to have them automatically show up in the browser when new messages come in.
Next, extend Prisma Client to use Prisma Pulse.
We can use the `extends` method for this and pass `withPulse` to it.
Once that's in place, grab the Prisma Pulse extension from npm.
Copy over the `DATABASE_URL` and `PULSE_API_KEY` to the .env file in your Next.js project.
MessageBox is a simple inbox.
We want to have some realtime features in it so that new messages show up without a refresh!
We can do this easily with Prisma Postgres.
Grab a new project at console.prisma.io
🧵 Let's build a quick realtime inbox with @nextjs and Prisma Postgres
an ai agent that runs on your desktop and has its own cursor and constantly sabotages your work, writing 'later nerds' at the end of emails right before you hit send, closing windows randomly, signing up for online games and doing all the in-app purchases
🤔 Is Prisma ORM slow?
Prisma ORM has received countless performance improvements over the years
📊 And we've even measured with benchmarks
Here's a short recap of what we've done, where we're at, and where we're going 👇
youtu.be/z_sfTz5S3SU
impersonation system not working well