ALTER SYSTEM is available in SDK v5+.ALTER SYSTEM statement provides runtime configuration management, allowing you to change system parameters dynamically.
Syntax
DQL
SET Parameter
Change a configuration parameter to a specific value:DQL
Set to DEFAULT
Reset a parameter to its default value using theDEFAULT keyword:
DQL
RESET Parameter
Reset a configuration parameter to its default value:DQL
Parameter Values
Parameter values can be:- Literals: Numbers, strings, booleans
- Boolean:
true,false - Integer:
100,5000 - String:
'value'or"value"
- Boolean:
- DEFAULT keyword: Resets to the default value
Available DQL Configuration Parameters
DQL_STRICT_MODE
Type: Boolean Default:true
Controls whether strict mode is enabled for collection type definitions.
DQL
DQL_DEFAULT_DIRECTIVES
Type: Object (JSON) Default:{}
Sets default query directives that apply to all queries. Individual query directives can override these defaults.
DQL
DQL_CONCURRENT_REQUEST_LIMIT
Type: Integer Default: System-dependent Limits the number of concurrent DQL requests that can execute simultaneously. When the limit is reached, additional requests are queued until capacity becomes available.DQL
This parameter helps prevent resource exhaustion under heavy query load by controlling the maximum number of queries running at once.
DQL_SLOW_REQUEST_WARN_SECONDS
Type: Integer (seconds) Default:60
Sets the threshold, in seconds, after which a still-running DQL request is considered slow. Once a request has been executing for this long, Ditto writes a warning log entry containing the request’s details — the same information reported by system:active_requests — and repeats the warning every DQL_SLOW_REQUEST_WARN_SECONDS seconds for as long as the request keeps running.
DQL
Set to
0 to disable slow-request warnings entirely.DQL_REQUEST_TIMEOUT_SECONDS
Type: Integer (seconds) Default:0 (disabled)
Limits how long, in seconds, a DQL request is permitted to run before it is cancelled. When a request exceeds this limit, its execution pipeline is signalled to stop and the request fails with a timeout error; a warning log entry containing the request’s details is also written.
DQL
Set to
0 (the default) to disable the timeout, allowing requests to run for as long as they need.Available Transport Configuration Parameters
tcp_server_bind_mdns_server_port
Type: Integer Default: Random port Specifies the port that a Small Peer SDK instance uses for mDNS announcements and incoming LAN (TCP) connections on the local device. Setting an explicit port is useful when you need to traverse a VLAN or firewall by scanning for open ports, or when you need a deterministic port for network policy. Leaving the parameter unset preserves the default behavior of binding to a random port.DQL
Common Use Cases
Enable/Disable Strict Mode
DQL
Configure Default Query Directives
DQL
Control Concurrent Query Execution
DQL
Reset All Configuration
DQL
Examples
Checking Current Values
To verify the current value of a parameter after changing it, use the SHOW statement:DQL
Configuration changes made with
ALTER SYSTEM are runtime only and do not persist across restarts. To apply settings on every startup, set the parameters in your Ditto instance configuration before starting.See Also
- SHOW - Display configuration parameter values
- Strict Mode - Understanding DQL_STRICT_MODE parameter
- Virtual Collections - Inspect currently executing and completed requests