{
  "db_name": "PostgreSQL",
  "query": "\n        SELECT\n            r.id,\n            r.name,\n            r.key as code,\n            r.is_active,\n            r.created_at as created_date,\n            rc.updated_at as \"updated_at?\",\n            rc.config_json as \"config_json?\"\n        FROM roles r\n        LEFT JOIN runtime_configs rc\n            ON rc.role_id = r.id AND rc.is_active = true\n        WHERE r.audience = 'EXTERNAL'\n          AND ($1 = '' OR LOWER(r.name) LIKE '%' || $1 || '%' OR LOWER(r.key) LIKE '%' || $1 || '%')\n          AND ($2 = '' OR (CASE WHEN $2 = 'ACTIVE' THEN r.is_active ELSE NOT r.is_active END))\n        ORDER BY r.created_at DESC\n        LIMIT $3 OFFSET $4\n        ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "name",
        "type_info": "Varchar"
      },
      {
        "ordinal": 2,
        "name": "code",
        "type_info": "Varchar"
      },
      {
        "ordinal": 3,
        "name": "is_active",
        "type_info": "Bool"
      },
      {
        "ordinal": 4,
        "name": "created_date",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 5,
        "name": "updated_at?",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 6,
        "name": "config_json?",
        "type_info": "Jsonb"
      }
    ],
    "parameters": {
      "Left": [
        "Text",
        "Text",
        "Int8",
        "Int8"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      false,
      false,
      false,
      false
    ]
  },
  "hash": "98548c9d0ad47098f6c759424c1fd9e3145e0de5e4309933c6e417e4e95de359"
}
