Skip to main content
This feature is not part of the community edition: it needs to be unlocked.
This will walk you through the basics of DirectQuery by creating an application on Snowflake. We’ll see how to:
  • Connect to an external database
  • Create a data model based on this external database
  • Use this data model in a cube

Connecting to the external database

Once we have a session, we can connect to the external database:
The choice of the type of connection is what differs between the various supported databases. For example, you can switch to atoti_directquery_clickhouse.ConnectionConfig to connect to Clickhouse instead of Snowflake.

Discovering the external tables

We can list the various tables available on the Snowflake server:

Building the data model

We can see the 2 tables of interest to us, add them to the session, and join them:
Note that at any point, you can inspect the external table definition, as well as its definition as interpreted by Atoti.

Creating the cube

The cube, its hierarchies and measures can be defined as we would do on a session with an in-memory database:

Running a query

Let’s make sure everything works, by running a query:

Refreshing the data

If the external database receives updates, some elements retrieved by DirectQuery will be out-of-date. You can manually trigger a refresh of the session to restore synchronization:

Going further

See DirectQuery for the list of supported databases.