{
  "db_name": "PostgreSQL",
  "query": "WITH entities AS (SELECT name, external_id, id FROM cala_account_sets WHERE ((name = $1) AND ((external_id IS NOT DISTINCT FROM $4) AND COALESCE(id < $3, true) OR COALESCE(external_id < $4, external_id IS NOT NULL))) ORDER BY external_id DESC NULLS LAST, id DESC LIMIT $2) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_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: AccountSetId",
        "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": [
        "Text",
        "Int8",
        "Uuid",
        "Text"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      false
    ]
  },
  "hash": "a1449f51d618fcdfa2e6cd19a491b0b15e43340786a6959927476cf4926d506d"
}
