Mysql Query Records

Hi, when setting up the app with mysql tables it by default syncs the entire table, quickly adding to our allowed record count in Noloco.

While this works great, it would be really useful if a query could determine which records we actually need syncing to Noloco. So rather than importing everything in a table, we define whats needed.

For example, due to UK financial regulations we need to keep some client data for anything up to 25 years. We don’t need all that data in Noloco but do need to keep it in the original tables so we can run our own data queries backend.

Something like this I guess.
SELECT SQL_CALC_FOUND_ROWS * FROM tableClients WHERE category = ‘something’ where YEAR(date) = YEAR(DATE_SUB(CURDATE(), INTERVAL 3 YEAR));

Appreciate this may not be something beneficial to Noloco but from a customers point of view the costs could start to get out of hand as data grows.

Hi @garyGHL are you talking about in our custom queries, or just generally when connecting a table?

If you’re referencing custom queries, you could definitely add a WHERE clause as you’ve described.

If it’s for general tables, then filtering at the source is something we’re exploring, but no concrete plans just yet

Hi @darragh, yes at source really, I have queries running for collections and charts but wanted to reduce record collection.

So if my clients table has 30,000 records and I only need 10,000 records synced to Noloco.

The other 20,000 aren’t needed to be synced to Noloco so would reduce my record count significantly.

That said, my app is fully built now so even if it was possible I’m not sure how I’d now change the source without rebuilding the whole thing again.

1 Like

Thanks for clarifying @garyGHL