dm_db_set_query_only Function

public function dm_db_set_query_only(db, enabled) result(rc)

Sets query-only pragma.

The SQLite query_only pragma prevents data changes on database files when enabled. When this pragma is enabled, any attempt to CREATE, DELETE, DROP, INSERT, or UPDATE will result in an E_READ_ONLY error.

However, the database is not truly read-only. You can still run a checkpoint or a COMMIT and the return value of the sqlite3_db_readonly() routine is not affected.

The function returns the following error codes:

  • E_DB_PREPARE if statement preparation failed.
  • E_DB_STEP if step execution failed or no write permission.

Arguments

Type IntentOptional Attributes Name
type(db_type), intent(inout) :: db

Database type.

logical, intent(in) :: enabled

Enable query-only mode.

Return Value integer


Calls

proc~~dm_db_set_query_only~~CallsGraph proc~dm_db_set_query_only dm_db_set_query_only sqlite3_finalize sqlite3_finalize proc~dm_db_set_query_only->sqlite3_finalize sqlite3_prepare_v2 sqlite3_prepare_v2 proc~dm_db_set_query_only->sqlite3_prepare_v2 sqlite3_step sqlite3_step proc~dm_db_set_query_only->sqlite3_step