queryOnly

Queries or sets the query_only flag.

When enabled (true), this pragma prevents any statements that would write to the database file. This effectively makes the database connection read-only. Any attempt to INSERT, UPDATE, DELETE, or perform other data-modifying operations will result in an SQLITE_READONLY error.

When disabled (false, the default), both read and write operations are allowed.

This is useful for enforcing a read-only access policy on a specific database connection, for example, in components that should only be allowed to query data, not modify it.

Author

MOHAMMAD AZIM ANSARI

See also