Open ThatOneCalculator opened 5 months ago
On further inspection, this seems to be implemented incorrectly:
According to https://surrealdb.com/docs/surrealdb/surrealql/statements/select#sort-records-using-the-order-by-clause , those should actually be ORDER BY fieldname, fieldname, COLLATE direction
, but the query builder doesn't ever add COLLATE
.
The line
query.orderBy({ field: "createdAt", direction: "DESC" });
throws a TS error on
field
:but according to https://github.com/ozone-team/surrealised?tab=readme-ov-file#orderbyfields-orderbyfield ,
field
should be the db field and onlydirection
should be enforced as"DESC" | "ASC"
.