SQLite Forum

DROP VIEW IF EXISTS failure
Login
The full line in the `DROP VIEW` documentation says:

~~~~~
If the specified view cannot be found and the IF EXISTS clause is not present, it is an error. If the specified view cannot be found and an IF EXISTS clause is present in the DROP VIEW statement, then the statement is a no-op. 
~~~~~
which _implies_ (no guarantee) it doesn't return an error.

On the other side, the `DROP TABLE` docs say:

~~~~~
The optional IF EXISTS clause suppresses the error that would normally result if the table does not exist.
~~~~~

It says nothing about views, so there may be an issue (documentation or otherwise) if we try with drop table:

~~~~~
% ./sqlite3
SQLite version 3.33.0 2020-06-11 16:04:10
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE t1(x);
sqlite> CREATE VIEW v1 AS SELECT * FROM t1;
sqlite> DROP TABLE IF EXISTS v1;
Error: use DROP VIEW to delete view v1
sqlite>
~~~~~

Perhaps a note in the documentation wouldn't hurt to clarify this edge case?