Better Programming

Advice for programmers.

Follow publication

Member-only story

Using the Diesel ORM for a Web App With Rocket

applied.math.coding
Better Programming
Published in
9 min readMay 11, 2022

In one of my previous stories (see here), we have looked at an example of implementing a small web app by using the Rocket framework.

This web app did host the assets of a client app and provided a small API. Now, we are going to extend this by adding a database (PostgreSQL) together with the ORM named Diesel. Moreover, we will look into how to bundle this all together as a shareable web app by means of docker-compose.

General goal:

Let us summarize here what parts of the application we are planning to add. Remember, so far our application provides an endpoint that allows computing the convex hull of a given set of points.

Let us add the following things:

  1. allow saving a result from the above-mentioned endpoint
  2. allow to GET all results in order to list them at the UI
  3. allow to DELETE results
  4. allow to UPDATE a display name of a result

Setup

Of course, a useful thing when developing this is to have a PostgreSQL DB running in the background. You don’t need to install any locally on your system but instead just use a configured docker…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

applied.math.coding
applied.math.coding

Written by applied.math.coding

I am a Software Developer - Java, Rust, SQL, TypeScript - with strong interest doing research in pure and applied Mathematics.

Write a response