Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag for connection command when fetching database credentials #502

Open
fernando-villalba opened this issue Jan 29, 2025 · 0 comments

Comments

@fernando-villalba
Copy link
Contributor

fernando-villalba commented Jan 29, 2025

Description

Currently with civo database credentials we have this:

  -c, --connection-string   show the connection string for the database

Which outputs this

postgresql://civo:[email protected]:5432

This isn't bad, but we can do better.

We need a flag to give a full connection command for the DB so the user can just copy and paste that.

Acceptance Criteria

  • Add a flag like this:
civo database credentials --cmd

(flag could be something else if the implementor has better ideas)

  • The output of the flag for psql must be this (replacing ip, password, etc):
psql "postgresql://[db-user]:[db-password]@[db-ip]:[dp-port]/postgres?sslmode=require"
  • The output for mysql must be this:
mysql --ssl-mode=REQUIRED --host=[managed-db-ip] --port=[db-port] --user=[db-user] --password='[db-password]'

Please not that for the password in the mysql command it needs to have the single quotes because it occasionally uses characters like #

Additionally when the user uses the command on its own like so:

civo database credentials db-name

Add the command to one of the columns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant