How to sort rows by rpm versions
Maybe you need windowing functions like:
select
RANK () OVER ( 
    PARTITION BY name
    ORDER BY epoch desc, version desc, release desc
        ) namerank,
name,
epoch,
version,
release,
architecture
from packages
order by name,namerank;

But it does not list the versions in the correct order because it sees 0.1.7 as greater than 0.1.10 which it is as a character string. You might need version split into multiple columns of type number to get 0.1.10 greater than 0.1.7 or convert it to a number that keeps the order you want. I tested this on Oracle since I don't have sqllite or postgres handy. Output:
  NAMERANK NAME                                                                  EPOCH VERSION                          RELEASE                                                          ARCHITECTURE
---------- ---------------------------------------------------------------- ---------- -------------------------------- ---------------------------------------------------------------- ----------------
         1 my-date-based-rpm                                                         0 2021010128002                    0                                                                x86_64
         2 my-date-based-rpm                                                         0 2021010128001                    0                                                                x86_64
         1 my-first-rpm                                                              0 0.1.7                            0                                                                x86_64
         2 my-first-rpm                                                              0 0.1.10                           0                                                                x86_64
         3 my-first-rpm                                                              0 0.1.0                            0                                                                x86_64
         1 my-second-rpm                                                             1 0.1.0                            0                                                                x86_64
         2 my-second-rpm                                                             0 0.1.0                            0                                                                x86_64
         1 my-third-rpm                                                              0 0.1.1                            0                                                                x86_64
         2 my-third-rpm                                                              0 0.1                              0                                                                x86_64

Bobby