The easiest way to read the database from the GUI is the Data Explorer Plugin.
rails c
puts you in the Rails console. It’s generally safest to use the console as you’re using the Discourse code itself rather than blindly making changes to a database that you don’t understand.