SET DATABASE KEY

Syntax

SET DATABASE database_name KEY keyname TO keyvalue

Privileges

PRAGMA

Description

Use 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.

Return

OK string or error value (see SCSP protocol).

Example

> SET DATABASE mediastore.sqlite KEY key1 VALUE value1
OK