Anvil Table Search

When I perform a table.search() and it returns an iterable object, is it possible to only ‘pull’ two or three data columns? I don’t want to pull all the media objects and I certainly don’t want to pass them to my client code since in this instance I just need limited data about the rows

The Docs state in the search is lazy section that “If your search returns lots of results, Anvil only loads a few at a time.” I’m not sure what you are trying to accomplish but usually this would be done with a server function so the client wouldn’t see the private information anyway.

So I am using a server function and I did read about the search being lazy. I’m on a dedicated plan so I thought table performance might improve with that change - it did not. I’m actually only returning about 14 documents, it’s just painfully slow.

Hi @dconnell, this post certainly help:

You could use the new portable classes to create a class who’s attributes are a subset of the table’s columns.

You also need to create your own iterator for those is you didn’t want to return the whole result set to the client at once.

(if I get a chance, I’ll add the ability to ignore columns to my orm library. That should then do this for you).

2 Likes