Пытаюсь записать рандомную строку в ячейку вида JSON
hash = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 10))
cursor.execute("""UPDATE settings SET register = '{"value":"enabled", "link": %s}' WHERE worker=%s""", [hash, id])
Но возвращает
cursor.execute("""UPDATE settings SET register = '{"value":"enabled", "link": %s}' WHERE worker=%s""", [hash, id])
psycopg2.errors.SyntaxError: syntax error at or near "M5BSJAV6AY"
LINE 1: ...ings SET register = '{"value":"enabled", "link": 'M5BSJAV6AY...