@@ -792,6 +792,208 @@ void hset_range(Connection &connection, const StringView &key, Input first, Inpu
792792 connection.send (args);
793793}
794794
795+ template <typename Input>
796+ void hsetex_keep_ttl_range (Connection &connection,
797+ const StringView &key,
798+ Input first,
799+ Input last,
800+ bool keep_ttl,
801+ HSetExOption opt) {
802+ assert (first != last);
803+
804+ CmdArgs args;
805+ args << " HSETEX" << key;
806+
807+ switch (opt) {
808+ case HSetExOption::FNX:
809+ args << " FNX" ;
810+ break ;
811+ case HSetExOption::FXX:
812+ args << " FXX" ;
813+ break ;
814+ case HSetExOption::ALWAYS:
815+ break ;
816+ default :
817+ throw Error (" unknown HSetExOption" );
818+ }
819+
820+ if (keep_ttl) {
821+ args << " KEEPTTL" ;
822+ }
823+
824+ auto keys_num = std::distance (first, last);
825+ args << " FIELDS" << keys_num << std::make_pair (first, last);
826+
827+ connection.send (args);
828+ }
829+
830+ template <typename Input>
831+ void hsetex_ttl_range (Connection &connection,
832+ const StringView &key,
833+ Input first,
834+ Input last,
835+ const std::chrono::milliseconds &ttl,
836+ HSetExOption opt) {
837+ assert (first != last);
838+
839+ CmdArgs args;
840+ args << " HSETEX" << key;
841+
842+ switch (opt) {
843+ case HSetExOption::FNX:
844+ args << " FNX" ;
845+ break ;
846+ case HSetExOption::FXX:
847+ args << " FXX" ;
848+ break ;
849+ case HSetExOption::ALWAYS:
850+ break ;
851+ default :
852+ throw Error (" unknown HSetExOption" );
853+ }
854+
855+ args << " PX" << ttl.count ();
856+
857+ auto keys_num = std::distance (first, last);
858+ args << " FIELDS" << keys_num << std::make_pair (first, last);
859+
860+ connection.send (args);
861+ }
862+
863+ template <typename Input>
864+ void hsetex_time_point_range (Connection &connection,
865+ const StringView &key,
866+ Input first,
867+ Input last,
868+ const std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds> &tp,
869+ HSetExOption opt) {
870+ assert (first != last);
871+
872+ CmdArgs args;
873+ args << " HSETEX" << key;
874+
875+ switch (opt) {
876+ case HSetExOption::FNX:
877+ args << " FNX" ;
878+ break ;
879+ case HSetExOption::FXX:
880+ args << " FXX" ;
881+ break ;
882+ case HSetExOption::ALWAYS:
883+ break ;
884+ default :
885+ throw Error (" unknown HSetExOption" );
886+ }
887+
888+ args << " PXAT" << tp.time_since_epoch ().count ();
889+
890+ auto keys_num = std::distance (first, last);
891+ args << " FIELDS" << keys_num << std::make_pair (first, last);
892+
893+ connection.send (args);
894+ }
895+
896+ template <typename Input>
897+ void httl_range (Connection &connection,
898+ const StringView &key,
899+ Input first,
900+ Input last) {
901+ assert (first != last);
902+
903+ CmdArgs args;
904+ args << " HTTL" << key << " FIELDS" ;
905+
906+ auto keys_num = std::distance (first, last);
907+ args << keys_num << std::make_pair (first, last);
908+
909+ connection.send (args);
910+ }
911+
912+ template <typename Input>
913+ void hpttl_range (Connection &connection,
914+ const StringView &key,
915+ Input first,
916+ Input last) {
917+ assert (first != last);
918+
919+ CmdArgs args;
920+ args << " HPTTL" << key << " FIELDS" ;
921+
922+ auto keys_num = std::distance (first, last);
923+ args << keys_num << std::make_pair (first, last);
924+
925+ connection.send (args);
926+ }
927+
928+ template <typename Input>
929+ void hexpiretime_range (Connection &connection,
930+ const StringView &key,
931+ Input first,
932+ Input last) {
933+ assert (first != last);
934+
935+ CmdArgs args;
936+ args << " HEXPIRETIME" << key << " FIELDS" ;
937+
938+ auto keys_num = std::distance (first, last);
939+ args << keys_num << std::make_pair (first, last);
940+
941+ connection.send (args);
942+ }
943+
944+ template <typename Input>
945+ void hpexpiretime_range (Connection &connection,
946+ const StringView &key,
947+ Input first,
948+ Input last) {
949+ assert (first != last);
950+
951+ CmdArgs args;
952+ args << " HPEXPIRETIME" << key << " FIELDS" ;
953+
954+ auto keys_num = std::distance (first, last);
955+ args << keys_num << std::make_pair (first, last);
956+
957+ connection.send (args);
958+ }
959+
960+ template <typename Input>
961+ void hpexpire_range (Connection &connection,
962+ const StringView &key,
963+ Input first,
964+ Input last,
965+ const std::chrono::milliseconds &ttl,
966+ HPExpireOption opt) {
967+ assert (first != last);
968+
969+ CmdArgs args;
970+ args << " HPEXPIRE" << key << ttl.count ();
971+
972+ switch (opt) {
973+ case HPExpireOption::NX:
974+ args << " NX" ;
975+ break ;
976+ case HPExpireOption::XX:
977+ args << " XX" ;
978+ break ;
979+ case HPExpireOption::GT:
980+ args << " GT" ;
981+ break ;
982+ case HPExpireOption::LT:
983+ args << " LT" ;
984+ break ;
985+ case HPExpireOption::ALWAYS:
986+ break ;
987+ default :
988+ throw Error (" unknown hpexpire option" );
989+ }
990+
991+ auto keys_num = std::distance (first, last);
992+ args << " FIELDS" << keys_num << std::make_pair (first, last);
993+
994+ connection.send (args);
995+ }
996+
795997inline void hsetnx (Connection &connection,
796998 const StringView &key,
797999 const StringView &field,
0 commit comments