Table of Contents
Valentina Studio Command Line Interface
Command line interface allows you to interact with the Valentina Studio from the terminal or automation (batch, bash) scripts.
Keys should start with “-” sign. Values, if necessary, are specified after space, next to the key. Some keys can be optional.
Open Connection
To open a connection to specified server or database the following command may be used:
vstudio -open_connection $conn_str [-sql_editor] [-query $query | -file $file_path] [-execute]
Keys description:
- -open_connection – open a connection, specified by the $conn_str parameter, it has Valentina Report datasources format
- -sql_editor – open SQL Editor for new connection
- -query – put $query text into the SQL Editor
- -file – open $file_path in the SQL Editor
- -execute – execute $query or $file_path immediately
Examples
Open a connection to PostgreSQL server, open database, open SQL Editor with specified file and execute it:
$ "./Valentina Studio.app/Contents/MacOS/Valentina Studio" \ -open_connection "postgresql://host = 'localhost' port = '5432' user = 'postgres' password = 'postgres' dbname='pagila'" \ -sql_editor \ -file "/Users/user/Documents/script1.sql" \ -execute
Open a connection to MySQL server, open database, open SQL Editor with specified query and execute it:
$ "./Valentina Studio.app/Contents/MacOS/Valentina Studio" \ -open_connection "mysql://host = 'localhost' port = '3306' user = 'root' password = 'root' dbname='sakila'" \ -sql_editor \ -query "SELECT * FROM actor" \ -execute
Open Connect Dialog
The following command is used to open the connect dialog after the Valentina Studio start:
$ "./Valentina Studio.app/Contents/MacOS/Valentina Studio" -connect
Report Editor
It is also possible to use the Valentina Studio CLI for report generation.