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:

Eleventy Adoption Guide: Overview, Examples, And Alternatives

Eleventy adoption guide: Overview, examples, and alternatives

Eleventy (11ty) is a compelling solution for developers seeking a straightforward, performance-oriented approach to static site generation.

Nelson Michael
May 7, 2024 â‹… 8 min read
6 CSS Tools For More Efficient And Flexible CSS Handling

6 CSS tools for more efficient and flexible CSS handling

Explore some CSS tools that offer the perfect blend of efficiency and flexibility when handling CSS, such as styled-components and Emotion.

Fimber Elemuwa
May 7, 2024 â‹… 7 min read
Leveraging React Server Components In Redwoodjs

Leveraging React Server Components in RedwoodJS

RedwoodJS announced support for server-side rendering and RSCs in its Bighorn release. Explore this feature for when it’s production-ready.

Stephan Miller
May 6, 2024 â‹… 9 min read
Exploring The Aha Stack: Astro, Htmx, Alpine — A Complete Tutorial With A Demo Project And Comparison To Other Stacks

Exploring the AHA stack: Tutorial, demo, and comparison

The AHA stack — Astro, htmx, and Alpine — is a solid web development stack for smaller apps that emphasize frontend speed and SEO.

Oyinkansola Awosan
May 3, 2024 â‹… 13 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