Add more connectors
This commit is contained in:
parent
2b443c7723
commit
70db124033
|
@ -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') {
|
||||
|
|
Loading…
Reference in New Issue