You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
In postgresql, you can easily return the current state of a record after insert or update by using RETURNING *. So if you had a set of records that you updated, you can update a single field and then return the current state of the entire record.
ex:
CREATETABLEusers (firstname text, lastname text, id serialprimary key);
INSERT INTO users (firstname, lastname) VALUES ('Joe', 'Cool') RETURNING *;
UPDATEsandbox.test_tableSET firstname ='bob'WHERE id =1 RETURNING *;
So say hypothetically we have a set of keys of the following format in redis
I've run into a situation where, after performing a transaction of many HSET/HMSET operations, I'll have to run a separate pipeline/transaction of HGETALL operations in order to return the state of records after the HSET/HMSET operation (requirement for front end). I'll be doing this on hundreds, possibly a thousand records per request.
It would be nice if we could replicate the functionality of RETURNING * via redis for hashes. It could be some sort of command, for the sake of example I'll call it HMSETRET and HSETRET (RET for RETURN), which would be the equivalent of running HSET/HGET or HMSET/HGETALL ran sequentially.