An open API service indexing awesome lists of open source software.

https://github.com/justinrubek/nix-sqlx-example

Example of using sqlx in a nix flake, with pre-commit hooks
https://github.com/justinrubek/nix-sqlx-example

example flake nix nix-flake pre-commit rust sqlx

Last synced: 11 months ago
JSON representation

Example of using sqlx in a nix flake, with pre-commit hooks

Awesome Lists containing this project

README

          

# sqlx example

This is a small example of using nix to manage sqlx in a project.
The main benefit of the current configuration is the use of a custom pre-commit hook inside the nix devShell.
The hook runs `cargo sqlx prepare --merged` which will ensure that a commit cannot be made without updating sqlx's `sqlx-data.json`.
The hook is disabled during `nix flake check` runs, so it will not cause issues with a sandbox.
Additionally a `build.rs` script is included to set environment variables for docs.rs builds.