Skip to main content
Data Preview

Preview data for tables and views from the diagram

S
Written by Serge Gershkovich
Updated over a week ago
  • Plan: Small and Standard Enterprise

  • Databases:

    • Snowflake

    • more CDPs coming soon...

  • Access: by request

Data Preview provides a brief sample of records sourced directly from the database, offering valuable context about the entities you are dealing with.

Due to additional security considerations of data access, this feature must be enabled by request. If you wish to enable Data Preview, please contact your account manager or send an email to cs@sqldbm.com.

Prerequisites and FAQs

To use the Data Preview feature, ensure that the following prerequisites are met.

  • Check your company policy to ensure it permits SqlDBM to access data.

  • Contact your account manager or send an email to cs@sqldbm.com letting them know you have reviewed your company policy regarding 3rd party data access and would like this feature enabled.

  • You have a database user and role that has the requisite minimum permissions required to read data.

    • This requires the SELECT privilege on the objects you'll be previewing data from.

  • You create a User Connection that uses the above-mentioned user and role (see related article on instructions on how to configure User Connections).

Common questions about Data Preview:

  • Where will the data preview results be stored?

    • SqlDBM will not store the query results anywhere on our site or infrastructure. The data will only be displayed in the active browser session and browser cache on your machine.

  • Will using Data Preview incur compute costs?

    • Yes, Data Preview selects 100 rows of data from an object using the one of the commands below (based on user selection) and therefore incurs compute cost.

      • SELECT * FROM object LIMIT 100

      • SELECT * FROM object SAMPLE (100 ROWS)

  • Does using Data Preview require a WAREHOUSE?

    • Yes, because Data Preview queries data, it requires a WAREHOUSE to be specified (or set by default) in the User Connection

  • Can data be changed or deleted through Data Preview?

    • No, data can not be manipulated or changed from SqlDBM using Data Preview or any other feature. As a security best practice, please ensure the user and role used for Data Preview do not have any DML permissions granted. See the related article below for a list of minimum privileges that SqlDBM requires.

Using Data Preview

Please ensure that the prerequisites mentioned above are met before using Data Preview.

Data Preview can be performed from the diagram for any table or view.

If the connection defaults (database and schema) are not specified, Data Preview uses them to form the fully qualified name of the object. These defaults can also be overridden using the data preview settings (see below).

Previewing data

Right-click on the desired object and select "Data preview."

Data Preview results are displayed in the bottom part of the screen.

Once results are returned, they will be saved in the browser cache for the duration of the session.

The following menu items are available for the results tab:

  • Refresh - run the Data Preview again with selected settings

  • Copy results (to clipboard)

  • Settings - choose between LIMIT and SAMPLE

  • Pin results - prevent the result tab from closing when clicking on the diagram canvas

  • Expand results (full screen)

  • Close results - can also be achieved by clicking on the diagram

Data Preview settings

Data preview settings allow switching between LIMIT and SAMPLE preview modes as well as overriding the location (database and schema) for the objects being previewed.

Data Preview settings can be accessed using the settings icon on the Data Preview tab (see screenshot above.) These settings apply to all objects for which data is being previewed (they are not set per object.)

The following settings are available:

  • Preview mode

    • Limit - returns the first 100 rows

    • Sample - returns a random 100 rows

  • Location override

    • Allows users to determine or override the fully qualified name of the object for which data is previewed. More on this in the next section.

Overriding the location of Data Preview objects

Even though the same objects exist across multiple database environments (e.g., dev, test, prod), a project will often contain just a single version. To enable users to Preview Data across environments, SqlDBM uses a location object—a named mapping of database and schema—to allow users to override the project settings or connection defaults.

Adding locations

Locations are named mappings of a database and schemas that allow users to override the project settings or connection defaults.

The default location used for data preview is the database and schema named in the User Connection default.

To create more connections access "Storage locations" from the "Settings and conventions" project menu.

Or click on "+ Add new" from the Location override dropdown in the "Data preview settings".

From this menu, create named locations that will appear in the "Location override" dropdown.

Connection default vs location override

The database and schema named in the connection defaults supplement (not replace) the database and schema set on the project object. A location override will replace them during Data Preview.

Example:

Connection default: db1.s1

Location someLoc: db2.s2

Object: s3.customer

Data Preview on object s3.customer using the connection default would run:

SELECT * FROM db1.s3.customer LIMIT 100;

Data Preview on object s3.customer using the someLoc override would run:

SELECT * FROM db2.s2.customer LIMIT 100;

Previewing data when objects have changes

Often, the structure of the object in the project may not match that of the database. This is especially true when previewing data across environments using location overrides.

Because SqlDBM queries the data using SELECT * and does not reference specific columns, data preview will always work regardless of structure as long as the object exists. However, if the structure of the Data Preview results does not match that of the project object, a warning is displayed for informational purposes.


See also:

Did this answer your question?