SQLite Forum

DROP VIEW IF EXISTS failure
Login
Well, if you need to know whether "metadata" is a table or a view, your upgrade application should be using a query like:

```
select type from sqlite_master where name == 'metadata';
```

and your application will then be told whether it is a table or a view, and can do the proper thing, or have a controlled explosion if the type returned is something other than what you are prepared to cope with.

Or are you just using "hope and pray" scripting?