2022-02-22
1839
#postgresql#rust
Olasunkanmi John Ajiboye
16361
Feb 22, 2022 â‹… 6 min read

How to create a backend API with Rust and Postgres

Olasunkanmi John Ajiboye TypeScript and Rust enthusiast. Writes code for humans. From the land of Promise.

Recent posts:

Automate Repetitive Tasks With The Pinion Code Generator

Automate repetitive tasks with the Pinion code generator

Discover how the Pinion code generator automates repetitive tasks and boosts productivity compared to tools like Yeoman, Plop, and Hygen.

Joseph Mawa
May 21, 2024 â‹… 7 min read
Exploring Hurl An Alternative To Postman

Exploring Hurl, a command line alternative to Postman

Hurl is an excellent Postman alternative that improves the DX of working with APIs through the command line.

Nwani Victory
May 20, 2024 â‹… 8 min read
How To Integrate WunderGraph With Your Frontend Application

How to integrate WunderGraph with your frontend application

Unify and simplify APIs using WunderGraph to integrate REST, GraphQL, and databases in a single endpoint.

Boemo Mmopelwa
May 17, 2024 â‹… 5 min read
Understanding The Latest Webkit Features In Safari 17.4

Understanding the latest Webkit features in Safari 17.4

The Safari 17.4 update brought in many modern features and bug fixes. Explore the major development-specific updates you should be aware of.

Rahul Chhodde
May 16, 2024 â‹… 10 min read
View all posts

3 Replies to "How to create a backend API with Rust and Postgres"

  1. There is problem with using diesel as shown in this article – diesel operations are blocking and their are used in async functions – so they will block whole task – as it’ll work with current somehow with current tokio, which is multithreaded – so they will be other executor threads to handle other tasks, it’s still not good practice and should be avoided. Easy fix would be to use spawn_blocking to run diesel ops in separate thread pool. For some details look at this discussion https://github.com/diesel-rs/diesel/issues/399#issuecomment-567004570

  2. That’s really destructive tutorial!

    You shopuld cal blocking code (Diesel) inside `actix_web::web::block` or you would block eventloop.

  3. I’m going to recommend to anyone reading this, to just go straight to the github at the bottom of the article. Almost every step is different than what you read. Also, if you already have git installed, then you already have openssl so don’t worry about that step!

Leave a Reply