Project to demonstrate how to use the popular Rust ORM Diesel in Ruby.
- Ruby 2.7.5+ or 3.1.1+
- Rust 1.60.0+ (nightly)
- Postgres 11+
-
Ensure the Diesel CLI is setup:
cargo install diesel_cli --no-default-features --features postgres
-
Modify or ensure credentials in
.env
has access to create a database -
Create database and structure:
diesel database setup
-
Install gem dependencies
bundle install
-
Make sure the gem builds and everything passes:
bundle exec rake
time ./bin/stress_test_motor > /dev/null
real 0m1.581s
user 0m1.168s
sys 0m2.307s
time ./bin/stress_test_activerecord > /dev/null
real 0m4.152s
user 0m3.004s
sys 0m1.797s