Added sorting for popular tweets
Heavily using JSONB in the Supabase Postgres database. Unfortunately, using a function for sorting does not work in the Supabase JS Client.
I.e. my JSONB column is named info and it has a field createdAt
{"created": "2020-05-05T10:00:15.000Z", "other": "prop"}
With plain SQL, you could do ORDER BY (info->>'createdAt')::TIMESTAMPTZ. That doesn't work via JS client so I introduced a separate field.
I.e. my JSONB column is named info and it has a field createdAt
{"created": "2020-05-05T10:00:15.000Z", "other": "prop"}
With plain SQL, you could do ORDER BY (info->>'createdAt')::TIMESTAMPTZ. That doesn't work via JS client so I introduced a separate field.