Checking or documenting shared tables? Here's a tip

What I’m trying to do:
Make sure I’ve set up my shared tables as intended.

Context:
I have multiple Apps, each with multiple databases, to separate dev from testing from published data sets. So far, so good.

At the same time, my related Apps share tables. So, for example, I want to make sure that my dc_plans table is the same physical table, across all my Apps’ Testing dbs.

What I’ve tried:

  1. In the Anvil IDE, in each App, open its Testing db.
  2. Hover my mouse over table dc_plans (or whichever table I’m checking)
  3. Look at the link that my browser displays. It ends in a slash and a number. That number uniquely identifies the table across all of my Apps and Databases. It appears also in the row-id of every row in the table, and every link that points into the table.

If that number is the same in both databases, then it’s the same physical table. You can prove that by editing a row in one database, and displaying that row in the other.

So now you can double-check your table-shares, and make sure that they’re correct – even if you were not the person who set them up.

Note: Table id, title, structure and contents are shared, but its Python name and table permissions are per-database and per-app. Changing them in one database will not affect the others.

Caveats:
This table id number is an Anvil implementation detail, and potentially subject to change without notice. Probably why I’ve found no official listing or API to reveal it.

What I’ve seen so far holds for my own Apps and Databases. If yours turns out otherwise, please post it here, so that we can drop this tip. I want to spread helpful information, not disinformation!

3 Likes