Diesel ORM - Rust + Actix Web + PostgreSQL

preview_player
Показать описание
This video covers how to setup data persistence in an Actix Web API in Rust using the Diesel ORM to connect to a PostgreSQL Database. You'll also learn how to fix a couple tough-to-crack bugs.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

00:00 Introduction
00:56 Install Dependencies
02:44 Diesel Setup
13:52 GET /users
26:06 GET /users/{id}/articles
34:49 POST /users/{id}/articles
45:25 Thanks for watching!

-~-~~-~~~-~~-~-
Please watch: "Rust API Documentation Made Easy - Swagger + Actix Web"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

There is a new wave of rust developers we need more tutorials like this on YouTube! Thanks

perc-ai
Автор

*finally* a tutorial that uses cargo add instead of telling me to manually type in versions in my cargo.toml that are probably already out of date

raphaelmorgan
Автор

This video is exactly what I needed, thank you

dopeboy
Автор

This video is a more extended way to implement REST API using `actix-web`. In the recent version, there is no need of `actor` crate unless the websocket development is to be done.
Applicable for Rust 1.59 or later.

abhiorig
Автор

bravo! A masterpiece for prepared minds:)

kaan
Автор

Excellent and timely. Thank you. How would you handle dates, though? Kind of important. You also need to put a Thank You tip jar on your videos. They are that valuable to me.

glennmiller
Автор

Can you tell me why I need to wrap diesel pool into actor and then pass it as app_state. Im new to actix web but to me seems that actix do this for every appstate under the hood.
Is there any reason that force you to do it like that ?

дасизнаеш
Автор

thanks for video, but why you use Diesel, not SeaOrm?

Hessenar
Автор

What's the purpose for passing the app state to every route? Data integrity maybe?? I come from .NET where the db context is directly injected into the controller.

sawood
Автор

Is it right to say that cqrs pattern is used in this video ? (I'm a bit confused by the part of sending event to the database)

metatronicx
Автор

No. Don't use actix actor inside actix-web. The next major release of it would look to remove actor completely from default setup.

realsong-fake
Автор

Do you mind changing the theme Red color is unreadable ang hurting my eyes. Also keyboard sound is a bit high :). Content is top notch no issues there.

alpaslaneldemir
Автор

how to do the same for delete function?

piushpaul
Автор

My guy, you do know that rust analyzer exists right?

altaccacc
Автор

incredible. watched 3-4 tutorieals on diesel, and none of you thought it would be a good idea to demo filters? Which makes me think it's badly implemented or doesn't work.. Why would you need a database if you never use any filters on it. Just save it in a file then...

DavidSmith-efeh