Thanks for wanting to contribute to Diesel! We are very much looking forward to your suggestions, bug reports, and pull requests.
Aside from Github, we have an active Gitter channel, where you can ask questions and get help on how to use Diesel. Feel free to ask there before opening an issue or pull request on Github.
Remember: Anyone who interacts with Diesel in any space including but not limited to this GitHub repository is expected to follow our code of conduct.
Have a look at our issue tracker. If you can't find an issue (open or closed) describing your problem (or a very similar one) there, please open a issue with the following details:
Thank you! We'll try to get back to you as soon as possible.
If you can't find an issue (open or closed) describing your idea on our issue tracker, open an issue. It would be great if you could answer the following questions in your description:
Thank you! We'll try to get back to you as soon as possible.
Install Rust using rustup, which allows you to easily switch between Rust versions.
Install the system libraries needed to interface with the database systems you which to use.
These are the same as when compiling diesel. In general, it is a good idea to have all drivers installed so you can run all tests locally.
Shortcut: On macOS, you don‘t need to install anything to work with SQLite and for PostgreSQL you’ll only need the server (libpq
is installed by default). So, to get started, brew install postgresql mysql
and follow the instructions shown to set up the database servers.
Clone this repository and open it in your favorite editor.
Create a .env
file in the diesel/
directory, and add the connection details for your databases.
For example:
PG_DATABASE_URL=postgresql://localhost/diesel_test SQLITE_DATABASE_URL=/tmp/diesel_test.sqlite MYSQL_DATABASE_URL=mysql://localhost/diesel_test MYSQL_UNIT_TEST_DATABASE_URL=mysql://localhost/diesel_unit_tests
Note: If you didn‘t specify the MySQL user to be one with elevated permissions, you’ll want to a command like mysql -c "GRANT ALL ON `diesel_%`.* TO ''@'localhost';" -uroot
, or something similar for the user that you've specified.
Now, try running the test suite to confirm everything works for you locally by executing bin/test
. (Initially, this will take a while to compile everything.)