{
  "db_name": "PostgreSQL",
  "query": "WITH entities AS (SELECT external_id, id FROM cala_accounts WHERE ((external_id IS NOT DISTINCT FROM $3) AND COALESCE(id < $2, true) OR COALESCE(external_id < $3, external_id IS NOT NULL)) ORDER BY external_id DESC NULLS LAST, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.external_id desc nulls last, i.id desc, i.id, e.sequence",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "entity_id: AccountId",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "sequence",
        "type_info": "Int4"
      },
      {
        "ordinal": 2,
        "name": "event",
        "type_info": "Jsonb"
      },
      {
        "ordinal": 3,
        "name": "recorded_at",
        "type_info": "Timestamptz"
      }
    ],
    "parameters": {
      "Left": [
        "Int8",
        "Uuid",
        "Text"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      false
    ]
  },
  "hash": "5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939"
}
