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
|
FluidShell supports shell variables similar to Bash.
There are multiple ways to create (both local and global) variables in FluidShell.
1. declare
and set
:$ declare myvar='My Value'
The above command would declare a local variable which is not available to child processes such as those opened via exec
command.
declare is an alias
for set command which also performs exactly the same function.
To set global variables such as those that could be used by child sub-processes you can use the -x
attribute along with the declare command.
:$ declare -x myGvar='My Value'
2. ask
ask allows you to define a variable interactively i.e you can prompt the user for its (variable) value at FluidShell console.
:$ ask -m "Enter value:" myVar
3. A third convenient way to create variables is to use the export
command. It works in pretty much the same way as declare, however it creates a global variable implicitly.
To list all variables within the current shell, you may execute set or declare
:$ set CLI_SHELL_LINE_INTERPRETER_ERROR_ON_EXPLICIT_CMD_NOT_FOUND=true CLI_SHELL_LINE_INTERPRETER_EVAL_COMMENT=sql CLI_SHELL_LINE_INTERPRETER_EVAL_EXPLICIT_CMD=true CLI_SHELL_LINE_INTERPRETER_EVAL_EXPLICIT_SQL=false CLI_SHELL_LINE_INTERPRETER_EVAL_HISTORY=true CLI_SHELL_LINE_INTERPRETER_EVAL_IMPLICIT_CMD=true CLI_SHELL_LINE_INTERPRETER_EXPLICIT_CMD_CHAR=\ CLI_SHELL_LINE_INTERPRETER_EXPLICIT_SQL_CHAR=; CLI_SHELL_LINE_INTERPRETER_IMPLICIT_BEHAVIOR=sql CLI_SHELL_LINE_INTERPRETER_IS_AT_SIGN_GO=true CLI_SHELL_LINE_INTERPRETER_IS_FORWARDSLASH_GO=true CLI_SHELL_LINE_INTERPRETER_IS_SEMICOLON_GO=false CLI_SHELL_LINE_INTERPRETER_PERFORM_ALIAS_EXPANSION=true CONNECTIONS=C:\Users\vikram\.datastudio\connections
Aliases
The following table lists command aliases defined in the FluidShell:
Alias | Command |
go | \go |
GO | \go |
ls | \ls -l |
man | \help |
set | \declare |
Variables
The following table defines pre-set variables and their function.
CONNECTIONS | Provides the directory name for "Local Database Servers" folder. |
DATABASE | Contains database name which will be used by \connect and \reconnect commands. |
HISTFILE | Provides the location of the command buffer file. |
HISTSAVE | Determines whether the command history should be saved on disk or not. |
HISTSIZE | Number of lines to be kept in the command history buffer. |
LINENO | An internal variable which contains the current line number within the SQL buffer. |
MAX_ROWS | Determines the maximum number of rows returned by the \go command. |
PROMPT | Allows changing the command prompt. |
SERVERNAME | This variable contains the current connection server name, when connected. |
SHELL_VERSION | Contains the FluidShell version number. |
SQL_VARIABLES | Determines whether the variables should be expanded in SQL statements or not. |
USERNAME | This variable contains the current connection user name, when connected. |
CLI
The following are the default settings for the Command Line Shell mode. These determine how \cli shell interprets sql statements and commands. See the \cli page for more on the three available modes ( \cli fluid, \cli shell, \cli sql). By default, the FluidShell is in \cli fluid mode.
CLI_SHELL_LINE_INTERPRETER_ERROR_ON_EXPLICIT_CMD_NOT_FOUND="true" | Reports an error if it cannot find an explicit command that is preceded by \ |
CLI_SHELL_LINE_INTERPRETER_EVAL_COMMENT="shell" | Evaluates a line to a comment with a leading # |
CLI_SHELL_LINE_INTERPRETER_EVAL_EXPLICIT_CMD="true" | Allows use of fluidshell commands without a preceding \ |
CLI_SHELL_LINE_INTERPRETER_EVAL_EXPLICIT_SQL="true" | Disables explicit SQL, meaning the preceding character in CLI_SHELL_LINE_INTERPRETER_EXPLICIT_SQL_CHAR="" is required for interpreting SQL statements |
CLI_SHELL_LINE_INTERPRETER_EVAL_HISTORY="true" | Enables the command history |
CLI_SHELL_LINE_INTERPRETER_EVAL_IMPLICIT_CMD="true" | Evaluates commands when they are not preceded by \ |
CLI_SHELL_LINE_INTERPRETER_EXPLICIT_CMD_CHAR="\\" | Determines which character must precede a command for it to be interpreted when CLI_SHELL_LINE_INTERPRETER_EVAL_EXPLICIT_CMD="true" |
CLI_SHELL_LINE_INTERPRETER_EXPLICIT_SQL_CHAR=";" | Determines which character must precede an SQL statement for it to be interpreted when CLI_SHELL_LINE_INTERPETER_EVAL_EXPLICIT_SQL="true" |
CLI_SHELL_LINE_INTERPRETER_IMPLICIT_BEHAVIOR="shell" | Determines which mode |
CLI_SHELL_LINE_INTERPRETER_IS_AT_SIGN_GO="true" | Determines if @ can be used as a statement separator |
CLI_SHELL_LINE_INTERPRETER_IS_FORWARDSLASH_GO="true" | Determines if / can be used as a statement separator |
CLI_SHELL_LINE_INTERPRETER_IS_SEMICOLON_GO="false" | Determines if ; can be used as a statement separator |
CLI_SHELL_LINE_INTERPRETER_PERFORM_ALIAS_EXPANSION="true" | Allows alias expansion |
SQL Results Options
You can set preferences using the \set command.
For example,
To display SQL Statement, use the command | \set CMD_GO_SHOW_SQL |
Display column headers | \set CMD_GO_SHOW_COLUMNHEADERS |
Display query statistics | \set CMD_GO_SHOW_QUERYSTATS |
Display warnings | \set CMD_GO_SHOW_WARNINGS |
Display warnings headers | \set CMD_GO_SHOW_WARNINGHEADERS |
Always display 'records affected' count | \set CMD_GO_SHOW_ALWAYSDISPLAYSUCCESS |
Display only the total number of affected records | \set CMD_GO_SHOW_SUM |
Margin character length | \set CMD_GO_SHOW_MARGINCHARLENGTH |
Display client statistics | \set CMD_GO_SHOW_CLIENTSTATS |
Display SQL results as form entries | \set CMD_GO_SHOW_RESULTSASFORM |
Display when execution stops on an error | \set CMD_GO_SHOW_EXEC_STOPONERROR |
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017