What is Nostr?
Marc Planard /
npub108q…sj9f
2023-11-10 18:37:37
in reply to nevent1q…qva3

Marc Planard on Nostr: npub1eqghr…6fncn my use case looks more like this: async fn get_user_messages(); ...

npub1eqghrdelwyf920kghgwlmkjve6ptgnjy3jzkpfvxjmmjsh4em83sq6fncn (npub1eqg…fncn) my use case looks more like this:

async fn get_user_messages();
async fn get_last_ten_public_messages();

The first query will look like:
SELECT {{10 fields}} FROM messages WHERE user = $1;

While the second will look like:
SELECT {{10 fields}} FROM messages WHERE public = True ORDER BY id DESC LIMIT 10";

If I have to add a eleventh field to my struct, I'll have to fix all my queries which is the opposite of DRY. I don't see how to handle that in a single query with sqlx...
Author Public Key
npub108qkm8p33amskf32zc7aclfv33zfla2n7jlv0pkcg70t7gral4xs27sj9f