diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 166ee4a..0b073d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,13 +3,13 @@ exclude: '^libs/(atom|thirdparty|cpptrace|spdlog)/' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/psf/black - rev: 24.10.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 hooks: - id: black - repo: https://github.com/pocc/pre-commit-hooks diff --git a/src/target/repository/celestial_repository.cpp b/src/target/repository/celestial_repository.cpp index 512afa9..369234b 100644 --- a/src/target/repository/celestial_repository.cpp +++ b/src/target/repository/celestial_repository.cpp @@ -383,7 +383,7 @@ class CelestialRepository::Impl { } auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE identifier LIKE ? OR chinese_name LIKE ? OR aliases LIKE ? ORDER BY click_count DESC LIMIT ? @@ -512,8 +512,8 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT DISTINCT identifier FROM celestial_objects - WHERE identifier LIKE ? + SELECT DISTINCT identifier FROM celestial_objects + WHERE identifier LIKE ? ORDER BY click_count DESC, identifier ASC LIMIT ? )"); @@ -542,7 +542,7 @@ class CelestialRepository::Impl { double decMax = dec + radius; auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE rad_j2000 BETWEEN ? AND ? AND dec_d_j2000 BETWEEN ? AND ? LIMIT ? @@ -578,7 +578,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE type = ? ORDER BY click_count DESC LIMIT ? @@ -602,7 +602,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE visual_magnitude_v BETWEEN ? AND ? ORDER BY visual_magnitude_v ASC LIMIT ? @@ -1100,7 +1100,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT id, user_id, object_id, rating, timestamp + SELECT id, user_id, object_id, rating, timestamp FROM user_ratings WHERE user_id = ? ORDER BY timestamp DESC LIMIT ? )"); @@ -1242,7 +1242,7 @@ class CelestialRepository::Impl { bool incrementClickCount(const std::string& identifier) { try { auto stmt = db_->prepare(R"( - UPDATE celestial_objects + UPDATE celestial_objects SET click_count = click_count + 1, updated_at = strftime('%s', 'now') WHERE identifier = ? )"); @@ -1259,7 +1259,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects ORDER BY click_count DESC LIMIT ? )"); stmt->bind(1, limit); diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index 00a7008..2bdd9fc 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -306,4 +306,3 @@ add_custom_target(server_tests test_controller_sequencer test_websocket_log_stream ) -