Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions src/target/repository/celestial_repository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand Down Expand Up @@ -512,8 +512,8 @@ class CelestialRepository::Impl {
std::vector<std::string> 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 ?
)");
Expand Down Expand Up @@ -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 ?
Expand Down Expand Up @@ -578,7 +578,7 @@ class CelestialRepository::Impl {
std::vector<CelestialObjectModel> results;
try {
auto stmt = db_->prepare(R"(
SELECT * FROM celestial_objects
SELECT * FROM celestial_objects
WHERE type = ?
ORDER BY click_count DESC
LIMIT ?
Expand All @@ -602,7 +602,7 @@ class CelestialRepository::Impl {
std::vector<CelestialObjectModel> 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 ?
Expand Down Expand Up @@ -1100,7 +1100,7 @@ class CelestialRepository::Impl {
std::vector<UserRatingModel> 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 ?
)");
Expand Down Expand Up @@ -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 = ?
)");
Expand All @@ -1259,7 +1259,7 @@ class CelestialRepository::Impl {
std::vector<CelestialObjectModel> 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);
Expand Down
1 change: 0 additions & 1 deletion tests/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,3 @@ add_custom_target(server_tests
test_controller_sequencer
test_websocket_log_stream
)

Loading