What I’m trying to do:
See if the offered code works in an Uplink program. It would be handy, to help me document my Apps’ databases and schemas.
What I’ve tried and what’s not working:
I tried the 2nd “ill advised private method” in an Uplink program, and ran into exceptions. The Wing IDE debugger timed out trying to display the various objects.
Code Sample:
from anvil.tables import app_tables
import anvil.server
anvil.server.connect("<my server uplink key>")
# participant dev environment
tables_id_map = {}
table_names = list(app_tables) # yes, I have Accelerated Tables turned on.
for table_name in table_names:
table = getattr(app_tables, table_name)
table_id = table.__dict__['_cap'].__dict__['_scope'][2]['id']
tables_id_map[table_id] = table_name
print(tables_id_map)
Clone link:
n/a – it’s an Uplink program.
It may be that these features are not intended for use in Uplink.
If so, that’s fine. I can certainly move the code to an anvil.server.callable, on the server. But I prefer to run these things locally, via Uplink, where feasible, because here I have a debugger available.
But using the code found in the git repo might get you a workaround, or use this private method from farther up that thread where I tell you not to use it and use Stu’s implementation instead.
I never tested it with uplink, I am unsure if it will have access to that private method since it directly calls clojure code that frequently checks where the request is coming from before serving you any unsanitized data.