Тёмный

Build a Serverless API (Cloudflare Workers, Drizzle ORM, Hono & Neon) 

Neon
Подписаться 2,4 тыс.
Просмотров 14 тыс.
50% 1

Развлечения

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@neondatabase
@neondatabase 7 месяцев назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-j4Vak4J10KU.html Drizzle ORM Docs: orm.drizzle.team/docs/overview Neon Serverless Driver: github.com/neondatabase/serverless
@adityaparghi-j8e
@adityaparghi-j8e 5 дней назад
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
@06_abdifatahdahir14
@06_abdifatahdahir14 7 месяцев назад
thank you for these information i wish you will made a video about how we can handle transactions
@neondatabase
@neondatabase 7 месяцев назад
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
@tzuilee588
@tzuilee588 5 месяцев назад
Thank you for your clean explanation and taking the time to answer questions in comments below, its super helpful! 😁
@lifanhuang3181
@lifanhuang3181 3 месяца назад
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.
@jamesfoley4426
@jamesfoley4426 Месяц назад
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
@yourlinuxguy
@yourlinuxguy 6 месяцев назад
Can you tell how to access the env vars outside the get method? I read the docs but couldn't understand.
@yogyyconst
@yogyyconst 6 месяцев назад
did you find out ?
@antonym00
@antonym00 6 месяцев назад
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)
@yourlinuxguy
@yourlinuxguy 6 месяцев назад
@@antonym00Yes, you're correct.
@PlayerRPG85
@PlayerRPG85 6 месяцев назад
Subscribing because the host is a cool guy
@yogyyconst
@yogyyconst 6 месяцев назад
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();
@neondatabase
@neondatabase 6 месяцев назад
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
@marvinkr
@marvinkr 7 месяцев назад
So we can use this to connect to multiple frontend? (eg. NextJS web app, React Native mobile app)
@neondatabase
@neondatabase 7 месяцев назад
>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
@saket37
@saket37 6 месяцев назад
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?
Далее
The cloud is over-engineered and overpriced (no music)
14:39
You Should Use Hono in your Next Project
13:47
Просмотров 16 тыс.
"Когти льва" Анатолий МАЛЕЦ
53:01
Learn Drizzle ORM in 13 mins (crash course)
14:00
Просмотров 28 тыс.
I Pitched Scam Products
31:50
Просмотров 2,1 млн
Why Am I Moving Off Edge?
13:27
Просмотров 52 тыс.
I Stopped Using Express.js: Because Bun and Hono 🔥
10:23
Drizzle vs Prisma: Which ORM is right for YOU?
5:59
Microservices with Databases can be challenging...
20:52
КОТЯТА В ОПАСНОСТИ?#cat
0:36
Просмотров 1,4 млн
с лазерами не переборщил?
1:00
Просмотров 1,1 млн