{
  "db_name": "PostgreSQL",
  "query": "\n            UPDATE users SET\n                display_name = COALESCE($2, display_name),\n                avatar_url = COALESCE($3, avatar_url),\n                email = COALESCE($4, email),\n                batch_notifications_enabled = COALESCE($5, batch_notifications_enabled),\n                low_balance_threshold = CASE\n                    WHEN $6::boolean THEN $7\n                    ELSE low_balance_threshold\n                END,\n                low_balance_notification_sent = CASE\n                    WHEN $6::boolean THEN false\n                    ELSE low_balance_notification_sent\n                END,\n                updated_at = NOW()\n            WHERE id = $1 AND user_type = 'organization' AND is_deleted = false\n            RETURNING id, username, email, display_name, avatar_url, auth_source, created_at, updated_at,\n                      is_admin, password_hash, external_user_id, payment_provider_id,\n                      batch_notifications_enabled, first_batch_email_sent,\n                      low_balance_notification_sent, low_balance_threshold,\n                      auto_topup_amount, auto_topup_threshold, auto_topup_monthly_limit, user_type\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "username",
        "type_info": "Varchar"
      },
      {
        "ordinal": 2,
        "name": "email",
        "type_info": "Varchar"
      },
      {
        "ordinal": 3,
        "name": "display_name",
        "type_info": "Varchar"
      },
      {
        "ordinal": 4,
        "name": "avatar_url",
        "type_info": "Varchar"
      },
      {
        "ordinal": 5,
        "name": "auth_source",
        "type_info": "Varchar"
      },
      {
        "ordinal": 6,
        "name": "created_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 7,
        "name": "updated_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 8,
        "name": "is_admin",
        "type_info": "Bool"
      },
      {
        "ordinal": 9,
        "name": "password_hash",
        "type_info": "Text"
      },
      {
        "ordinal": 10,
        "name": "external_user_id",
        "type_info": "Text"
      },
      {
        "ordinal": 11,
        "name": "payment_provider_id",
        "type_info": "Varchar"
      },
      {
        "ordinal": 12,
        "name": "batch_notifications_enabled",
        "type_info": "Bool"
      },
      {
        "ordinal": 13,
        "name": "first_batch_email_sent",
        "type_info": "Bool"
      },
      {
        "ordinal": 14,
        "name": "low_balance_notification_sent",
        "type_info": "Bool"
      },
      {
        "ordinal": 15,
        "name": "low_balance_threshold",
        "type_info": "Float4"
      },
      {
        "ordinal": 16,
        "name": "auto_topup_amount",
        "type_info": "Float4"
      },
      {
        "ordinal": 17,
        "name": "auto_topup_threshold",
        "type_info": "Float4"
      },
      {
        "ordinal": 18,
        "name": "auto_topup_monthly_limit",
        "type_info": "Float4"
      },
      {
        "ordinal": 19,
        "name": "user_type",
        "type_info": "Varchar"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid",
        "Varchar",
        "Varchar",
        "Varchar",
        "Bool",
        "Bool",
        "Float4"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      true,
      true,
      false,
      false,
      false,
      false,
      true,
      true,
      true,
      false,
      false,
      false,
      true,
      true,
      true,
      true,
      false
    ]
  },
  "hash": "5ac34e086e5616ea4b5a5f2499eeb01f4891d617df7169e08fafde2948dfe29d"
}
