CM
Declare the named connections used by the other functions: SQL databases (MySQL, Oracle, PostgreSQL, SQL Server, H2 and more), file transfer servers (FTP, FTPS, SFTP, SSH, CIFS) and mail servers (SMTP, POP3, IMAP). Define a connection once with
cm set ..., then refer to it by name in scripts, list it with cm show or deploy it elsewhere with cm generate_update.cm set mentdbcm set as400cm set db2cm set derby_embeddedcm set derby_servercm set firebirdcm set h2_embeddedcm set h2_servercm set hsql_embeddedcm set hsql_servercm set mysqlcm set oraclecm set postgresqlcm set sqlservercm set mariadbcm set clickhousecm set trinocm set filecm set ftpcm set ftpscm set sftpcm set sshcm set cifscm set smtpcm set pop3cm set imapcm show_scrudcm showcm show_objcm getcm generate_updatecm existcm removecm templatescm templatescm set_config
cm set mentdb <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_mentdb" {execute "mentdb.remote.config.get" "[hostname]" "localhost" "[port]" "9998" "[key]" "pwd" "[user]" "admin" "[password]" "pwd" "[connectTimeout]" "10000" "[readTimeout]" "30000" "[subTunnels]" (mql { tunnel execute_hot "tunnelId1" {cm get "demo_cm_mentdb";} (mql { tunnel execute_hot "tunnelId2" {cm get "demo_cm_mentdb";} (mql { [MQL_TO_REPLACE] }); }); }) ;};
mentdb
1
cm set as400 <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_as400" {execute "db.as400.config.get" "[hostname]" "localhost" "[port]" "8471" "[database]" "test_db" "[user]" "bob" "[password]" "pwd" ;};
mentdb
1
cm set db2 <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_db2" {execute "db.db2.config.get" "[hostname]" "localhost" "[port]" "50000" "[database]" "test_db" "[user]" "db2admin" "[password]" "pwd" ;};
mentdb
1
cm set derby_embedded <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_derby_embedded" {execute "db.derby.embedded.config.get" "[database]" "test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1
cm set derby_server <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_derby_server" {execute "db.derby.server.config.get" "[hostname]" "localhost, 127.0.0.1" "[port]" "1527" "[database]" "test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1
cm set firebird <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_firebird" {execute "db.firebird.config.get" "[hostname]" "localhost" "[port]" "3050" "[database]" "test_db" "[user]" "SYSDBA" "[password]" "masterkey" ;};
mentdb
1
cm set h2_embedded <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_h2_embedded" {execute "db.h2.embedded.config.get" "[database]" "dir/test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1
cm set h2_server <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_h2_server" {execute "db.h2.server.config.get" "[hostname]" "localhost, 127.0.0.1" "[port]" "9091" "[database]" "test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1
cm set hsql_embedded <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_hsql_embedded" {execute "db.hsql.embedded.config.get" "[database]" "test_db" "[user]" "SA" "[password]" "SA" ;};
mentdb
1
cm set hsql_server <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_hsql_server" {execute "db.hsql.server.config.get" "[hostname]" "localhost, 127.0.0.1" "[port]" "9001" "[database]" "test_db" "[user]" "SA" "[password]" "SA" ;};
mentdb
1
cm set mysql <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_mysql" {execute "db.mysql.config.get" "[hostname]" "localhost" "[port]" "3306" "[database]" "test_db" "[user]" "bob" "[password]" "pwd" ;};
mentdb
1
cm set oracle <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_oracle" {execute "db.oracle.config.get" "[hostname]" "localhost" "[port]" "1521" "[database]" "xe" "[user]" "sys" "[password]" "pwd" ;};
mentdb
1
cm set postgresql <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_postgresql" {execute "db.postgresql.config.get" "[hostname]" "localhost" "[port]" "5432" "[database]" "test_db" "[user]" "postgres" "[password]" "pwd" ;};
mentdb
1
cm set sqlserver <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_sqlserver" {execute "db.sqlserver.config.get" "[hostname]" "localhost" "[port]" "1195" "[database]" "test_db" "[user]" "sa" "[password]" "pwd" ;};
mentdb
1
cm set mariadb <key> <object>
Description
Set a MariaDB connection (MySQL dialect: show tables, scrud and data quality work as with MySQL)
Set a MariaDB connection (MySQL dialect: show tables, scrud and data quality work as with MySQL)
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_mariadb" {execute "db.mariadb.config.get" "[hostname]" "localhost" "[port]" "3306" "[database]" "test_db" "[user]" "bob" "[password]" "pwd" ;};
mentdb
1
cm set clickhouse <key> <object>
Description
Set a ClickHouse connection (HTTP port, 8123 by default). Use sql dml, sql select, sql to json and sql bulk_insert; ClickHouse has no transactions, so sql bulk_upsert, scrud and data quality are not available
Set a ClickHouse connection (HTTP port, 8123 by default). Use sql dml, sql select, sql to json and sql bulk_insert; ClickHouse has no transactions, so sql bulk_upsert, scrud and data quality are not available
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_clickhouse" {execute "db.clickhouse.config.get" "[hostname]" "localhost" "[port]" "8123" "[database]" "default" "[user]" "default" "[password]" "pwd" ;};
mentdb
1
cm set trino <key> <object>
Description
Set a Trino connection (catalog and schema). With a password the connection uses HTTPS, as Trino requires; an empty password means plain HTTP
Set a Trino connection (catalog and schema). With a password the connection uses HTTPS, as Trino requires; an empty password means plain HTTP
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_trino" {execute "db.trino.config.get" "[hostname]" "localhost" "[port]" "8080" "[catalog]" "memory" "[schema]" "default" "[user]" "bob" "[password]" "" ;};
mentdb
1
cm set file <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_file" {execute "file.local.config.get" "[dir]" "/Users/jimmitry/Desktop" ;};
mentdb
1
cm set ftp <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_ftp" {execute "file.remote.ftp.config.get" "[hostname]" "localhost" "[port]" "21" "[user]" "bob" "[password]" "pwd" ;};
mentdb
1
cm set ftps <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_ftps" {execute "file.remote.ftps.config.get" "[hostname]" "localhost" "[port]" "21" "[user]" "bob" "[password]" "pwd" "[protocol]" "TLS" "[isImplicit]" false "[connectTimeout]" 10000 "[dataTimeout]" 30000 "[keepAliveTimeout]" 300 ;};
mentdb
1
cm set sftp <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_sftp" {execute "file.remote.sftp.config.get" "[hostname]" "localhost" "[port]" "22" "[user]" "bob" "[password]" "pwd" "[connectTimeout]" 10000 "[dataTimeout]" 30000 ;};
mentdb
1
cm set ssh <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_ssh" {execute "file.remote.ssh.config.get" "[hostname]" "localhost" "[port]" "22" "[user]" "bob" "[password]" "pwd" "[connectTimeout]" 10000 ;};
mentdb
1
cm set cifs <key> <object>
Description
Set a connection
Set a connection
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_cifs" {execute "file.remote.cifs.config.get" "[hostname]" "192.168.220.130" "[port]" "445" "[domain]" "domain" "[user]" "bob" "[password]" "pwd" "[connectTimeout]" "10000" "[readTimeout]" "30000" ;};
mentdb
1
cm set smtp <key> <object>
Description
Set an SMTP connection (used by 'mail send').
Fields of the JSON object:
- hostname, port, sender, user, password.
- authentication: 1 = login with user / password, 0 = no login.
- tls: 1 = SMTPS, SSL from the start of the connection (usually port 465). 0 = SMTP without SSL at the connection.
- starttls (optional, since 4.2.1): only with tls=0. 1 = the connection is upgraded to TLS before the login (usually port 587: Office 365, most providers). STARTTLS is then required: nothing is sent if the server does not accept it.
Warning: with tls=0 and without starttls=1, the password and the mails are sent without encryption.
- connectTimeout, sessionTimeout: in milliseconds.
The script 'mail.smtp.config.get' builds the main fields; an optional field is added with 'json iobject' (second example).
Set an SMTP connection (used by 'mail send').
Fields of the JSON object:
- hostname, port, sender, user, password.
- authentication: 1 = login with user / password, 0 = no login.
- tls: 1 = SMTPS, SSL from the start of the connection (usually port 465). 0 = SMTP without SSL at the connection.
- starttls (optional, since 4.2.1): only with tls=0. 1 = the connection is upgraded to TLS before the login (usually port 587: Office 365, most providers). STARTTLS is then required: nothing is sent if the server does not accept it.
Warning: with tls=0 and without starttls=1, the password and the mails are sent without encryption.
- connectTimeout, sessionTimeout: in milliseconds.
The script 'mail.smtp.config.get' builds the main fields; an optional field is added with 'json iobject' (second example).
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_smtp" {execute "mail.smtp.config.get" "[hostname]" "smtp.gmail.com" "[port]" "465" "[sender]" "your-account@gmail.com" "[user]" "your-account@gmail.com" "[password]" "pwd" "[authentication]" true "[tls]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ;};
mentdb
1
admin
json load "cm" (execute "mail.smtp.config.get" "[hostname]" "smtp.office365.com" "[port]" "587" "[sender]" "your-account@company.com" "[user]" "your-account@company.com" "[password]" "pwd" "[authentication]" true "[tls]" false "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ); json iobject "cm" / "starttls" "1" STR; cm set "demo_cm_smtp_587" (json doc "cm");
mentdb
1
cm set pop3 <key> <object>
Description
Set a POP3 connection (used by 'mail download pop3').
Fields of the JSON object:
- hostname, port, user, password.
- ssl: 1 = SSL from the start of the connection (usually port 995).
- tls: 1 = STARTTLS.
- connectTimeout, sessionTimeout: in milliseconds.
- inFolder (optional): the folder to read (default: INBOX).
An optional field is added with 'json iobject' (see 'cm set imap').
Set a POP3 connection (used by 'mail download pop3').
Fields of the JSON object:
- hostname, port, user, password.
- ssl: 1 = SSL from the start of the connection (usually port 995).
- tls: 1 = STARTTLS.
- connectTimeout, sessionTimeout: in milliseconds.
- inFolder (optional): the folder to read (default: INBOX).
An optional field is added with 'json iobject' (see 'cm set imap').
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_pop3" {execute "mail.pop3.config.get" "[hostname]" "pop.gmail.com" "[port]" "995" "[user]" "your-account@gmail.com" "[password]" "pwd" "[tls]" false "[ssl]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ;};
mentdb
1
cm set imap <key> <object>
Description
Set an IMAP connection (used by 'mail download imap' and 'mail download imap_disk').
Fields of the JSON object:
- hostname, port, user, password.
- auth: 1 = LOGIN authentication allowed, 0 = disabled.
- ssl: 1 = SSL from the start of the connection (usually port 993).
- tls: 1 = STARTTLS (usually port 143).
- connectTimeout, sessionTimeout: in milliseconds.
Optional fields (added with 'json iobject', second example):
- inFolder: the folder to read (default: INBOX).
- alternateSubDir: the directory where the mails are saved, instead of a new sub directory '<output_dir>/<timestamp>' (this directory is not created: it must exist).
- xoauth2_scope: 1 = OAuth2 connection (Office 365, Gmail): IMAPS with SASL XOAUTH2, the 'password' field must contain the access token; auth, ssl and tls are then ignored.
- fetchsize (imap_disk only): size of the blocks read from the server, in bytes (default: 1048576; 'mail download imap' always uses 819200).
- partialfetch (imap_disk only): false = each message is read in one block (some Exchange servers cut the big attachments in partial mode). Default: JavaMail default (true).
- max_buffer (imap_disk only): size of the buffer used to write the attachments on the disk, in bytes (default: 8192).
- mark_msgs_order (imap_disk only): actions to replay, see 'mail download imap_disk'.
Set an IMAP connection (used by 'mail download imap' and 'mail download imap_disk').
Fields of the JSON object:
- hostname, port, user, password.
- auth: 1 = LOGIN authentication allowed, 0 = disabled.
- ssl: 1 = SSL from the start of the connection (usually port 993).
- tls: 1 = STARTTLS (usually port 143).
- connectTimeout, sessionTimeout: in milliseconds.
Optional fields (added with 'json iobject', second example):
- inFolder: the folder to read (default: INBOX).
- alternateSubDir: the directory where the mails are saved, instead of a new sub directory '<output_dir>/<timestamp>' (this directory is not created: it must exist).
- xoauth2_scope: 1 = OAuth2 connection (Office 365, Gmail): IMAPS with SASL XOAUTH2, the 'password' field must contain the access token; auth, ssl and tls are then ignored.
- fetchsize (imap_disk only): size of the blocks read from the server, in bytes (default: 1048576; 'mail download imap' always uses 819200).
- partialfetch (imap_disk only): false = each message is read in one block (some Exchange servers cut the big attachments in partial mode). Default: JavaMail default (true).
- max_buffer (imap_disk only): size of the buffer used to write the attachments on the disk, in bytes (default: 8192).
- mark_msgs_order (imap_disk only): actions to replay, see 'mail download imap_disk'.
Parameters
key: The key - string - required
object: The JSON object - string - required
key: The key - string - required
object: The JSON object - string - required
admin
cm set "demo_cm_imap" {execute "mail.imap.config.get" "[hostname]" "imap.gmail.com" "[port]" "993" "[user]" "your-account@gmail.com" "[password]" "pwd" "[auth]" false "[tls]" false "[ssl]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ;};
mentdb
1
admin
json load "cm" (execute "mail.imap.config.get" "[hostname]" "outlook.office365.com" "[port]" "993" "[user]" "your-account@company.com" "[password]" [access_token] "[auth]" false "[tls]" false "[ssl]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ); json iobject "cm" / "xoauth2_scope" "1" STR; json iobject "cm" / "inFolder" "INBOX/Invoices" STR; json iobject "cm" / "partialfetch" "false" STR; cm set "demo_cm_imap_o365" (json doc "cm");
mentdb
1
cm show_scrud
Description
Show all database connections available for SCRUD operations (MySQL or H2 only)
Show all database connections available for SCRUD operations (MySQL or H2 only)
admin
cm show_scrud;
mentdb
[ "MENTDB" ]
Used in use cases (3 recipes)
Configuration & connections › Move a connection to another server without leaking its password
SQL developer in MQL › Register a local H2 database connection
Application developer › CRUD web services generated from a MySQL table
Configuration & connections › Move a connection to another server without leaking its password
SQL developer in MQL › Register a local H2 database connection
Application developer › CRUD web services generated from a MySQL table
Often used with
execute · cm exist · cm generate_update · string contains · string regexp_replace · cm get · cm remove · eval
execute · cm exist · cm generate_update · string contains · string regexp_replace · cm get · cm remove · eval
cm show <type>
Description
Show all connections
Show all connections
Parameters
type: The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
type: The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
admin
cm show;
mentdb
[ "demo_cm_as400", "demo_cm_cifs", "demo_cm_db2", "demo_cm_derby_embedded", "demo_cm_derby_server", "demo_cm_file", "demo_cm_firebird", "demo_cm_ftp", "demo_cm_ftps", "demo_cm_h2_embedded", "demo_cm_h2_server", "demo_cm_hsql_embedded", "demo_cm_hsql_server", "demo_cm_imap", "demo_cm_mentdb", "demo_cm_mysql", "demo_cm_oracle", "demo_cm_pop3", "demo_cm_postgresql", "demo_cm_sftp", "demo_cm_smtp", "demo_cm_ssh" ]
Used in use cases (4 recipes)
Configuration & connections › Declare a local folder connection for your file scripts
CRUD & data API developer › Declare the connections of each environment
File transfer & remote systems engineer › Declare the partner endpoints, secrets kept in private parameters
Integrator & ETL developer › One connection per environment and engine, checked without connecting
Configuration & connections › Declare a local folder connection for your file scripts
CRUD & data API developer › Declare the connections of each environment
File transfer & remote systems engineer › Declare the partner endpoints, secrets kept in private parameters
Integrator & ETL developer › One connection per environment and engine, checked without connecting
Often used with
cm exist · cm get · cm remove · execute · cm show_obj · json parse_array · parameter add · parameter get value
cm exist · cm get · cm remove · execute · cm show_obj · json parse_array · parameter add · parameter get value
cm show_obj <type>
Description
Show all connections as a JSON object
Show all connections as a JSON object
Parameters
type: The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
type: The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
admin
cm show_obj;
mentdb
{ "demo_cm_as400":0, "demo_cm_cifs":0, "demo_cm_db2":0, "demo_cm_derby_embedded":0, "demo_cm_derby_server":0, "demo_cm_file":0, "demo_cm_firebird":0, "demo_cm_ftp":0, "demo_cm_ftps":0, "demo_cm_h2_embedded":0, "demo_cm_h2_server":0, "demo_cm_hsql_embedded":0, "demo_cm_hsql_server":0, "demo_cm_imap":0, "demo_cm_mentdb":0, "demo_cm_mysql":0, "demo_cm_oracle":0, "demo_cm_pop3":0, "demo_cm_postgresql":0, "demo_cm_sftp":0, "demo_cm_smtp":0, "demo_cm_ssh":0 }
Used in use cases (4 recipes)
Configuration & connections › Declare a local folder connection for your file scripts
CRUD & data API developer › Declare the connections of each environment
API & database integrator › Declare the legacy ERP databases: AS/400, DB2, Oracle, Firebird
Configuration & connections › Declare all the connections of a project, passwords from private parameters
Configuration & connections › Declare a local folder connection for your file scripts
CRUD & data API developer › Declare the connections of each environment
API & database integrator › Declare the legacy ERP databases: AS/400, DB2, Oracle, Firebird
Configuration & connections › Declare all the connections of a project, passwords from private parameters
Often used with
cm exist · cm remove · execute · cm get · cm show · json parse_obj · parameter add · parameter remove
cm exist · cm remove · execute · cm get · cm show · json parse_obj · parameter add · parameter remove
cm get <key>
Description
Get a connection
Get a connection
Parameters
key: The key - string - required
key: The key - string - required
admin
cm get "demo_cm_mysql";
mentdb
{ "driver": "com.mysql.cj.jdbc.Driver", "defaultSchema": "test_db", "subType": "MySQL", "loginTimeout": "10000", "jdbc": "jdbc:mysql://localhost:3306/test_db", "type": "db", "properties": { "password": "pwd", "allowMultiQueries": "true", "user": "bob" } }
Used in use cases (53 recipes)
Script developer › Know which scripts a change will affect before touching a library script
Configuration & connections › Declare a local folder connection for your file scripts
SQL developer in MQL › Register a local H2 database connection
CRUD & data API developer › Install the generated update and delete on the key
Industrial quality engineer › Gauge linearity and bias study from the lab database
Statistician & biostatistician › Mincer wage equation from a survey table in SQL
and 47 more in the Use cases
Script developer › Know which scripts a change will affect before touching a library script
Configuration & connections › Declare a local folder connection for your file scripts
SQL developer in MQL › Register a local H2 database connection
CRUD & data API developer › Install the generated update and delete on the key
Industrial quality engineer › Gauge linearity and bias study from the lab database
Statistician & biostatistician › Mincer wage equation from a survey table in SQL
and 47 more in the Use cases
Often used with
execute · sql connect · sql disconnect · sql dml · cm remove · file delete · json parse_array · sql encode
execute · sql connect · sql disconnect · sql dml · cm remove · file delete · json parse_array · sql encode
cm generate_update <key>
Description
Update a connection
Update a connection
Parameters
key: The key - string - required
key: The key - string - required
admin
cm generate_update "demo_cm_mysql";
mentdb
json load "tmpCm" (cm get "demo_cm_mysql"); json uobject "tmpCm" / "driver" "com.mysql.cj.jdbc.Driver" STR; json uobject "tmpCm" / "defaultSchema" "test_db" STR; json uobject "tmpCm" / "subType" "MySQL" STR; json uobject "tmpCm" / "loginTimeout" "10000" STR; json uobject "tmpCm" / "jdbc" "jdbc:mysql://localhost:3306/test_db" STR; json uobject "tmpCm" / "type" "db" STR; json uobject "tmpCm" /properties "password" "pwd" STR; json uobject "tmpCm" /properties "allowMultiQueries" "true" STR; json uobject "tmpCm" /properties "user" "bob" STR; cm set "demo_cm_mysql" {json doc "tmpCm"};
Used in use cases (2 recipes)
Configuration & connections › Move a connection to another server without leaking its password
SQL developer in MQL › Register a local H2 database connection
Configuration & connections › Move a connection to another server without leaking its password
SQL developer in MQL › Register a local H2 database connection
Often used with
cm show_scrud · execute · string contains · string regexp_replace · cm exist · cm get · cm remove · json fields
cm show_scrud · execute · string contains · string regexp_replace · cm exist · cm get · cm remove · json fields
cm exist <key> <type>
Description
Check if a connection id already exists
Check if a connection id already exists
Parameters
key: The key - string - required
type: The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
key: The key - string - required
type: The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
admin
cm exist "demo_cm_mysql"
mentdb
1
Used in use cases (11 recipes)
Configuration & connections › Declare a local folder connection for your file scripts
SQL developer in MQL › Register a local H2 database connection
CRUD & data API developer › Declare the connections of each environment
File transfer & remote systems engineer › Declare the partner endpoints, secrets kept in private parameters
API & database integrator › Read supplier invoices from an Office 365 mailbox
Integrator & ETL developer › One connection per environment and engine, checked without connecting
and 5 more in the Use cases
Configuration & connections › Declare a local folder connection for your file scripts
SQL developer in MQL › Register a local H2 database connection
CRUD & data API developer › Declare the connections of each environment
File transfer & remote systems engineer › Declare the partner endpoints, secrets kept in private parameters
API & database integrator › Read supplier invoices from an Office 365 mailbox
Integrator & ETL developer › One connection per environment and engine, checked without connecting
and 5 more in the Use cases
Often used with
execute · cm remove · cm get · parameter add · parameter get value · string contains · cm show · cm show_obj
execute · cm remove · cm get · parameter add · parameter get value · string contains · cm show · cm show_obj
cm remove <key>
Description
Remove a connection
Remove a connection
Parameters
key: The key - string - required
key: The key - string - required
admin
cm remove "demo_cm_mysql";
mentdb
1
Used in use cases (24 recipes)
Configuration & connections › Declare a local folder connection for your file scripts
CRUD & data API developer › Declare the connections of each environment
Industrial quality engineer › Gauge linearity and bias study from the lab database
Statistician & biostatistician › Mincer wage equation from a survey table in SQL
Data quality analyst › Outlier readings in a sensor table by density clustering
Machine learning engineer › Customer segments straight from a SQL table
and 18 more in the Use cases
Configuration & connections › Declare a local folder connection for your file scripts
CRUD & data API developer › Declare the connections of each environment
Industrial quality engineer › Gauge linearity and bias study from the lab database
Statistician & biostatistician › Mincer wage equation from a survey table in SQL
Data quality analyst › Outlier readings in a sensor table by density clustering
Machine learning engineer › Customer segments straight from a SQL table
and 18 more in the Use cases
Often used with
execute · cm get · file delete · sql disconnect · sql connect · sql dml · string contains · cm exist
execute · cm get · file delete · sql disconnect · sql connect · sql dml · string contains · cm exist
cm templates
Description
The catalog of the connections with a configuration JSON: rows {category, sub, family, label, template}, the template being the cm set_config to fill in
The catalog of the connections with a configuration JSON: rows {category, sub, family, label, template}, the template being the cm set_config to fill in
admin
cm templates
mentdb
[{"category": "NoSQL", "sub": "Documents", "family": "mongodb", "label": "MongoDB", "template": "cm set_config \"my_mongodb\" \"mongodb\" \"{\\\"host\\\": \\\"localhost\\\", \\\"port\\\": 27017, \\\"database\\\": \\\"shop\\\", \\\"username\\\": \\\"app\\\", \\\"password\\\": \\\"mongo\\\"}\";"}, {"category": "NoSQL", "sub": "Documents", "family": "couchdb", "label": "CouchDB", "template": "cm set_config \"my_couchdb\" \"couchdb\" \"{\\\"url\\\": \\\"http://localhost:5984\\\", \\\"username\\\": \\\"admin\\\", \\\"password\\\": \\\"couchdb\\\"}\";"}, {"category": "NoSQL", "sub": "Documents", "family": "couchbase", "label": "Couchbase", "template": "cm set_config \"my_couchbase\" \"couchbase\" \"{\\\"host\\\": \\\"localhost\\\", \\\"username\\\": \\\"Administrator\\\", \\\"password\\\": \\\"couchbase\\\"}\";"}, {"category": "NoSQL", "sub": "Documents", "family": "surreal", "label": "SurrealDB", "template": "cm set_config \"my_surreal\" \"surreal\" \"{\\\"url\\\": \\\"http://localhost:8000\\\", \\\"namespace\\\": \\\"shop\\\", \\\"database\\\": \\\"crm\\\", \\\"username\\\": \\\"root\\\", \\\"password\\\": \\\"surreal\\\"}\";"}, {"category": "NoSQL", "sub": "Documents", "family": "ravendb", "label": "RavenDB", "template": "cm set_config \"my_ravendb\" \"ravendb\" \"{\\\"url\\\": \\\"http://localhost:8080\\\", \\\"database\\\": \\\"shop\\\"}\";"}, {"category": "NoSQL", "sub": "Documents", "family": "firestore", "label": "Firestore", "template": "cm set_config \"my_firestore\" \"firestore\" \"{\\\"project_id\\\": \\\"my-project\\\", \\\"credentials_file\\\": \\\"conf/firestore-sa.json\\\"}\";"}, {"category": "NoSQL", "sub": "Documents", "family": "cosmos", "label": "Cosmos DB", "template": "cm set_config \"my_cosmos\" \"cosmos\" \"{\\\"endpoint\\\": \\\"https://myaccount.documents.azure.com:443/\\\", \\\"key\\\": \\\"cosmos\\\", \\\"database\\\": \\\"shop\\\"}\";"}, {"category": "NoSQL", "sub": "Key-value and cache", "family": "redis", "label": "Redis", "template": "cm set_config \"my_redis\" \"redis\" \"{\\\"host\\\": \\\"localhost\\\", \\\"port\\\": 6379, \\\"password\\\": \\\"redis\\\"}\";"}, {"category": "NoSQL", "sub": "Key-value and cache", "family": "memcached", "label": "Memcached", "template": "cm set_config \"my_memcached\" \"memcached\" \"{\\\"host\\\": \\\"localhost\\\", \\\"port\\\": 11211}\";"}, {"category": "NoSQL", "sub": "Key-value and cache", "family": "etcd", "label": "etcd", "template": "cm set_config \"my_etcd\" \"etcd\" \"{\\\"url\\\": \\\"http://localhost:2379\\\", \\\"username\\\": \\\"root\\\", \\\"password\\\": \\\"etcd\\\"}\";"}, {"category": "NoSQL", "sub": "Key-value and cache", "family": "consul", "label": "Consul", "template": "cm set_config \"my_consul\" \"consul\" \"{\\\"url\\\": \\\"http://localhost:8500\\\", \\\"token\\\": \\\"consul\\\"}\";"}, {"category": "NoSQL", "sub": "Key-value and cache", "family": "dynamodb", "label": "DynamoDB", "template": "cm set_config \"my_dynamodb\" \"dynamodb\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"aws_key\\\", \\\"secret_key\\\": \\\"aws_secret\\\"}\";"}, {"category": "NoSQL", "sub": "Wide column and time series", "family": "cassandra", "label": "Cassandra / ScyllaDB", "template": "cm set_config \"my_cassandra\" \"cassandra\" \"{\\\"host\\\": \\\"localhost\\\", \\\"username\\\": \\\"cassandra\\\", \\\"password\\\": \\\"cassandra\\\", \\\"keyspace\\\": \\\"shop\\\"}\";"}, {"category": "NoSQL", "sub": "Wide column and time series", "family": "hbase", "label": "HBase", "template": "cm set_config \"my_hbase\" \"hbase\" \"{\\\"url\\\": \\\"http://localhost:8080\\\"}\";"}, {"category": "NoSQL", "sub": "Wide column and time series", "family": "influx", "label": "InfluxDB", "template": "cm set_config \"my_influx\" \"influx\" \"{\\\"url\\\": \\\"http://localhost:8086\\\", \\\"token\\\": \\\"influx\\\", \\\"org\\\": \\\"acme\\\", \\\"bucket\\\": \\\"metrics\\\"}\";"}, {"category": "NoSQL", "sub": "Graph", "family": "neo4j", "label": "Neo4j", "template": "cm set_config \"my_neo4j\" \"neo4j\" \"{\\\"url\\\": \\\"http://localhost:7474\\\", \\\"password\\\": \\\"neo4j\\\"}\";"}, {"category": "NoSQL", "sub": "Search", "family": "elastic", "label": "Elasticsearch / OpenSearch", "template": "cm set_config \"my_elastic\" \"elastic\" \"{\\\"url\\\": \\\"https://localhost:9200\\\", \\\"username\\\": \\\"elastic\\\", \\\"password\\\": \\\"elastic\\\"}\";"}, {"category": "NoSQL", "sub": "Search", "family": "solr", "label": "Solr", "template": "cm set_config \"my_solr\" \"solr\" \"{\\\"url\\\": \\\"http://localhost:8983/solr\\\"}\";"}, {"category": "NoSQL", "sub": "Search", "family": "meili", "label": "Meilisearch", "template": "cm set_config \"my_meili\" \"meili\" \"{\\\"url\\\": \\\"http://localhost:7700\\\", \\\"api_key\\\": \\\"meili\\\"}\";"}, {"category": "NoSQL", "sub": "Search", "family": "typesense", "label": "Typesense", "template": "cm set_config \"my_typesense\" \"typesense\" \"{\\\"url\\\": \\\"http://localhost:8108\\\", \\\"api_key\\\": \\\"typesense\\\"}\";"}, {"category": "NoSQL", "sub": "Vectors", "family": "qdrant", "label": "Qdrant", "template": "cm set_config \"my_qdrant\" \"qdrant\" \"{\\\"url\\\": \\\"http://localhost:6333\\\", \\\"api_key\\\": \\\"qdrant\\\"}\";"}, {"category": "NoSQL", "sub": "Vectors", "family": "chroma", "label": "Chroma", "template": "cm set_config \"my_chroma\" \"chroma\" \"{\\\"url\\\": \\\"http://localhost:8000\\\"}\";"}, {"category": "NoSQL", "sub": "Vectors", "family": "weaviate", "label": "Weaviate", "template": "cm set_config \"my_weaviate\" \"weaviate\" \"{\\\"url\\\": \\\"http://localhost:8080\\\"}\";"}, {"category": "Cloud storage", "sub": null, "family": "s3", "label": "S3 (AWS, MinIO, OVH...)", "template": "cm set_config \"my_s3\" \"s3\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"s3_key\\\", \\\"secret_key\\\": \\\"s3_secret\\\"}\";"}, {"category": "Cloud storage", "sub": null, "family": "azure_blob", "label": "Azure Blob", "template": "cm set_config \"my_azure_blob\" \"azure_blob\" \"{\\\"account\\\": \\\"mystorage\\\", \\\"account_key\\\": \\\"azure_key\\\"}\";"}, {"category": "Cloud storage", "sub": null, "family": "gcs", "label": "Google Cloud Storage", "template": "cm set_config \"my_gcs\" \"gcs\" \"{\\\"project_id\\\": \\\"my-project\\\", \\\"credentials_file\\\": \\\"conf/gcs-sa.json\\\"}\";"}, {"category": "Messaging", "sub": null, "family": "kafka", "label": "Kafka", "template": "cm set_config \"my_kafka\" \"kafka\" \"{\\\"bootstrap_servers\\\": \\\"localhost:9092\\\"}\";"}, {"category": "Messaging", "sub": null, "family": "amqp", "label": "AMQP (RabbitMQ...)", "template": "cm set_config \"my_amqp\" \"amqp\" \"{\\\"host\\\": \\\"localhost\\\", \\\"port\\\": 5672, \\\"username\\\": \\\"guest\\\", \\\"password\\\": \\\"amqp\\\"}\";"}, {"category": "Messaging", "sub": null, "family": "mqtt", "label": "MQTT", "template": "cm set_config \"my_mqtt\" \"mqtt\" \"{\\\"url\\\": \\\"tcp://localhost:1883\\\", \\\"username\\\": \\\"admin\\\", \\\"password\\\": \\\"mqtt\\\"}\";"}, {"category": "Messaging", "sub": null, "family": "sqs", "label": "Amazon SQS", "template": "cm set_config \"my_sqs\" \"sqs\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"aws_key\\\", \\\"secret_key\\\": \\\"aws_secret\\\"}\";"}, {"category": "Messaging", "sub": null, "family": "sns", "label": "Amazon SNS", "template": "cm set_config \"my_sns\" \"sns\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"aws_key\\\", \\\"secret_key\\\": \\\"aws_secret\\\"}\";"}, {"category": "Messaging", "sub": null, "family": "nats", "label": "NATS", "template": "cm set_config \"my_nats\" \"nats\" \"{\\\"url\\\": \\\"nats://localhost:4222\\\", \\\"username\\\": \\\"mq\\\", \\\"password\\\": \\\"nats\\\"}\";"}, {"category": "Messaging", "sub": null, "family": "pubsub", "label": "Google Pub/Sub", "template": "cm set_config \"my_pubsub\" \"pubsub\" \"{\\\"project_id\\\": \\\"my-project\\\", \\\"credentials_file\\\": \\\"conf/pubsub-sa.json\\\"}\";"}, {"category": "Secret stores", "sub": null, "family": "vault", "label": "Vault / OpenBao", "template": "cm set_config \"my_vault\" \"vault\" \"{\\\"url\\\": \\\"https://vault.example.com:8200\\\", \\\"token\\\": \\\"vault_token\\\"}\";"}, {"category": "Secret stores", "sub": null, "family": "aws_secret", "label": "AWS Secrets Manager", "template": "cm set_config \"my_aws_secret\" \"aws_secret\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"aws_key\\\", \\\"secret_key\\\": \\\"aws_secret\\\"}\";"}, {"category": "Secret stores", "sub": null, "family": "aws_param", "label": "AWS Parameter Store", "template": "cm set_config \"my_aws_param\" \"aws_param\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"aws_key\\\", \\\"secret_key\\\": \\\"aws_secret\\\"}\";"}, {"category": "Secret stores", "sub": null, "family": "azure_keyvault", "label": "Azure Key Vault", "template": "cm set_config \"my_azure_keyvault\" \"azure_keyvault\" \"{\\\"vault_url\\\": \\\"https://myvault.vault.azure.net\\\", \\\"tenant_id\\\": \\\"contoso.onmicrosoft.com\\\", \\\"client_id\\\": \\\"00000000-0000-0000-0000-000000000000\\\", \\\"client_secret\\\": \\\"azure_client\\\"}\";"}, {"category": "Monitoring", "sub": null, "family": "prometheus", "label": "Prometheus", "template": "cm set_config \"my_prometheus\" \"prometheus\" \"{\\\"url\\\": \\\"http://localhost:9090\\\"}\";"}, {"category": "Monitoring", "sub": null, "family": "alertmanager", "label": "Alertmanager", "template": "cm set_config \"my_alertmanager\" \"alertmanager\" \"{\\\"url\\\": \\\"http://localhost:9093\\\"}\";"}, {"category": "Monitoring", "sub": null, "family": "grafana", "label": "Grafana", "template": "cm set_config \"my_grafana\" \"grafana\" \"{\\\"url\\\": \\\"http://localhost:3000\\\", \\\"token\\\": \\\"grafana\\\"}\";"}, {"category": "Monitoring", "sub": null, "family": "loki", "label": "Loki", "template": "cm set_config \"my_loki\" \"loki\" \"{\\\"url\\\": \\\"http://localhost:3100\\\"}\";"}, {"category": "Applications", "sub": null, "family": "odata", "label": "OData (SAP, Dynamics, Dataverse...)", "template": "cm set_config \"my_odata\" \"odata\" \"{\\\"url\\\": \\\"https://erp.example.com/sap/opu/odata/sap/API_BUSINESS_PARTNER\\\", \\\"username\\\": \\\"app\\\", \\\"password\\\": \\\"odata\\\"}\";"}, {"category": "Applications", "sub": null, "family": "keycloak", "label": "Keycloak", "template": "cm set_config \"my_keycloak\" \"keycloak\" \"{\\\"url\\\": \\\"http://localhost:8080\\\", \\\"realm\\\": \\\"master\\\", \\\"username\\\": \\\"admin\\\", \\\"password\\\": \\\"keycloak\\\"}\";"}, {"category": "Applications", "sub": null, "family": "gitea", "label": "Gitea / Forgejo", "template": "cm set_config \"my_gitea\" \"gitea\" \"{\\\"url\\\": \\\"http://localhost:3000\\\", \\\"token\\\": \\\"gitea\\\"}\";"}, {"category": "Applications", "sub": null, "family": "ldap", "label": "LDAP / Active Directory", "template": "cm set_config \"my_ldap\" \"ldap\" \"{\\\"url\\\": \\\"ldaps://ldap.example.com\\\", \\\"base_dn\\\": \\\"dc=example,dc=com\\\", \\\"bind_dn\\\": \\\"cn=svc,dc=example,dc=com\\\", \\\"password\\\": \\\"ldap\\\"}\";"}, {"category": "Applications", "sub": null, "family": "llm", "label": "LLM (OpenAI, Anthropic, Mistral, Ollama...)", "template": "cm set_config \"my_llm\" \"llm\" \"{\\\"provider\\\": \\\"openai\\\", \\\"model\\\": \\\"gpt-4o-mini\\\", \\\"api_key\\\": \\\"openai\\\"}\";"}]
cm templates <filter>
Description
The templates of one family or one category
The templates of one family or one category
Parameters
filter: A family (redis, s3, odata...) or a category (NoSQL, Cloud storage, Messaging, Secrets, Monitoring, Applications) - String - required
filter: A family (redis, s3, odata...) or a category (NoSQL, Cloud storage, Messaging, Secrets, Monitoring, Applications) - String - required
admin
cm templates "redis"
mentdb
[{"category": "NoSQL", "sub": "Key-value and cache", "family": "redis", "label": "Redis", "template": "cm set_config \"my_redis\" \"redis\" \"{\\\"host\\\": \\\"localhost\\\", \\\"port\\\": 6379, \\\"password\\\": \\\"redis\\\"}\";"}]
one category
admin
cm templates "Secret stores"
mentdb
[{"category": "Secret stores", "sub": null, "family": "vault", "label": "Vault / OpenBao", "template": "cm set_config \"my_vault\" \"vault\" \"{\\\"url\\\": \\\"https://vault.example.com:8200\\\", \\\"token\\\": \\\"vault_token\\\"}\";"}, {"category": "Secret stores", "sub": null, "family": "aws_secret", "label": "AWS Secrets Manager", "template": "cm set_config \"my_aws_secret\" \"aws_secret\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"aws_key\\\", \\\"secret_key\\\": \\\"aws_secret\\\"}\";"}, {"category": "Secret stores", "sub": null, "family": "aws_param", "label": "AWS Parameter Store", "template": "cm set_config \"my_aws_param\" \"aws_param\" \"{\\\"region\\\": \\\"eu-west-3\\\", \\\"access_key\\\": \\\"aws_key\\\", \\\"secret_key\\\": \\\"aws_secret\\\"}\";"}, {"category": "Secret stores", "sub": null, "family": "azure_keyvault", "label": "Azure Key Vault", "template": "cm set_config \"my_azure_keyvault\" \"azure_keyvault\" \"{\\\"vault_url\\\": \\\"https://myvault.vault.azure.net\\\", \\\"tenant_id\\\": \\\"contoso.onmicrosoft.com\\\", \\\"client_id\\\": \\\"00000000-0000-0000-0000-000000000000\\\", \\\"client_secret\\\": \\\"azure_client\\\"}\";"}]
cm set_config <name> <family> <config>
Description
Keep the connection of a family with a configuration JSON (create, or replace for a user with sys). The configuration must be a JSON object; its secret fields (password, token, api_key, secret_key...) give the name of a secret that exists (secret set), never the secret itself. {cm get "name"} gives back the configuration
Keep the connection of a family with a configuration JSON (create, or replace for a user with sys). The configuration must be a JSON object; its secret fields (password, token, api_key, secret_key...) give the name of a secret that exists (secret set), never the secret itself. {cm get "name"} gives back the configuration
Parameters
name: The connection name - String - required
family: The family (cm templates) - String - required
config: The configuration JSON of the family - String - required
name: The connection name - String - required
family: The family (cm templates) - String - required
config: The configuration JSON of the family - String - required
admin
cm set_config "demo_northwind" "odata" "{\"url\": \"https://services.odata.org/V2/Northwind/Northwind.svc\"}"
mentdb
1
then use it in any function of the family (fixed result: real call on a local MentDB server)
admin
odata count {cm get "demo_northwind";} "Customers"
mentdb
91
a password typed in clear is refused, never kept (fixed result: real call on a local MentDB server)
admin
cm set_config "demo_mongo" "mongodb" "{\"host\": \"localhost\", \"password\": \"Pa55word!\"}"
mentdb
ERROR: Sorry, the field 'password' must give the name of a secret that exists (secret set, secret list): it never holds the secret itself.
with the name of a secret (secret set "mongo_shop" "...") (fixed result: real call on a local MentDB server)
admin
cm set_config "demo_mongo" "mongodb" "{\"host\": \"localhost\", \"database\": \"shop\", \"username\": \"app\", \"password\": \"mongo_shop\"}"
mentdb
1
