{
  "db_name": "PostgreSQL",
  "query": "\n            SELECT\n                LOWER(BTRIM(dm.metadata->>'provider')) AS provider_key,\n                MIN(BTRIM(dm.metadata->>'provider')) AS display_name,\n                COUNT(DISTINCT dm.id)::BIGINT AS model_count\n            FROM deployed_models dm\n            JOIN deployment_groups dg ON dg.deployment_id = dm.id\n            WHERE\n                dm.deleted = false\n                AND dm.metadata->>'provider' IS NOT NULL\n                AND BTRIM(dm.metadata->>'provider') <> ''\n                AND dg.group_id IN (\n                    SELECT ug.group_id FROM user_groups ug WHERE ug.user_id = $1\n                    UNION\n                    SELECT '00000000-0000-0000-0000-000000000000'::uuid\n                    WHERE $1 != '00000000-0000-0000-0000-000000000000'::uuid\n                )\n            GROUP BY LOWER(BTRIM(dm.metadata->>'provider'))\n            ORDER BY MIN(BTRIM(dm.metadata->>'provider'))\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "provider_key",
        "type_info": "Text"
      },
      {
        "ordinal": 1,
        "name": "display_name",
        "type_info": "Text"
      },
      {
        "ordinal": 2,
        "name": "model_count",
        "type_info": "Int8"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid"
      ]
    },
    "nullable": [
      null,
      null,
      null
    ]
  },
  "hash": "c68d3644d24430720e8c06bcdeddc462c62b8c42b2d0ee57910950971123f2b0"
}
