| title | Settings Commands |
|---|---|
| description | Settings commands are used to manage settings in SQLite Cloud. |
| category | reference |
| status | publish |
| slug | settings-commands |
The GET CLIENT KEY command retrieves a single specific information about a keyname.
GET CLIENT KEY keyname
NONE
A single value (usually a String) that depends on the input keyname.
> GET CLIENT KEY IP
127.0.0.1
> GET CLIENT KEY COMPRESSION
1Use this command to retrieve a single value associated with database_name and keyname.
GET DATABASE database_name KEY keyname
PRAGMA
A String with the requested value.
> GET DATABASE mediastore.sqlite KEY key1
value1The GET KEY command retrieves a single specific setting about a keyname.
GET KEY keyname
SETTINGS
A single value (usually a String) that depends on the input keyname.
> GET KEY max_chunk_size
307200
> GET KEY non_existing_key
NULLThe LIST CLIENT KEYS command retrieves information and settings specific to the current connection. Use the GET CLIENT KEY key command to retrieve specific information.
LIST CLIENT KEYS
NONE
A Rowset with the following columns:
- key: client key
- value: client value
> LIST CLIENT KEYS
-----------------|--------------------------------------|
key | value |
-----------------|--------------------------------------|
COMPRESSION | 1 |
ID | 1 |
IP | 127.0.0.1 |
MAXDATA | 0 |
MAXROWS | 0 |
MAXROWSET | 0 |
NOBLOB | 0 |
NONLINEARIZABLE | 0 |
SQLITE | 0 |
UUID | 374c7c93-c8bb-4ba8-ac19-26edb78fc1cc |
ZEROTEXT | 0 |
-----------------|--------------------------------------|The LIST KEYS command retrieves the server settings. Some of the returned settings are read-only and cannot be set. To retrieve more information about the settings, use the DETAILED flag. All the KEYS in the settings database are automatically distributed all over the cluster. To retrieve a single specific information, use the GET KEY key command.
LIST KEYS [DETAILED] [NOREADONLY]
SETTINGS
A Rowset with the following columns:
- key: settings key
- value: settings value
- default_value: default value
- readonly: 1 if key is read-only
- description: key description
The additional default_value, readonly and description columns are returned only if the DETAILED flag is used.
> LIST KEYS
---------------------------------|-------------------------------|
key | value |
---------------------------------|-------------------------------|
autocheckpoint | 1000 |
autocheckpoint_full | 0 |
backlog | 512 |
backup_node_id | 0 |
base_path | /Users/marco/SQLiteCloud/data |
client_compression | 1 |
client_timeout | 0 |
cluster_address | NULL |
---------------------------------|-------------------------------|
> LIST KEYS DETAILED
---------------------------------|-------------------------------|---------------|----------|--------------------------------------------------------------------------|
key | value | default_value | readonly | description |
---------------------------------|-------------------------------|---------------|----------|--------------------------------------------------------------------------|
autocheckpoint | 1000 | 1000 | 0 | Number of frames in the WAL file above which a checkpoint is run. |
autocheckpoint_full | 0 | 0 | 0 | Number of frames in the WAL file above which a full checkpoint is run. |
backlog | 512 | 512 | 0 | Size of the backlog queue for the socket listening function. |
base_path | /Users/marco/SQLiteCloud/data | NULL | 1 | Full path to the main data directory. |
client_compression | 1 | 0 | 0 | Custom key set by the user. |
client_timeout | 0 | 0 | 0 | Maximum time (in seconds) to allow a connected client to stay connected. |
--------------------------------|-------------------------------|---------------|----------|--------------------------------------------------------------------------|
The REMOVE CLIENT KEY command is used to reset to a default value a keyname
REMOVE CLIENT KEY keyname
NONE
OK string or error value (see SCSP protocol).
> REMOVE CLIENT KEY COMPRESSION
OKUse this command to permanently remove keyname from the list of settings for the database database_name.
REMOVE DATABASE database_name KEY keyname
PRAGMA
OK string or error value (see SCSP protocol).
> REMOVE DATABASE mediastore.sqlite KEY key1
OKThe REMOVE KEY command permanently deletes a keyname from the settings database file (the change is automatically distributed on the cluster). Removing a previously set keyname value usually means restoring its default value.
REMOVE KEY keyname
SETTINGS
OK string or error value (see SCSP protocol).
> REMOVE KEY max_chunk_size
OKThe SET CLIENT KEY command sets a keyname to a specific keyvalue.
SET CLIENT KEY keyname TO keyvalue
NONE
OK string or error value (see SCSP protocol).
> SET CLIENT KEY COMPRESSION TO 0
OKUse this command to set a specific key/value setting to database_name.
You can use any key/value, but some keys are reserved for a special purpose:
- use_concurrent_transactions: set to 1 or 0 to enable/disable CONCURRENT transaction for the database
- DATABASE_KEY: set to the encryption key used to decrypt the database file. Note that this is not equivalent to encrypting a database. This value must be used to set an encryption key for an already encrypted database.
SET DATABASE database_name KEY keyname TO keyvalue
PRAGMA
OK string or error value (see SCSP protocol).
> SET DATABASE mediastore.sqlite KEY key1 VALUE value1
OKThe SET KEY command sets or updates a keyname to a specific keyvalue. Once set, the server immediately uses the updated value (and automatically distributes it on the cluster).
SET KEY keyname TO keyvalue
SETTINGS
OK string or error value (see SCSP protocol).
> SET KEY max_chunk_size TO 524288
OKThe LIST ENV command lists all the environment variables for the project.
LIST ENV
The GET ENV command retrieves the value of a specific environment variable.
GET ENV key
The SET ENV command sets the value of an environment variable.
SET ENV key VALUE value
The REMOVE ENV command removes the given environment variable.
REMOVE ENV key