Add more connectors

This commit is contained in:
loay 2017-04-24 16:16:17 -04:00
parent 2b443c7723
commit 70db124033
1 changed files with 6 additions and 1 deletions

View File

@ -1186,11 +1186,16 @@ SQLConnector.prototype.buildOrderBy = function(model, order) {
}
var self = this;
var usedConnector = this.dataSource.connector.name;
if (order === 'rand') {
if (usedConnector === 'mysql') {
return 'ORDER BY RAND()';
} else if (usedConnector === 'postgres' || usedConnector === 'oracle') {
} else if (usedConnector === 'postgres') {
return 'ORDER BY RANDOM()';
} else if (usedConnector === 'oracle') {
return 'ORDER BY dbms_random.value';
} else if (usedConnector === 'mssql') {
return 'ORDER BY NEWID()';
}
} else {
if (typeof order === 'string') {