11 releases (7 breaking)

Uses old Rust 2015

0.8.0 Apr 11, 2023
0.7.2 Sep 20, 2021
0.7.1 Jan 21, 2020
0.7.0 Nov 12, 2019
0.5.1 Oct 23, 2018

#39 in #diesel

50 downloads per month

BSD-2-Clause

32KB
446 lines

The limiting-factor crate offers facilities to implement a REST API.

Goal

The goal of this library is to provide:

  • glue code for Rocket and Diesel
  • standard API replies
  • boilerplate to parse environment to extract configuration and run a server

That allows an API or a back-end web server to focus on requests and data model, and to maintain helper methods as a separate library.

Dependencies

  • Diesel, as PostgreSQL ORM, with r2d2 support to pool connections
  • Rocket, as web framework
  • Chrono, for date and time types

Compile

Windows

You need to give to rustc some hints about where libpq.lib is.

The pq-sys crate offers a build script to find the library and then print the relevant hints.

You can manually set your PostgreSQL library folder with:

export PQ_LIB_DIR="C:\Program Files\PostgreSQL\13\lib"
cargo run

Credits

The glue code to use Rocket with Diesel is adapted from the Rocket guide. See https://rocket.rs/guide/state/#databases. Guide author: Sergio Benitez.

Dependencies

~10–18MB
~270K SLoC