#sqlx #axum #redis #log-level

axum-kit

Streamline the integration and usage of Axum with SQLx and Redis

18 releases (5 breaking)

0.6.3 Feb 25, 2025
0.6.1 Jan 21, 2025
0.4.3 Dec 31, 2024
0.2.0 Nov 25, 2024

#1887 in Database interfaces

Download history 506/week @ 2024-11-20 47/week @ 2024-11-27 253/week @ 2024-12-04 413/week @ 2024-12-11 194/week @ 2024-12-18 72/week @ 2024-12-25 190/week @ 2025-01-01 138/week @ 2025-01-08 288/week @ 2025-01-15 56/week @ 2025-01-22 4/week @ 2025-01-29 42/week @ 2025-02-05 108/week @ 2025-02-12 99/week @ 2025-02-19 80/week @ 2025-02-26

330 downloads per month

MIT license

30KB
625 lines

axum-kit

GitHub CI Crates.io Documentation Crates.io MSRV Crates.io Total Downloads

Streamline the integration and usage of Axum with SQLx and Redis.

Without further ado, please see the demo.

Usage

To use axum-kit, add the following to your Cargo.toml:

[dependencies]
axum-kit = { version = "0.6.3", features = ["postgres", "redis"] }

Example Configuration File

[general]
listen = "0.0.0.0:8000"

[logger]
# Log levels: trace > debug > info > warn > error
# trace: Very detailed debugging information.
# debug: General debugging information.
# info: Normal operational information.
# warn: Potential issues.
# error: Serious problems.
level = "debug"
# writer options:
# file: Logs to "directory/file_name_prefix.year-month-day".
# stdout: Logs to console.
writer = "file"
directory = "./log"
file_name_prefix = "axum_kit.log"

[postgres]
url = "postgres://postgres:@127.0.0.1:5432/postgres"
max_connections = 10
min_connections = 1
acquire_timeout = 30  # seconds
idle_timeout = 600    # seconds
max_lifetime = 1800   # seconds

[redis]
url = "redis://127.0.0.1:6379"

License

This project is licensed under the MIT license.

Dependencies

~17–32MB
~508K SLoC