From a4375963a9ab9bac59653eae01695a409e425b2f Mon Sep 17 00:00:00 2001 From: Andrew Taft <11670864+ataft@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:22:46 -0700 Subject: [PATCH] Fix ORDER BY logic This should be `if(orderBy)` rather than `if(!orderBy)` --- lib/discovery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/discovery.js b/lib/discovery.js index a10454d7..1d234fa5 100644 --- a/lib/discovery.js +++ b/lib/discovery.js @@ -20,7 +20,7 @@ function mixinDiscovery(PostgreSQL) { limit = limit + ' LIMIT ' + options.limit; } } - if (!orderBy) { + if (orderBy) { sql += ' ORDER BY ' + orderBy; } return sql + limit;