We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16b9f61 commit 0051b18Copy full SHA for 0051b18
lib/discovery.js
@@ -154,7 +154,7 @@ function mixinDiscovery(MySQL, mysql) {
154
* @param table
155
* @returns {String} The sql statement
156
*/
157
- MySQL.prototype.buildQueryColumns = function(schema, table) {
+ MySQL.prototype.buildQueryColumns = function(schema, table, options) {
158
let sql = null;
159
if (schema) {
160
sql = paginateSQL('SELECT table_schema AS "owner",' +
@@ -186,7 +186,9 @@ function mixinDiscovery(MySQL, mysql) {
186
(table ? ' WHERE table_name=' + mysql.escape(table) : ''),
187
'table_name, ordinal_position', {});
188
}
189
- sql += ' ORDER BY ordinal_position';
+ if (options.orderBy) {
190
+ sql += ' ORDER BY ' + options.orderBy;
191
+ }
192
return sql;
193
};
194
0 commit comments