{
  "db_name": "PostgreSQL",
  "query": "\n        SELECT\n            a.id, a.title, a.slug, a.summary, a.body, a.target_roles, a.tags,\n            a.updated_at,\n            c.name AS category_name, c.slug AS category_slug\n        FROM kb_articles a\n        JOIN kb_categories c ON c.id = a.category_id\n        WHERE a.is_published = true\n          AND c.is_active = true\n          AND ($1 = '' OR c.slug = $1)\n          AND ($2 = '' OR $2 = 'ALL'\n               OR a.target_roles = '{}'\n               OR $2 = ANY(a.target_roles))\n          AND ($3 = '' OR LOWER(a.title) LIKE '%' || $3 || '%'\n               OR LOWER(COALESCE(a.summary, '')) LIKE '%' || $3 || '%')\n        ORDER BY a.updated_at DESC\n        LIMIT $4 OFFSET $5\n        ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "title",
        "type_info": "Varchar"
      },
      {
        "ordinal": 2,
        "name": "slug",
        "type_info": "Varchar"
      },
      {
        "ordinal": 3,
        "name": "summary",
        "type_info": "Text"
      },
      {
        "ordinal": 4,
        "name": "body",
        "type_info": "Text"
      },
      {
        "ordinal": 5,
        "name": "target_roles",
        "type_info": "TextArray"
      },
      {
        "ordinal": 6,
        "name": "tags",
        "type_info": "TextArray"
      },
      {
        "ordinal": 7,
        "name": "updated_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 8,
        "name": "category_name",
        "type_info": "Varchar"
      },
      {
        "ordinal": 9,
        "name": "category_slug",
        "type_info": "Varchar"
      }
    ],
    "parameters": {
      "Left": [
        "Text",
        "Text",
        "Text",
        "Int8",
        "Int8"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      true,
      false,
      true,
      false,
      false,
      false,
      false
    ]
  },
  "hash": "bab7180db144657dadf46734d839909e1792230e48e55021057f76bcb4e1ea46"
}
