#sqlx #axum #redis #log-level

axum-kit

Streamline the integration and usage of Axum with SQLx and Redis

10 unstable releases (3 breaking)

new 0.4.2 Dec 18, 2024
0.4.1 Dec 17, 2024
0.3.1 Dec 13, 2024
0.2.1 Dec 4, 2024
0.1.2 Nov 22, 2024

#1157 in Database interfaces

Download history 164/week @ 2024-11-14 356/week @ 2024-11-21 129/week @ 2024-11-28 175/week @ 2024-12-05 376/week @ 2024-12-12

1,200 downloads per month

MIT license

28KB
557 lines

axum-kit

GitHub CI Crates.io Documentation

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.4.2", 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
idle_timeout = 600
max_lifetime = 1800

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

License

This project is licensed under the MIT license.

Dependencies

~16–31MB
~477K SLoC