# xSQL Configuration File Parameters

> As described in xSQL Startup Options, a variety of configuration parameters control the behavior of xSQL. These parameters are specified in a configuration file that uses a JSON-like syntax with the following extensions:

> > 1. Numeric literals may be hexadecimal (`0x[0-9A-F]`), octal (`0[0-7]`), or decimal.

> > 2. Suffixes `k`/`K` (kilo), `m`/`M` (mega), and `g`/`G` (giga) are supported. or example, `100m` means `100 x 1024 x 1024`.

> > 3. String values without whitespace or special characters do not require quotes.

> > 4. Anything after a hash symbol (`#`) is treated as a comment (until the end of the line).

> By default, xSQL looks for a file named `xsql.cfg` in the current working directory. This can be overridden using the `-c` command-line option.

> If a parameter represents a bitwise combination of flags, it can be specified either as a single value or as an array:

> > a) `"flags : value1"` → `flags = value1`

> > b) `"flags : [value1, value2, value3]"` → `flags = value1 | value2 | value3`

> > c) `"flags : []"` → `flags = 0`

> The following table lists the top-level sections of the configuration file and their corresponding C API structures. Click the links for detailed descriptions:

> `runtime_configuration : {...}`
> Runtime configuration — specifies which libraries are loaded at startup.
> `runtime_options : {...}`
> Global eXtremeDB runtime options (mapped to `mco_runtime_setoption()`).
> `devices : [ {...} ]`
> Array of device descriptors (`mco_device_t`) and shortcut parameters.
> `schema`
> Database schema definition (inline DDL).
> `db_params : {...}`
> Database parameters (`mco_db_params_t`).
> SQL parameters
> Settings that affect SQL engine behavior (e.g., port, trace, statement execution).
> `tl_params : {...}`
> Transaction Logging parameters (`mco_TL_start_data_t`).
> `ha_params : {...}`
> High Availability parameters (`mco_HA_master_params_t` and `mco_HA_replica_params_t`).
> `cluster_params : {...}`
> Cluster configuration (`mco_cluster_params_t`).
> iot_params : {...}
> Active replication parameters.
> `ssl_params : {...}`
> OpenSSL configuration (`mco_ssl_params_t`).
> `perfmon : {...}`
> Performance Monitor settings (enables runtime metric collection in xSQL).
> `rest : {...}`
> Embedded REST server configuration — exposes the Web Services REST API.
> `xlog_params : {...}`
> Statistics logging parameters.
> `trace_params : {...}`
> Tracing Framework settings.
> Miscellaneous parameters
> Additional settings affecting eXtremeDB runtime behavior.
> Persistent Media I/O
> Asynchronous I/O and multi-file storage format options.

In general, configuration file sections map directly to C API structures used by functions such as: `mco_db_open_dev()`, `mco_cluster_db_open()`, `mco_HA_attach_master()`, and `mco_HA_attach_replica()`. For example:

- The `devices` section corresponds to the `mco_device_t` array passed to `mco_db_open_dev()`.
- The `db_params` section maps to the `mco_db_params_t` structure.
- The `cluster_params` section reflects `mco_cluster_params_t`.

Command-line options take precedence over configuration file settings. If a parameter is specified both in the file and on the command line, the command-line value will be used.