Skip to main content
All CollectionsDatabase Objects
Database Views in SqlDBM
Database Views in SqlDBM

Working with views in SqlDBM

SqlDBM Support avatar
Written by SqlDBM Support
Updated over a year ago

Views are available for all license types but have additional visualization options with Small and Standard Enterpise subscriptions.

Views

A database view is defined as a logical object that enables the result of a query to be accessed dynamically as if it were a table. The query is specified in the CREATE VIEW statement.

Views can provide the following benefits over tables:

  • Views can join and simplify multiple tables into a single virtual table.

  • Views can be used as aggregated tables, where the columns can provide calculated results such as (sum, average, etc.)

  • Views can improve performance

  • Views do not use too much memory; the database stores only the view definitions, not the data.

  • Views can provide extra security.

  • Views can be used for security purposes in order to give the user access to only a particular subset of data, while denied access to the rest of the base table(s)

Support for views in SqlDBM

SqlDBM enables users to create, export, and import views. You can also use Compare Revisions feature to identify differences between your views along with the Alter Script feature to incorporate changes.

Views support in SqlDBM:

  • Create views objects for your data model

  • Import views through reverse engineering

  • Compare revisions and generate alter script including views

  • Display views on a diagram (Enterprise)

  • Connect views to objects via virtual relationships (Enterprise)

Views are available for the following SqlDBM project types:

  • Snowflake

  • Databricks

  • Google BigQuery

  • Azure Synapse

  • SQL Server

Creating a view

SqlDBM provides customers with a SQL editor that allows them to create and modify views. In order to access the editor please follow the following steps in SqlDBM:

(1) Click on the “Database Explorer” menu icon in the left menu bar

(2) Select “Views” in the list of objects

(3) Click “+ Create new” or select one of the existing views in the list.

Importing views through Reverse Engineering

You can also bring your existing views from the database to SqlDBM. SqlDBM Reverse Engineering feature allows to bring views with two different ways:

(1) Directly connect to a database environment in order to bring the objects

(2) Copy and paste the view definitions from your database to SqlDBM

Compare revisions and Alter Script

You can identify differences between your views in SqlDBM revisions and use the Alter script to incorporate the changes. Follow the steps below to access these features:

To Compare:

(1) Click on the “Compare revisions” menu icon in the left menu bar

(2) Select two revisions between which you want to identify the changes in your view definition

To Alter:

(1) Click on the “Reverse Engineer — Generate SQL” menu icon in the left menu bar

(2) Click “Generate Alter SQL”

Creating Relationships (Enterpise)

Views can be connected/related to other objects on a diagram using virtual relationships. These can be detected automatically through the "Analyze all views" action, or manually, through virtual relationship creation. Available in all Enterprise plans.

Create a virtual relationship automatically through the "Analyze all views" action:

To create a manual virtual relationship, select a virtual relationship type from the top menu of the diagram, then click and drag from the view to the target object.

Virtual connections can be made between any objects on the diagram (views, tables, functions, or procedures).

View Properties

View properties can be maintained in the right-hand properties panel when a view is selected on the diagram or Diagram/Database Explorer list.

The following properties are available:

  • Schema - derived from view DDL/definition. Obtained by clicking "Analyze all views"

  • Name - derived from view DDL/definition. Obtained by clicking "Analyze all views"

  • Columns - column list derived from view DDL/definition. Obtained by clicking "Analyze all views"

  • Tags - supported as informational/read-only for Snowflake projects as of present moment

  • Format - color formatting for object on the diagram

  • Related objects - list of database objects that are referenced in the view definition (SELECT FROM) or connected by virtual relationships ("user references")

  • Flags - SqlDBM flags that have been applied to this view (Standard Enterprise)

See also:

Did this answer your question?