|
1 | | -# SQLcl Connection Alias Generators |
| 1 | +# SQLcl Utilities |
2 | 2 |
|
3 | 3 | ## Purpose |
4 | | -Generate BASH or ZSH shell aliases for connecting via [SQLcl](https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/) to Oracle databases defined in TNS files or OID LDAP servers. |
| 4 | +This plugin provides different utility functions to help you interact with [Oracle SQLcl](https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/). |
| 5 | + |
| 6 | +One function, `sqlclUpdater` helps you install and update SQLcl. |
| 7 | + |
| 8 | +Another function, `sqlclConnectHelper` wraps a script around SQLcl to allow for unix style parameters to be passed to SQLcl. |
| 9 | + |
| 10 | +`sqlclGenerateTNSAliases` and `sqlclGenerateOIDAliases` generate BASH/ZSH shell aliases for connecting via SQLcl to Oracle databases defined in TNS files or OID LDAP servers. |
5 | 11 |
|
6 | 12 | By default, the generated aliases take the format of `sql.database_name`. However, the alias name is completely customizable via a prefix parameter or an alias name format function (or both!). |
7 | 13 |
|
8 | | -### About this plugin |
9 | | -This plugin provides 3 seperate functions: |
| 14 | +### Utility Functions |
| 15 | + |
| 16 | +#### sqlclUpdater |
| 17 | +<details> |
| 18 | +This function will download the latest version of Oracle SQLcl and unzip it into a given directory. The specific version of SQLcl downloaded is unzipped into a child directory or the given directory with the name of the SQLcl version. It additionally creates a symlink called 'latest' that points to the most recently downloaded version of SQLcl. You can also specify to create a symlink called 'live' that points to the most recently downloaded version of SQLcl as well as specify the number of versions of SQLcl to keep. |
| 19 | + |
| 20 | +If you do not specify the directory to use for SQLcl downloads, `/opt/sqlcl` will be used. The `/opt` directory usually requires root permissions. Best practice would be to create the `/opt/sqlcl` directory and set the group permissions to allow for write and make sure you are a member of the group. Then you can work on SQLcl versions (update symlinks, download new versions, etc) without needing to use `sudo`. |
| 21 | +</details> |
10 | 22 |
|
11 | 23 | #### sqlclConnectHelper |
12 | 24 | <details> |
@@ -60,27 +72,27 @@ The function accepts either a tnsnames.ora file in the standard oracle location, |
60 | 72 |
|
61 | 73 | ### Manual installation (ZSH) |
62 | 74 | ```shell |
63 | | -git clone 'https://github.com/jasonlyle88/sqlcl-connection-alias-generators' "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-connection-alias-generators" |
64 | | -echo 'source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-connection-alias-generators/sqlcl-connection-alias-generators.plugin.zsh"' >> "${HOME}/.zshrc" |
65 | | -source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-connection-alias-generators/sqlcl-connection-alias-generators.plugin.zsh" |
| 75 | +git clone 'https://github.com/jasonlyle88/sqlcl-utilities' "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-utilities" |
| 76 | +echo 'source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-utilities/sqlcl-utilities.plugin.zsh"' >> "${HOME}/.zshrc" |
| 77 | +source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-utilities/sqlcl-utilities.plugin.zsh" |
66 | 78 | ``` |
67 | 79 |
|
68 | 80 | ### Manual installation (BASH) |
69 | 81 | ```shell |
70 | | -git clone 'https://github.com/jasonlyle88/sqlcl-connection-alias-generators' "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-connection-alias-generators" |
71 | | -echo 'source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-connection-alias-generators/sqlcl-connection-alias-generators.plugin.bash"' >> "${HOME}/.bashrc" |
72 | | -source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-connection-alias-generators/sqlcl-connection-alias-generators.plugin.bash" |
| 82 | +git clone 'https://github.com/jasonlyle88/sqlcl-utilities' "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-utilities" |
| 83 | +echo 'source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-utilities/sqlcl-utilities.plugin.bash"' >> "${HOME}/.bashrc" |
| 84 | +source "${XDG_CONFIG_HOME:-${HOME}}/sqlcl-utilities/sqlcl-utilities.plugin.bash" |
73 | 85 | ``` |
74 | 86 |
|
75 | 87 | ### Installation with ZSH package managers |
76 | 88 |
|
77 | 89 | #### [Antidote](https://getantidote.github.io/) |
78 | | -Add `jasonlyle88/sqlcl-connection-alias-generators` to your plugins file (default is `~/.zsh_plugins.txt`) |
| 90 | +Add `jasonlyle88/sqlcl-utilities` to your plugins file (default is `~/.zsh_plugins.txt`) |
79 | 91 |
|
80 | 92 | #### [Oh-My-Zsh](https://ohmyz.sh/) |
81 | 93 | ```shell |
82 | | -git clone 'https://github.com/jasonlyle88/sqlcl-connection-alias-generators' "${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/sqlcl-connection-alias-generators" |
83 | | -omz plugin enable sqlcl-connection-alias-generators |
| 94 | +git clone 'https://github.com/jasonlyle88/sqlcl-utilities' "${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/sqlcl-utilities" |
| 95 | +omz plugin enable sqlcl-utilities |
84 | 96 | ``` |
85 | 97 |
|
86 | 98 | #### Others |
|
0 commit comments