Re:Show HN: PRQL 0.2 – a better SQL
by vore on Tuesday June 28, 2022 @12:48AM
(#31904202)
That's exactly it though: having to do dumb tricks is the painful part. There's plenty of things with user-defined order where an explicit index isn't surfaced, like to-do lists, playlists, etc.
[ Parent
| on HN ]
Re:Show HN: PRQL 0.2 – a better SQL
by BeefWellington on Tuesday June 28, 2022 @07:58AM
(#31906577)
A user-defined order is an explicit index.
EDIT: To expand further, I would generally model a playlist as its own tables anyways. Something like:
CREATE TABLE playlist (
id ID_TYPE_FOR_DB PRIMARY KEY,
name varchar(4096), /* Or whatever storage size makes sense */
)
CREATE TABLE playlist_entry (
id ID_TYPE_FOR_DB PRIMARY KEY,
song_ref ID_TYPE_FOR_DB FOREIGN KEY REFERENCES songs(id),
order INT, /* Or bigint or whatever you want */
)