{flake.lock,Cargo.*}: bump

This commit is contained in:
2026-07-20 22:28:25 +09:00
parent 626bc9b6ba
commit cbd5b73182
6 changed files with 438 additions and 718 deletions
Generated
+8 -9
View File
@@ -2,12 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1766314097, "lastModified": 1784525419,
"narHash": "sha256-laJftWbghBehazn/zxVJ8NdENVgjccsWAdAqKXhErrM=", "narHash": "sha256-hHc34O0CB5njLspfBQf+2qjg68TMHhnu++AQbui6f1U=",
"owner": "NixOS", "rev": "a16c3fde2ffeab7f6326f50f460aaffde7ae066d",
"repo": "nixpkgs", "type": "tarball",
"rev": "306ea70f9eb0fb4e040f8540e2deab32ed7e2055", "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1037806.a16c3fde2ffe/nixexprs.tar.xz"
"type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
@@ -28,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1766371695, "lastModified": 1784526465,
"narHash": "sha256-W7CX9vy7H2Jj3E8NI4djHyF8iHSxKpb2c/7uNQ/vGFU=", "narHash": "sha256-L37teKC6oINWG4PGZLIqbphMWvSQ0PEz+aWxAk+rIDw=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "d81285ba8199b00dc31847258cae3c655b605e8c", "rev": "58c6334db52d51fc5dd8877c90b01f00cf8a696b",
"type": "github" "type": "github"
}, },
"original": { "original": {
+413 -689
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -4,16 +4,16 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
anyhow = "1.0.100" anyhow = "1.0.104"
axum = "0.8.8" axum = "0.8.9"
chrono = { version = "0.4.42", features = ["serde"] } chrono = { version = "0.4.45", features = ["serde"] }
clap = { version = "4.5.53", features = ["derive"] } clap = { version = "4.6.2", features = ["derive"] }
indoc = "2.0.7" indoc = "2.0.7"
itertools = "0.14.0" itertools = "0.15.0"
serde = { version = "1.0.228", features = ["derive"] } serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.145" serde_json = "1.0.151"
sqlx = { version = "0.8.6", features = ["bigdecimal", "chrono", "postgres", "runtime-tokio"] } sqlx = { version = "0.9.0", features = ["bigdecimal", "chrono", "postgres", "runtime-tokio"] }
tokio = { version = "1.48.0", features = ["rt-multi-thread"] } tokio = { version = "1.53.0", features = ["rt-multi-thread"] }
toml = "0.9.10" toml = "1.1.3"
tracing = "0.1.44" tracing = "0.1.44"
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] } tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
+2 -2
View File
@@ -43,7 +43,7 @@ async fn main() -> anyhow::Result<()> {
let config_content = std::fs::read_to_string(&args.config_path).context(format!( let config_content = std::fs::read_to_string(&args.config_path).context(format!(
"Failed to read configuration file at '{}'", "Failed to read configuration file at '{}'",
&args.config_path args.config_path
))?; ))?;
let config: Config = let config: Config =
@@ -128,7 +128,7 @@ async fn seed_test_data(_config: Config, db_pool: sqlx::PgPool) -> anyhow::Resul
tracing::info!("Inserting test data..."); tracing::info!("Inserting test data...");
let test_data = vec![ let test_data = [
("player1", "2023-10-01 10:00:00", 3600), ("player1", "2023-10-01 10:00:00", 3600),
("player2", "2023-10-01 11:00:00", 1800), ("player2", "2023-10-01 11:00:00", 1800),
("player1", "2023-10-02 09:30:00", 7200), ("player1", "2023-10-02 09:30:00", 7200),
+1 -1
View File
@@ -23,7 +23,7 @@ pub struct LoginSession {
} }
async fn filter_time( async fn filter_time(
query_builder: &mut QueryBuilder<'_, sqlx::Postgres>, query_builder: &mut QueryBuilder<sqlx::Postgres>,
start_time: Option<chrono::NaiveDateTime>, start_time: Option<chrono::NaiveDateTime>,
end_time: Option<chrono::NaiveDateTime>, end_time: Option<chrono::NaiveDateTime>,
) { ) {
+3 -6
View File
@@ -11,14 +11,12 @@ use serde_json::json;
use crate::queries::{get_login_sessions, get_total_login_time, get_user_login_times}; use crate::queries::{get_login_sessions, get_total_login_time, get_user_login_times};
pub async fn create_router(db_pool: sqlx::PgPool) -> Router { pub async fn create_router(db_pool: sqlx::PgPool) -> Router {
let app = Router::new() Router::new()
.route("/ping", get(handle_ping)) .route("/ping", get(handle_ping))
.route("/login_sessions", get(handle_login_sessions)) .route("/login_sessions", get(handle_login_sessions))
.route("/total_login_time", get(handle_total_login_time)) .route("/total_login_time", get(handle_total_login_time))
.route("/user_login_time", get(handle_user_login_time)) .route("/user_login_time", get(handle_user_login_time))
.with_state(db_pool); .with_state(db_pool)
app
} }
async fn handle_ping() -> impl IntoResponse { async fn handle_ping() -> impl IntoResponse {
@@ -43,8 +41,7 @@ async fn handle_login_sessions(
Json(response).into_response() Json(response).into_response()
} }
Err(e) => { Err(e) => {
let response = let response = json!({ "error": format!("Failed to retrieve login sessions: {}", e) });
json!({ "error": format!("Failed to retrieve login sessions: {}", e) });
( (
axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::http::StatusCode::INTERNAL_SERVER_ERROR,
Json(response), Json(response),