SQL-like query language for csv

Built-in Commands

name description
ECHO Print a value
PRINT Print a value formatted according to the type
PRINTF Print a formatted value
SOURCE Load and execute an external file
EXECUTE Execute a string as statements
SHOW Show objects
SHOW FIELDS Show fields in a table or a view
CHDIR Change current working directory
PWD Print current working directory
RELOAD CONFIG Reload configuration json files
SYNTAX Print syntax

Command Syntax

ECHO

Print a value. This command returns the same result as “PRINTF ‘%s’ USING value”.

ECHO value;
value
value

PRINT

Print a value formatted according to the type.

PRINT value;
value
value

PRINTF

Print a formatted value.

PRINTF format [, replace_value ...];
PRINTF format USING replace_value [, replace_value ...];
format
string
replace_value
value

The format is the same as the FORMAT function

SOURCE

Load and execute an external file as a part of the procedure.

SOURCE file_path;
file_path
string or identifier

EXECUTE

Execute a string as statements.

EXECUTE statements;
EXECUTE statements USING replace_value [, replace_value...];
statements
string
replace_value
string

If replace_values are specified, then placeholders in statements are replaced with replace_values. The format is the same as the FORMAT function

SHOW

Show objects.

SHOW {TABLES|VIEWS|CURSORS|FUNCTIONS|STATEMENTS|FLAGS|ENV|RUNINFO};
TABLES
Loaded Tables
VIEWS
Created Temporary Tables
CURSORS
Declared Cursors
FUNCTIONS
Declared User Defined Functions
STATEMENTS
Prepared Statements
FLAGS
List of Flags
ENV
List of Environment Variables
RUNINFO
List of Runtime Information

SHOW FIELDS

Show fields in a table or a view.

SHOW FIELDS FROM table_name;
table_name
identifier or Table Object

table name or view name.

CHDIR

Change current working directory.

CHDIR directory_path;
directory_path
string or identifier

PWD

Print current working directory.

PWD;

RELOAD CONFIG

Reload configuration json files.

RELOAD CONFIG;

SYNTAX

Print syntax.

SYNTAX [search_word [, search_word ...]];
search_word
string or identifier