Search code examples
pact

Read all data from a table of 10k rows in a single request


Could there be problems in reading all the data of a 10k rows table in a single request?

It would be a read only request.

I would like to do it because I want to perform some queries on the array, and from the documentation I can’t find a way to do it directly with Pact.


Solution

  • No there shouldn't be. Read only queries are "free" atm. You can do it in two ways

    1. Do a select query which will always evaluate true
    2. Get all the keys (i.e. unique ids in the table) via (keys your-table-name) and then have a separate method which returns data for a list of ids.

    But do consider using select statements to help filter out your data during the query as this could be easier than you doing it yourself.