If you enjoyed watching this video, make sure to like and subscribe so you don't miss out on any future videos. Check out this video if you'd like to learn more about Neon database branching: kzbin.info/www/bejne/oGW5kp5qf5Zjgbc Drizzle ORM Docs: orm.drizzle.team/docs/overview Neon Serverless Driver: github.com/neondatabase/serverless
@tzuilee5888 ай бұрын
Thank you for your clean explanation and taking the time to answer questions in comments below, its super helpful! 😁
@06_abdifatahdahir1411 ай бұрын
thank you for these information i wish you will made a video about how we can handle transactions
@neondatabase10 ай бұрын
If you would like to do interactive transactions, you can use the websocket version of the driver. Here's an example: github.com/neondatabase/serverless/tree/main?tab=readme-ov-file#example-nodejs-with-poolconnect - Mahmoud
@Next-JsАй бұрын
Thank you, very good!
@sherhasan8896Ай бұрын
very helpful video thanks
@PlayerRPG8510 ай бұрын
Subscribing because the host is a cool guy
@rawnato2 ай бұрын
Hey man! Very nice video! I’m thinking to create some kind of project using CF! Can you share some ideas of costs that you have on CF! Just to have some knowledge about it! Another idea that can be a nice idea for a video, it’s a next-auth with this hono serverless api integration!
@yourlinuxguy10 ай бұрын
Can you tell how to access the env vars outside the get method? I read the docs but couldn't understand.
@yogyyconst10 ай бұрын
did you find out ?
@antonym0010 ай бұрын
You can’t, because the server might be dead, and needs to start, so access is done in the method (if I understood the GitHub issue correctly)
@yourlinuxguy10 ай бұрын
@@antonym00Yes, you're correct.
@saket379 ай бұрын
What would be the right way to handle the db initialisation? Do I write the two lines in every single api single I need the env variables (since we are using hono)? Do I create the db in a middleware and then add that to hono context? What is the right way here?
@adityaparghi-j8e3 ай бұрын
Hello can anyone please answer this, when i run npm create cloudflare --name and i select cloudflare workers , typescript, deploy no and when i go to vs code and run npm run dev it throws error errono -4095 i done everything uninstall Wrangler, install it again but it just doesn't work how can resolve this if anyone help
@yogyyconst10 ай бұрын
do i need to write this every endpoint need query/insert to db? const client = new Client({ connectionString: c.env.DATABASE_URL }); const db = drizzle(client); await client.connect();
@neondatabase10 ай бұрын
Yes. In serverless environments such as Vercel Edge Functions or Cloudflare Workers, WebSocket connections can't outlive a single request. That means Pool or Client objects must be connected, used and closed within a single request handler. Don't create them outside a request handler; don't create them in one handler and try to reuse them in another; and to avoid exhausting available connections, don't forget to close them. Here's a code example github.com/neondatabase/serverless?tab=readme-ov-file#example-nodejs-with-poolconnect - Mahmoud
@marvinkr10 ай бұрын
So we can use this to connect to multiple frontend? (eg. NextJS web app, React Native mobile app)
@neondatabase10 ай бұрын
>connect to multiple frontend If you mean that different frontends can interact with the API, then yes. It's basically an API endpoint that any client can interact with - Mahmoud
@lifanhuang31817 ай бұрын
Hi, I have a suggestion with the Neon authorization 3rd party APPs part. I found that you authorized Cloudflare to read the Neon project, and then Cloudflare could fetch the DB password with such permissions. I think it's necessary to add a explicit hint at the authorization page, that the Read permission can see your DB password.
@시Ай бұрын
hono, drizzle, and neon are good choices, but cloudflare workers should be careful. The 50ms computing time limit is too short for hashing and encryption tasks such as password hashing. on the other hand, aws lambda can use 15 minutes
@ElenaBG316 күн бұрын
Serverless this, serverless that...
@jamesfoley44265 ай бұрын
Adding the db:generate command to package.json. I could not get the shortcut working that is demoed in the video I had to use drizzle-kit generate --dialect=postgresql --schema=./src/db/schema.ts just in case you run into the same issue great video tutorial