{
  "db_name": "PostgreSQL",
  "query": "\n            WITH clear_recovered AS (\n                UPDATE users u\n                SET low_balance_notification_sent = false\n                FROM user_balance_checkpoints c\n                WHERE u.id = c.user_id\n                  AND u.low_balance_notification_sent = true\n                  AND u.low_balance_threshold IS NOT NULL\n                  AND c.balance >= u.low_balance_threshold\n            )\n            SELECT u.id, u.email, u.username, u.display_name,\n                   u.low_balance_threshold::decimal(20, 9) as \"low_balance_threshold!\",\n                   u.low_balance_notification_sent,\n                   c.balance as \"checkpoint_balance?\"\n            FROM users u\n            LEFT JOIN user_balance_checkpoints c ON u.id = c.user_id\n            WHERE u.id != '00000000-0000-0000-0000-000000000000'\n              AND u.is_deleted = false\n              AND u.low_balance_notification_sent = false\n              AND u.low_balance_threshold IS NOT NULL\n              AND c.balance < u.low_balance_threshold\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "email",
        "type_info": "Varchar"
      },
      {
        "ordinal": 2,
        "name": "username",
        "type_info": "Varchar"
      },
      {
        "ordinal": 3,
        "name": "display_name",
        "type_info": "Varchar"
      },
      {
        "ordinal": 4,
        "name": "low_balance_threshold!",
        "type_info": "Numeric"
      },
      {
        "ordinal": 5,
        "name": "low_balance_notification_sent",
        "type_info": "Bool"
      },
      {
        "ordinal": 6,
        "name": "checkpoint_balance?",
        "type_info": "Numeric"
      }
    ],
    "parameters": {
      "Left": []
    },
    "nullable": [
      false,
      false,
      false,
      true,
      null,
      false,
      false
    ]
  },
  "hash": "2f4074aba01fa091cc0981a458b3ba2cd4b6e8354cf7d4c686adc9a9b9f3e6cd"
}
