Adds support for adding a view to a database.
Remove shared functionality between create() and update() functions.