Data Explorer Plugin

Thanks,
so I don’t really have to connect to the base and it will do the same through api ? is it a faster and better solution ? I’m asking because I can use ifft/zapie style to automate some things without having to program (my knowledge is poor), but through SQL while I don’t know if it’s worth doing it through API instead. Therefore, an example of using a simple query via API in practise case would be useful.

We also have this topic, which gives some more specific examples of using the API to run data explorer queries:

5 Likes

Since some time the data explorer plugin doesn’t seem to work correctly any more.
It once showed the number and details of the query findings, but now only shows a number of results, no details any more.

Example: The “Bio has links” query shows this: 3 results, but no details.

Could it be that a recent Discourse update broke the data explorer pligin (just guessing)? Running Discourse 2.5.0.beta4 + Data explorer 0.2 here.

1 Like

See Data Explorer blank after 2.5 Upgrade, you’ll likely need to update Discourse and/or the plugin again.

5 Likes

After a user has been anonymized, how can that be detected via a Data Explorer query? I still see the user’s row in the users table, but the user is not showing up with a select * from anonymous_users.

EDIT: I am now seeing the user show up in the anonymous_users table after a 20+ minute delay. Is there something query-able that is updated synchronously with the anonymize action?

EDIT: I am now seeing inconsistent results with select * from anonymous_users. Most of the time, not returning either of the anonymized (there are only 2) users.

1 Like

The ‘anonymous users’ table is used for anonymous user accounts, used by the “allow anonymous posting” feature. ‘Anonymizing’ an existing user account is different (confusing, I know :sweat:)

When you ‘anonymize’ a user, it does not add any new rows. It just updates columns in the users table. The best way to check is probably to look for a username starting with anon. Or you might be able to find information in the user_histories table. The action_id for anonymize can be found here:

7 Likes

Thanks!

When you ‘anonymize’ a user, it does not add any new rows. It just updates columns in the users table. The best way to check is probably to look for a username starting with anon .`

That is what I temporarily did to keep my query processing from tripping up when looking at anonymized users. But there doesn’t seem to be anything that would prevent a new user from picking a user name that starts with anon.

Or you might be able to find information in the user_histories table.

Yes. Querying the user_histories table looking for (action = 24) does the job.

A couple of follow on questions…

  • How can I avoid hard-wiring ‘24’ into the query? Is there a table that translates ‘anonymize_user’ into 24?
  • Is it possible for a user to be de-anonymized?
2 Likes

Unfortunately not, no. The enum mapping is done in our Ruby code, so there is no visibility of it in the database. But I think it’s pretty safe to assume 24 won’t be used for anything else.

2 Likes