* Get the fn for random based on the dialect * * @returns {Sequelize.fn}
()
| 984 | * @returns {Sequelize.fn} |
| 985 | */ |
| 986 | random() { |
| 987 | if (['postgres', 'sqlite', 'snowflake'].includes(this.getDialect())) { |
| 988 | return this.fn('RANDOM'); |
| 989 | } |
| 990 | return this.fn('RAND'); |
| 991 | } |
| 992 | |
| 993 | /** |
| 994 | * Creates an object representing a database function. This can be used in search queries, both in where and order parts, and as default values in column definitions. |