* Get the fn for random based on the dialect * * @returns {Sequelize.fn}
()
| 902 | * @returns {Sequelize.fn} |
| 903 | */ |
| 904 | random() { |
| 905 | if ([class="st">'postgres', class="st">'sqlite', class="st">'snowflake'].includes(this.getDialect())) { |
| 906 | return this.fn(class="st">'RANDOM'); |
| 907 | } |
| 908 | return this.fn(class="st">'RAND'); |
| 909 | } |
| 910 | |
| 911 | /** |
| 912 | * 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. |