SQLx is my favorite PostgreSQL driver to use with Rust.

preview_player
Показать описание
SQLx is perhaps my favorite Rust crate for interfacing with Postgres, my favorite relational database. It provides a number of features and support that I haven't been able to find in an asynchronous framework.

In this video, I take a look at the basic usage and also some of the more advanced features that are available with feature flags.

This should provide a decent tutorial for anyone who is looking for a database driver for their Rust project.

My socials:

#rust #postgresql #coding #tutorial #tokio

00:00 Intro
00:10 Getting started
02:10 Migrations
03:34 Writing data
04:46 Reading Data
06:46 Transactions
07:36 Feature Flags
09:05 Notifications
09:24 Outro
Рекомендации по теме
Комментарии
Автор

this was such a good intro to DB handling in rust! definitely demystified a lot the process. i was still learning rust building up to using it for backend development by for some reason was really terrified of how it would be like but honestly its really a reasonable experience and im looking forward to getting to that point.

k_
Автор

if anyone else the " the trait `Executor<'_>` is not implemented " when you do "&mut txn" it's a recent change, for now you have to "&mut *txn" instead. took me a little to long to figure that out :^)

ruleofnine
Автор

Really love your videos. Rust and Postres are just best. keep it up!

sprez
Автор

I was having a horrific day trying to connect to my AWS Postgres db in Rust, until this video. Thank you!!

coderaiders-yt
Автор

Thanks for this! Got me up to speed much more quickly than the docs.

chuckocheret
Автор

These tutorials are brilliant. Keep going you have something here :)

UthpalaHeenatigala
Автор

Came from diesel headache. Great content. Subscribed..

ikay
Автор

Thank you very much for the video, I was even looking for one that explained the use of sqlx.

gustav_spin
Автор

Nice! Thanks for the video! It helped me a lot with a small project that I had to move from SQLite to Postgres coming from a JS background.

vlad
Автор

I don’t think you need turbofish for query_as. I find it much more convenient to just add type annotation to the variable declaration, ie`let book: Book = …`

God I love ocaml-ish/haskell-ish type deduction of rust.

yapet
Автор

Really dig the video. Dig all of your vids actually. I just have one question: what next? I get this is more of a theory driven video, showing how interacting with a Postgres database can be done via Rust using a rust crate but how might one use something like this in a real application outside of just changing the params and CRUD code in your IDE? Maybe showing what it takes to have a JavaScript front end that invokes a Rust backend? Or even just a command line interaction?

jacoblaney
Автор

Why do you have the query on two seperate lines? Eg q=“” query=sqlx::query(q)

TheBurntHoney
Автор

Nice video! How the code is written remind me a lot of how I did things in PHP back in the day so it was very easy to understand.

jmonify
Автор

Man, you're a blessing. I don't really care about Rust that much tbh, but I just love your videos

minzmango
Автор

the density of knowledge is insane, keep it up!

I really like your rust videos. Have you thought about creating rust + iced video or any other idiomatic rust gui lib?

sergp
Автор

Very good video, cant believe im excited to test an sql package

tumi_tigur
Автор

Hey, think you missed to mention the cargo sqlx prepare command, and offline mode.

luiscarlosjayk
Автор

Really love the content ! Funny, informative and on point. Keep up the great work

Floppix
Автор

A thumbs up solely for the mean girl's reference. solid and informational material but yeah, mean girls.

peterboshe
Автор

Hey, unrelated question/suggestion: would you be willing to create a video covering your setup (tooling, apps, themes, best practices, anything usefuf/interesting in regards to software/hardware.)? If so, that would be dope. :)

vencler