Accelerated Tables Restrict returned columns

What I’m trying to do:
In Accelerated Tables, remove columns from a database search – basically fetch_only, but rather than specifying which columns I want returned, specifying which columns I don’t want returned.

What I’ve tried and what’s not working:
I have looked in the accelerated tables documentation and don’t see anything:

You can use views to hide columns.

But is there any way to combine that with a the search method and/or any queries like I can with fetch_only? Passing the col_name=query into client_readable errors and I can’t chain search or client_readable onto either one.

As far as I know, views include all rows where one column matches that value. You can then use any query on the view, and maybe create a view of the view.

I’m not familiar with views because I never pass Row objects to the client. My server functions always search multiple tables, build some data structure and return all in one round trip. This ensures fast and safe apps, as mentioned here.

Apparently my syntax was just wrong:

app_tables[table_name].client_readable(q.only_cols("name"), name=q.none_of(None, "")).search()

should have been:

app_tables[table_name].client_readable(q.only_cols("name")).search(name=q.none_of(None, ""))
1 Like