Suggestion: yunohost tools db-prompt app

I used to often struggle to open a database prompt in order to debug an app or just collect info about the DB structure. The reasons are the following:

  • an app may be mariadb, peertube or even sqlite, in order to know that we have to look at the installation script;
  • we have to collect the database password (I noticed later that the dbname/login/password is stored in preferences and can be accessed using yunohost app setting app ...);
  • we have to have in mind the command to open a DB prompt;

To facilitate that, I imagined a command like yunohost tools db-prompt app which would open psql / mariadb (and sqlite?) prompt loading all the required settings from the app.

What do you think?

I would be glad to propose a patch for this if the feedback is positive.

1 Like

Looks like a good companion for Offer a shell into an app environment · Issue #2041 · YunoHost/issues · GitHub.

Nice! Do you think both should be implemented separately, sequentially (your proposal before mine), or altogether?

Also do you think that it’s more relevant to implement these as subcommands of yunohost tools or yunohost app? (I tend to see them as general tools rather than app management tools, but with really no strong opinion)

EDIT: \o/ I just noticed that manifest v2 offers an entry to see which type of db is used by the packaged app. That’s awesome! That would mean that the command db-prompt would require the manifest to be migrated.