terminus-plugin-project / terminus-pancakes-plugin

Terminus Plugin to open Pantheon Site Databases in your Favorite SQL Client
MIT License
26 stars 20 forks source link

Experience with Multiple Apps - Ability to set Default App / Aliases #19

Open uberhacker opened 7 years ago

uberhacker commented 7 years ago

It would be nice if you could set your favorite SQL app to launch without specifying it each time.

derimagia commented 7 years ago

If I don't do aliases for every available client - I'll probably do something similar to this. Either that or have it remember what you opened last. It depends on if terminus now allows for dynamic aliases as I don't want to put any aliases that flat out don't work.

derimagia commented 7 years ago

This is now more important since most people will have mysql-cli and another another one

brayfe commented 7 years ago

+1 for this idea .... typing --app=sequelpro every time is a pain. Should be able to configure this in a settings file.

derimagia commented 7 years ago

@brayfe what is running instead? SequelPro should be the default if you have it installed

brayfe commented 7 years ago

Terminus defaulted to MySql-cli. Here's what I got when running the command (scrubbed site connection details)

$ terminus pc site.env
 [notice] Multiple Pancakes Applications were found: MySQL, Sequel Pro. Add --app to be specific on the app.
 [notice] Opening env-site.pantheon.io database in MySQL.

Warning: Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1027
Server version: 5.5.5-10.0.23-MariaDB-log MariaDB Server

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
derimagia commented 7 years ago

Sorry, I haven't used terminus in a while. I think this is my fault for not publishing a later version on composer. Can you try the master branch and see if that resolves your issue? If so I'll publish the version

greg-1-anderson commented 7 years ago

Recently, Terminus quietly inherited some configuration behavior from Robo. If you create a file $HOME/.terminus/config.yml, you may populate it with default settings for your Terminus commands.

For example:

command:
  auth:
    login:
      options:
        machine-token: YOUR_MACHINE_TOKEN_HERE
  site:
    pancakes:
      options:
        app: sequelpro

You must store your configuration under the primary command name (site:pancakes); it will be available regardless of which alias you use to run the command, though. You can override the default values from configuration by supplying the option on the command line.

This is documented in Robo in the Configuration settings of the Getting Started guide. The Terminus documentation could use a similar description.

brayfe commented 7 years ago

Thanks @greg-1-anderson! I tried doing as @derimagia suggested, however, same results. Cloned master from this repo and ran the same command to no avail. Adding the config.yml file made it work perfectly!

$ git clone https://github.com/terminus-plugin-project/terminus-pancakes-plugin.git
Cloning into 'terminus-pancakes-plugin'...
remote: Counting objects: 183, done.
remote: Total 183 (delta 0), reused 0 (delta 0), pack-reused 183
Receiving objects: 100% (183/183), 36.40 KiB | 0 bytes/s, done.
Resolving deltas: 100% (84/84), done.
Checking connectivity... done.
$
$ cd terminus-pancakes-plugin/
terminus-pancakes-plugin (master) $ terminus pc site.env
 [notice] Multiple Pancakes Applications were found: MySQL, Sequel Pro. Add --app to be specific on the app.
 [notice] Opening env-site.pantheon.io database in MySQL.
Warning: Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1054
Server version: 5.5.5-10.0.23-MariaDB-log MariaDB Server

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>