INSERT INTO code_detail(hash, type, store, value, expiry, used)
VALUES (:hash, :type->>0, :store->>0, :value, :expiry, :used)
ON CONFLICT DO
UPDATE SET
  type = excluded.type,
  store = excluded.store,
  value = excluded.value,
  expiry = excluded.expiry,
  used = excluded.used
WHERE TRUE
;
SELECT 'redirect' AS component, '/code.sql' AS link;