Easily find issues by searching: #<Issue ID>
Example: #1832
Easily find members by searching in: <username>, <first name> and <last name>.
Example: Search smith, will return results smith and adamsmith
Aqua Data Studio / nhilam |
Follow
827
|
To open a FluidShell window you click on the FluidShell button in the Server application menu or application toolbar with a key binding of Ctrl-Shift-F. When opening a FluidShell, the shell will attempt to establish a default database connection to any registered server the user may have selected in the schema browser. If no server is selected then no default database connection will be established in the newly open shell.
Once the new FluidShell is open, it will execute any initialization script. If a FluidShell is open on a specific registered server it will execute the initialization script defined in the server registration in the FluidShell tab. If a FluidShell is open without a registered server it will execute the global initialization script defined in the File > Options > FluidShell > Script. Users may configure their shells environment per registered server or at a global level by issuing any specific shell commands.
FluidShell Application Toolbar Button |
FluidShell Right Click Menu |
Server Properties FluidShell tab |
In the FluidShell command prompt users may execute commands by typing the command name and hitting enter. Adding a "\" to the beginning of a command will give the shell an explicit request to execute the command line as a shell command. The first command to test is the help
command which will give you a list of commands available in the shell.
:$ \help
:$ \help go
:$ export | grep CLI declare -x CLI_SHELL_LINE_INTERPRETER_ERROR_ON_EXPLICIT_CMD_NOT_FOUND="true" declare -x CLI_SHELL_LINE_INTERPRETER_EVAL_COMMENT="sql" declare -x CLI_SHELL_LINE_INTERPRETER_EVAL_EXPLICIT_CMD="true" declare -x CLI_SHELL_LINE_INTERPRETER_EVAL_EXPLICIT_SQL="false" declare -x CLI_SHELL_LINE_INTERPRETER_EVAL_HISTORY="true" declare -x CLI_SHELL_LINE_INTERPRETER_EVAL_IMPLICIT_CMD="true" declare -x CLI_SHELL_LINE_INTERPRETER_EXPLICIT_CMD_CHAR="\\" declare -x CLI_SHELL_LINE_INTERPRETER_EXPLICIT_SQL_CHAR=";" declare -x CLI_SHELL_LINE_INTERPRETER_IMPLICIT_BEHAVIOR="sql" declare -x CLI_SHELL_LINE_INTERPRETER_IS_AT_SIGN_GO="true" declare -x CLI_SHELL_LINE_INTERPRETER_IS_FORWARDSLASH_GO="true" declare -x CLI_SHELL_LINE_INTERPRETER_IS_SEMICOLON_GO="false" declare -x CLI_SHELL_LINE_INTERPRETER_PERFORM_ALIAS_EXPANSION="true"
To learn more about each CLI shell variables visit the Shell Variable documentation : LINK
cli
that makes it easier to control the behavior of the CLI. You can learn more about the command with:\help cli
:$ ls
:$ select * from orders
alias
command to list or create aliases :
:$ alias alias go='\go' alias GO='\go' alias ls='ls -l' alias man='help' alias set='declare'
Create new alias :
:$ alias ls='ls -lh' :$ ls drwx- 4.0K 2012-08-06 12:45 directory1 drwx- 4.0K 2012-08-06 12:45 directory2 drwx- 4.0K 2012-07-18 13:13 directory3 -rw-- 5.7M 2012-08-04 07:37 orders.csv
To view the contents of the SQL buffer you may click on the toolbars SQL buffer button which includes the line number the buffer is at to the right. This will popup an editor where you may modify the SQL buffer. You can also use the sqlbuffer
command to view or clear the buffer. Below is an example of how to enter, print and clear the SQL buffer.
:$ sqlbuffer -p :$ select * from orders :$ limit 5 :$ sqlbuffer -p select * from orders limit 5 :$ sqlbuffer -c :$ sqlbuffer -p :$
Once the SQL buffer contains the SQL you want to execute, you can use the <go> command. Below is an example of how to enter an SQL statement into the SQL buffer and then execute it.
:$ select order_id, product_name, quantity :$ from orders :$ limit 5 :$ go order_id product_name quantity ----------- --------------- ----------- 01012007-72207-847 Aqua Data Studio v6.0 [w/ One Year Subscription] 1 01012007-72207-ROWBOAT Aqua Data Studio v6.0 [w/ One Year Subscription] 1 01012008-72207-14343 Aqua Data Studio v6.5 [w/ One Year Subscription] 1 01012008-72207-1529 Aqua Data Studio v6.5 [w/ One Year Subscription] 1 01012008-72207-BLACKDUCK Aqua Data Studio v6.5 [w/ One Year Subscription] 1 5 record(s) selected [Fetch MetaData: 1ms] [Fetch Data: 0ms] [Executed: 9/11/2012 8:45:15 AM] [Execution: 1ms]
FluidShell Query Executed |
FluidShell Multiline Query |
As you work in the shell you may want to execute previously execute shell commands or SQL commands. The shell maintains a list of previously executed shell commands. The history behavior is controled by the shell variables HIST* which can be viewed as follows :
:$ export | grep HIST declare -x CLI_SHELL_LINE_INTERPRETER_EVAL_HISTORY="true" declare -x HISTCONTROL="ignoredups:ignorespace" declare -x HISTFILE="/home/dbuser/.datastudio/.datastudio/connections/MySQL-Server.history" declare -x HISTFILESIZE="500" declare -x HISTSIZE="500"
:$ history ... 58 export 59 clear 60 export | grep HIST 61 history 62 export | grep history 63 clear 64 history :$ !60 export | grep HIST declare -x CLI_SHELL_LINE_INTERPRETER_EVAL_HISTORY="true" declare -x HISTCONTROL="ignoredups:ignorespace" declare -x HISTFILE="/home/dbuser/.datastudio/.datastudio/connections/MySQL-Server.history" declare -x HISTFILESIZE="500" declare -x HISTSIZE="500" :$
To learn more about each history shell variables visit the Shell Variable documentation : LINK
-> try out some autocompletion on shell commands and SQL.
-> notice the execution time at top right to tell you how long a command takes to execute.
-> manage db connections. use \connect, \reconnect, \disconnect and \session to manage your connections. You may also use the reconnect button on the toolbar.
-> Understanding pipelines, redirection, variable sub & sql variable sub.
a. redirection
b. pipeline
c. variable sub
d. sql variable sub
D. Exporting data to Excel using pipelines and redirection. :
:$ select * from orders
:$ sqlexport | csv2excel > orders.xlsx
E. Writing and Excuting Scripts
Edit a file called myscript.sql and add the lines :
select * from orders
sqlexport | csv2excel > orders.xlsx
Then execute the file with :
:$ source myscript.sql
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017