@@ -19,7 +19,7 @@ SELECT r.reg_type as registry_type,
1919 JOIN registry r ON s .reg_id = r .id
2020 LEFT JOIN latest_server_version l ON s .id = l .latest_server_id
2121 WHERE (sqlc .narg (next)::timestamp with time zone IS NULL OR s .created_at > sqlc .narg (next))
22- OR (sqlc .narg (prev)::timestamp with time zone IS NULL AND s .created_at < sqlc .narg (prev))
22+ AND (sqlc .narg (prev)::timestamp with time zone IS NULL OR s .created_at < sqlc .narg (prev))
2323 ORDER BY
2424 -- next page sorting
2525 CASE WHEN sqlc .narg (next)::timestamp with time zone IS NULL THEN r .reg_type END ASC ,
@@ -79,7 +79,7 @@ SELECT s.id,
7979 FROM mcp_server s
8080 WHERE s .name = sqlc .arg (name)
8181 AND ((sqlc .narg (next)::timestamp with time zone IS NULL OR s .created_at > sqlc .narg (next))
82- OR (sqlc .narg (prev)::timestamp with time zone IS NULL AND s .created_at < sqlc .narg (prev)))
82+ AND (sqlc .narg (prev)::timestamp with time zone IS NULL OR s .created_at < sqlc .narg (prev)))
8383 ORDER BY
8484 CASE WHEN sqlc .narg (next)::timestamp with time zone IS NULL THEN s .created_at END ASC ,
8585 CASE WHEN sqlc .narg (next)::timestamp with time zone IS NULL THEN s .version END DESC -- acts as tie breaker
@@ -105,8 +105,8 @@ INSERT INTO mcp_server (
105105 sqlc .arg (name),
106106 sqlc .arg (version),
107107 sqlc .arg (reg_id),
108- CURRENT_TIMESTAMP ,
109- CURRENT_TIMESTAMP ,
108+ sqlc . arg (created_at) ,
109+ sqlc . arg (updated_at) ,
110110 sqlc .narg (description),
111111 sqlc .narg (title),
112112 sqlc .narg (website),
@@ -118,7 +118,7 @@ INSERT INTO mcp_server (
118118 sqlc .narg (repository_type)
119119) ON CONFLICT (reg_id, name, version)
120120 DO UPDATE SET
121- updated_at = CURRENT_TIMESTAMP ,
121+ updated_at = sqlc . arg (updated_at) ,
122122 description = sqlc .narg (description),
123123 title = sqlc .narg (title),
124124 website = sqlc .narg (website),
0 commit comments