samedi 21 janvier 2023

Order random with seed. Postgresql + Sequelize

Why does PostgreSQL not support random(<seed>)?

In most dialects the following code works.

const randomSeed = 123;
return Story.findOne({ order: sequelize.fn('random', randomSeed) });

Is there a way to do a seeded random with sequelize & postgreSQL? or am i fucked and need to switch back to mySQL?




Aucun commentaire:

Enregistrer un commentaire