I have two models in my API using FastAPI. Model 1: Deposits (id, created_at, updated_at, value) Model 2: Withdrawals(id, created_at, updated_at, value)
And I want to make an endpoint that returns the union of these two models as in SQL (one below the other). Something like: select id, created_at, updated_at, value from deposits union select id, created_at, updated_at, value from withdrawals
How to do this? Does anyone have any tutorials, examples or documentation to send me?