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

[SQLLINE-386] support working with saved connections #397

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

snuyanzin
Copy link
Collaborator

@snuyanzin snuyanzin commented Oct 20, 2020

  1. Path to file with connections could be specified in connectionConfig property
  2. Connections in a file have names, these names could be used as connection nicknames
  3. Connections allowed for both: input args and !connect command
  4. !resetconfconnections !rereadconfconnections to reset connections loaded from file or use another file
  5. !confconnections !showconfconnections to read current connection file content

example of usage !connect -c con_name where con_name or !connect -cn con_name and then con_name will be also used as a nickname.
It is still possible to specify properties, the full rule is

Usage: connect [-p property value]* (-(c|cn) <connectionName> | <url>) [username] [password] [driver]

the content of connection file is like:

pg:
  url: jdbc:postgresql://localhost:5432/postgres
  user: postgres
  password: postgres
mysql: # comment
  url: jdbc:mysql://localhost/mysql?autoReconnect=true
  user: mysql
  password: mysql
pg2:
  url: jdbc:postgresql://localhost:5432/postgres2
  user: postgres2
  password: postgres2

name of connection on a separate line, then connection properties with indentation (number of does not matter but must be same for all properties within connection).
comments are supported only on a separate line and on a connection name line

should fix #386

@snuyanzin
Copy link
Collaborator Author

rebased and added doc

@snuyanzin snuyanzin force-pushed the saved_connections_in_file branch from 10708bd to 6eb961a Compare December 8, 2020 18:38
@snuyanzin
Copy link
Collaborator Author

resolved merge conflicts, rebased

1. Path to file with connections could be specified in connectionConfig property
2. Connections in a file have names, these names could be used as connection nicknames
3. Connections are allowed for both: input args and !connect command
4. !rereadconfconnections to reset connections loaded from file or use another file
5. !showconfconnections to read current connection file content
@snuyanzin snuyanzin force-pushed the saved_connections_in_file branch from 343d5e5 to a7d3a95 Compare December 10, 2020 07:43
@snuyanzin snuyanzin merged commit a7d3a95 into julianhyde:master Dec 10, 2020
@github-pages github-pages bot temporarily deployed to github-pages December 10, 2020 10:00 Inactive
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

Successfully merging this pull request may close these issues.

saved connection details
1 participant