{
  "db_name": "PostgreSQL",
  "query": "\n            UPDATE users SET\n                display_name = COALESCE($2, display_name),\n                avatar_url = COALESCE($3, avatar_url),\n                password_hash = COALESCE($4, password_hash),\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                auto_topup_amount = CASE\n                    WHEN $8::boolean THEN $9\n                    ELSE auto_topup_amount\n                END,\n                auto_topup_threshold = CASE\n                    WHEN $10::boolean THEN $11\n                    ELSE auto_topup_threshold\n                END,\n                auto_topup_monthly_limit = CASE\n                    WHEN $12::boolean THEN $13\n                    ELSE auto_topup_monthly_limit\n                END,\n                auto_topup_limit_notification_sent = CASE\n                    WHEN $12::boolean THEN false\n                    ELSE auto_topup_limit_notification_sent\n                END,\n                updated_at = NOW()\n            WHERE id = $1\n            RETURNING *\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": "last_login",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 9,
        "name": "is_admin",
        "type_info": "Bool"
      },
      {
        "ordinal": 10,
        "name": "password_hash",
        "type_info": "Text"
      },
      {
        "ordinal": 11,
        "name": "external_user_id",
        "type_info": "Text"
      },
      {
        "ordinal": 12,
        "name": "payment_provider_id",
        "type_info": "Varchar"
      },
      {
        "ordinal": 13,
        "name": "is_deleted",
        "type_info": "Bool"
      },
      {
        "ordinal": 14,
        "name": "is_internal",
        "type_info": "Bool"
      },
      {
        "ordinal": 15,
        "name": "batch_notifications_enabled",
        "type_info": "Bool"
      },
      {
        "ordinal": 16,
        "name": "first_batch_email_sent",
        "type_info": "Bool"
      },
      {
        "ordinal": 17,
        "name": "low_balance_notification_sent",
        "type_info": "Bool"
      },
      {
        "ordinal": 18,
        "name": "low_balance_threshold",
        "type_info": "Float4"
      },
      {
        "ordinal": 19,
        "name": "user_type",
        "type_info": "Varchar"
      },
      {
        "ordinal": 20,
        "name": "auto_topup_amount",
        "type_info": "Float4"
      },
      {
        "ordinal": 21,
        "name": "auto_topup_threshold",
        "type_info": "Float4"
      },
      {
        "ordinal": 22,
        "name": "auto_topup_monthly_limit",
        "type_info": "Float4"
      },
      {
        "ordinal": 23,
        "name": "auto_topup_limit_notification_sent",
        "type_info": "Bool"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid",
        "Varchar",
        "Varchar",
        "Text",
        "Bool",
        "Bool",
        "Float4",
        "Bool",
        "Float4",
        "Bool",
        "Float4",
        "Bool",
        "Float4"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      true,
      true,
      false,
      false,
      false,
      true,
      false,
      true,
      true,
      true,
      false,
      false,
      false,
      false,
      false,
      true,
      false,
      true,
      true,
      true,
      false
    ]
  },
  "hash": "55af619c130bba3c93a706f7672001f8ba759bfacb0fa1195c6115b8a3ba90d8"
}
