Configuration

Configuration settings can be passed to the program with the following precedence:

  1. Flags passed to the program
  2. Environment settings
  3. .octo.conf
  4. ~/.octo.conf
  5. /etc/octo.conf

Config files

A config file contains settings related to YottaDB and the rocto process, and can also specify the level of verbosity for logging.

Sample config file:

//////////////////////////////////////////////////////////////////
//								//
// Copyright (c) 2019 YottaDB LLC and/or its subsidiaries.	//
// All rights reserved.						//
//								//
//	This source code contains the intellectual property	//
//	of its copyright holder(s), and is made available	//
//	under a license.  If you do not know the terms of	//
//	the license, please stop and do not read further.	//
//								//
//////////////////////////////////////////////////////////////////

// Specifies the verbosity for logging; options are TRACE, INFO, DEBUG, WARNING, ERROR, and FATAL
verbosity = "WARNING"
// Location to cache generated M routines which represent queries
routine_cache = "./"
// Global directory to use for Octo globals; if not present, we use the ydb_gbldir
//octo_global_directory = "mumps.gld"
// Prefixed to all Octo globals
octo_global_prefix = "%ydbocto"

// If true, automatically delete temporary tables after data is sent to the client
auto_clean_tables = true

// Settings related to the octod process
rocto = {
  // Address and port to listen on for connections
  address = "127.0.0.1"
  port = 1337
  // Set to use DNS to resolve numeric IP addresses
  use_dns = false
  // Authentication methods; supported options are "md5"
  authentication_method = "md5"
}

// Settings controlling YottaDB; these get set as environment variables during startup
// Defined environment variables will take precedence
/*yottadb = {
  ydb_gbldir = "mumps.gld"
  ydb_ci = "calltab.ci"
  ydb_routines = "."
}*/

Logging

A config file can include instructions specifying verbosity for logging:

  • TRACE: A TRACE message is useful to help identify issues in the code
  • INFO: An INFO message is used to relay information to the user
  • DEBUG: A DEBUG message helps users debug configuration issues
  • WARNING: A WARNING message warns the user about potential problems in the code
  • ERROR : An ERROR message informs the user that an error has occurred
  • FATAL: A FATAL message terminates the program

Locations and Global Variables

The config file includes the location of cache-generated M routines that represent queries, and the global directory to be used to source global variables for Octo.

The octo_global_prefix can be set to a value that will then be prefixed to the M global variables used in Octo.

Example:

octo_global_prefix = "%ydbocto"

The global variable ^schema will be ^%ydboctoschema as a global variable in Octo.

The global directory to be used for Octo can also be defined in the config file.

For example:

octo_global_directory = "mumps.gld"

All globals should be preceded by ^|<octo_global_directory>|<octo_global_prefix>

Example:

^|mumps.gld|%ydboctoocto

Some of the globals used in Octo are:

  • octo: This global can refer to various functions, variables, octo “read only” table values (postgres mappings, oneRowTable, etc.), and some counts. It needs to be journaled and persist between sessions.
  • session: This global can contain session variables, portals and prepared queries. It need not be journaled/ persist between sessions since it only contains data related to the current session.
  • cursor: This global contains output data and temporary tables. It need not be journaled/ persist between sessions since it only contains temporary data.
  • xref: This global contains cross-references, row counts and other statistical information. It needs to be journaled and persist between sessions.
  • schema: This global contains information about the tables loaded into the database. It needs to be journaled and persist between sessions.

Environment Variables

The config file allows setting environment variables to be used at Octo startup.

Authentication

Octo supports the MD5 password authentication method documented by PostgreSQL.