You've already forked AstralRinth
forked from didirus/AstralRinth
06f1df1995
* Fix random_projects route not returning the requested number of projects * fix(labrinth): further improve random project route SQL query * chore: fix typo in comment * tweak(labrinth): more apparent and fast randomness for `random_projects_get` * tweak(labrinth): even better random projects query * chore: address formatting review --------- Co-authored-by: Alejandro González <me@alegon.dev>
24 lines
569 B
JSON
24 lines
569 B
JSON
{
|
|
"db_name": "PostgreSQL",
|
|
"query": "SELECT id FROM mods WHERE status = ANY($1)\n ORDER BY id\n LIMIT $2\n OFFSET GREATEST(ROUND(RANDOM() * (SELECT COUNT(*) FROM mods WHERE status = ANY($1)))::int8 - $2, 0)",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"ordinal": 0,
|
|
"name": "id",
|
|
"type_info": "Int8"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"TextArray",
|
|
"Int8"
|
|
]
|
|
},
|
|
"nullable": [
|
|
false
|
|
]
|
|
},
|
|
"hash": "1d017ac5f5b1e76ec241533fd4d061c79f4e6d2f1701e727a7474fd5029a5492"
|
|
}
|