ENABLE_ATTACH_WRITE
The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the ability of the ATTACH DATABASE SQL command to open a database for writing. This capability is enabled by default. Applications can disable or reenable this capability using the current DBCONFIG option. If this capability is disabled, the ATTACH command will still work, but the database will be opened read-only. If this option is disabled, then the ability to create a new database using ATTACH is also disabled, regardless of the value of the SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE option.
This option takes two arguments which are an integer and a pointer to an integer. The first argument is 1, 0, or -1 to enable, disable, or leave unchanged the ability to ATTACH another database for writing, respectively. If the second argument is not NULL, then 0 or 1 is written into the integer to which the second argument points, depending on whether the ability to ATTACH a read/write database is enabled or disabled after processing the first argument.