Console Client

The console is one of the ways to communicate with the database server. It allows you to enter data definition or manipulation queries, import data or benchmark timings.

Running the Console Client

Linux

Console client is located in ./console/ColmnarDB.ConsoleClient. Run it using command ./ColmnarDB.ConsoleClient if you are located in directory ./console. Console have to be started after the successful start of database core. Start by typing command help to see all the options that console supports (the list of supported console commands is documented here as well).

Windows

Console client is located in .\console\ColmnarDB.ConsoleClient.exe. Just double click on it or run it using powershell or cmd (.\ColmnarDB.ConsoleClient.exe). Console have to be started after the successful start of database core. Start by typing command help to see all the options that console supports (the list of supported console commands is documented here as well).

Commands

Console supports following commands or directly written SQL queries. Syntax of commands is case insensitive.

Use, U

USE database_name, U database_name

Since version: 1.4 Prior to running the query, it is necessary to specify database, by Use command. This changes context to all subsequent queries.

If you are not sure about the names of imported databases, enter SHOW DATABASES command.

If there is no database, it should be created by running query CREATE DATABASE.

Query

[QUERY] sql_query

Since version: 1.4 Query itself written according to currently supported SQL syntax for data definition or data modification. Query command is optional and SQL query can be directly written to the console client.

If you are not sure about tables and columns in the database in use, enter SHOW TABLES and SHOW COLUMNS FROM table_name.

Script, S

SCRIPT file_path, S file_path

Since version: 1.4.2 Runs SQL queries from a file path (also supports console client command USE and IMPORT). Commands in script file are seprated by new line, so every command has to start on a new line and end on the line it started. If you want to skip a command or a query in a script file, just make that command a single line comment (in sql, single line comments starts with double dash '--').

Import, I

Since version: 1.4 Import currently support only CSV files or files with character separated columns.

IMPORT database_name filename_with_path
[block_size] [has_header] [column_separator] [threads_count] [batch_size]

The database has to exists before importing into it, but does not need to be in use (using command 'use'). Prior to importing, table with name of the imported file (without extension) will be created.

If optional arguments are not supported, default values and automatic guessing will be performed:

  • block_size is set according to default configuration of the database server

  • has_header is by default true

  • column_separator is guessed automatically

  • threads_count is set by CPU number of cores

  • batch_size is by default 100 000

Example:

IMPORT test_database "C:\temp\sample.csv"

Timing, T

Since version: 1.4.1 Runs a query 201 times and prints the first run execution time and average execution time from 200 cached query runs.

Docs, Man

Since version: 1.4 Prints URL link where this documentation can be found.

Help, H

Since version: 1.4 Provides information about supported commands and their syntax.

Exit, Quit, Q

Since version: 1.4 Exits the console program