XSQL contains a command line launcher. Using this launcher, we can execute scripts whose code resides in local files or database dictionaries.

1 Requirements

A local server must be available, displayed in the work directory and correctly configured, if database access is required.

2 Arguments

From the command line, an XSQL script can be executed using the shell bin/script.sh. See the following example:

bin/script.sh -file test1.xml

This command may be composed of various arguments:

  • -file: specifies the path location of the script to be interpreted.
  • -dbms: indicates the name of the database with which the system interacts, if required by the script.
  • -user: accesses username.
  • -test: organizes the use of specific unit testing defined in the script itself.
  • -print: shows the script code onscreen, as well as its previous executions.
  • -debug: obtains detailed information about the line-by-line execution of code.
  • -dump: performs a complete dump, although it also indicates the level of the dump: dump all|var|mem|sql|top|dbperf|fun|cmd.
  • -cover: enables the script's coverage algorithm, indicating the percentage of the script which has been executed.
  • -noremovetemp: does not remove temporary files once program execution has been finalized, in order to perform later analysis of their content if needed.

To see all available options, execute the command without arguments.

3 Security

If the execution requires a user (if a database connection is realized), then the user password which will be used to connect must be entered.

If a password is not indicated, the program will request one. Passwords can be indicated using the -pass flag. The password will be verified; if correct, the tuple <user=encoded_password> will be stored in the directory conf, inside the file webstudio-users.properties. This file stores the passwords for all users involved in the machine's XSQL executions.

Each time a script is executed with a user, the program searches for the password in the file websutdio-users.properties. If the password is found, it is verified; if not, it is requested. If the password is incorrect, the program will request it again.

The password is encoded according to the host, so the file is not portable between multiple machines.