Skip to content

Commit b127d06

Browse files
authored
docs: Semantic Layer Sync (#6665)
* docs: Semantic Layer Sync * Add Metabase workaround * Remove new env vars * Remove configuration reference * Merge pages * . * Fixes
1 parent 82651ea commit b127d06

File tree

11 files changed

+315
-44
lines changed

11 files changed

+315
-44
lines changed

docs/content/Configuration/Downstream/Metabase.mdx

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,30 @@ title: Connecting to Metabase
33
permalink: /config/downstream/metabase
44
---
55

6-
You can connect to Cube from Metabase by using the [Cube SQL API][ref-sql-api].
7-
Metabase is the easy, open-source way to help everyone in your company work with
8-
data like an analyst.
6+
[Metabase][metabase-oss] is an open-source way to help everyone in your
7+
company to ask questions and learn from data. There's also a fully-managed
8+
[cloud service][metabase] for Metabase.
99

10-
Here's a short video guide on how to connect Metabase to Cube.
10+
## Semantic Layer Sync
1111

12-
<LoomVideo url="https://www.loom.com/embed/38752bb23e5244d1a43675795c470a53" />
12+
It is recommended to use [Semantic Layer Sync][ref-sls] to connect Cube to
13+
Metabase. It automatically synchronizes the [data model][ref-data-model]
14+
between Cube and Metabase.
15+
16+
## SQL API
17+
18+
You can also use the [SQL API][ref-sql-api] to connect Cube to Metabase.
1319

14-
## Enable Cube SQL API
20+
<WarningBox>
1521

16-
<InfoBox>
22+
[Semantic Layer Sync][ref-sls] is the recommended way to connect Metabase to
23+
Cube. If you're using the SQL API, consider migrating to Semantic Layer Sync.
1724

18-
Don't have a Cube project yet? [Learn how to get started
19-
here][ref-getting-started].
25+
</WarningBox>
2026

21-
</InfoBox>
27+
Here's a short video guide:
28+
29+
<LoomVideo url="https://www.loom.com/embed/38752bb23e5244d1a43675795c470a53" />
2230

2331
### <--{"id" : "Enable Cube SQL API"}--> Cube Cloud
2432

@@ -90,3 +98,8 @@ well.
9098

9199
[ref-getting-started]: /getting-started/cloud/overview
92100
[ref-sql-api]: /backend/sql
101+
[metabase-oss]: https://github.com/metabase/metabase
102+
[metabase]: https://www.metabase.com
103+
[ref-sls]: /semantic-layer-sync
104+
[ref-sql-api]: /backend/sql
105+
[ref-data-model]: /schema/getting-started

docs/content/Configuration/Downstream/Superset.mdx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,31 @@ redirect_from:
55
- /recipes/using-apache-superset-with-cube-sql
66
---
77

8-
You can connect a Cube project to [Apache Superset][superset] using the Cube SQL
9-
API. [Apache Superset][superset] is an open-source data exploration and
10-
visualization platform, commonly used to visualize business metrics and
11-
performance.
8+
[Apache Superset][superset] is a popular open-source data exploration
9+
and visualization platform. [Preset][preset] is a fully-managed service for
10+
Superset.
1211

13-
Here's a short video guide on how to connect Apache Superset to Cube.
12+
## Semantic Layer Sync
1413

15-
<LoomVideo url="https://www.loom.com/embed/3e85b7fe3fef4c7bbb8b255ad3f2c675" />
14+
It is recommended to use [Semantic Layer Sync][ref-sls] to connect Cube to
15+
Superset or Preset. It automatically synchronizes the
16+
[data model][ref-data-model] between Cube and Superset or Preset.
17+
18+
## SQL API
19+
20+
You can also use the [SQL API][ref-sql-api] to connect Cube to Superset or Preset.
1621

17-
## Enable Cube SQL API
22+
<WarningBox>
1823

19-
<InfoBox>
24+
[Semantic Layer Sync][ref-sls] is the recommended way to connect Superset or
25+
Preset to Cube. If you're using the SQL API, consider migrating to Semantic
26+
Layer Sync.
2027

21-
Don't have a Cube project yet? [Learn how to get started
22-
here][ref-getting-started].
28+
</WarningBox>
2329

24-
</InfoBox>
30+
Here's a short video guide:
31+
32+
<LoomVideo url="https://www.loom.com/embed/3e85b7fe3fef4c7bbb8b255ad3f2c675" />
2533

2634
### <--{"id" : "Enable Cube SQL API"}--> Cube Cloud
2735

@@ -146,3 +154,7 @@ Superset uses loose date ranges when generating SQL queries.
146154
[superset]: https://superset.apache.org/
147155
[superset-docs-installation-docker]:
148156
https://superset.apache.org/docs/installation/installing-superset-using-docker-compose
157+
[preset]: https://preset.io
158+
[ref-sls]: /semantic-layer-sync
159+
[ref-sql-api]: /backend/sql
160+
[ref-data-model]: /schema/getting-started

docs/content/Reference/Configuration/Config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,4 +881,4 @@ module.exports = {
881881
[ref-exec-environment-globals]:
882882
/schema/reference/execution-environment#node-js-globals-process-env-console-log-and-others
883883
[ref-environment-variables]: /reference/environment-variables
884-
[ref-rest-scopes]: /http-api/rest#configuration-api-scopes
884+
[ref-rest-scopes]: /http-api/rest#configuration-api-scopes

docs/content/Reference/Configuration/Environment-Variables-Reference.mdx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ The maximum number of partitions each pre-aggregation in a cube can use.
688688

689689
## `CUBEJS_PG_SQL_PORT`
690690

691-
The port to listen to Postgres-compatible connections on.
691+
The port used by the [SQL API][ref-sql-api] to listen to Postgres-compatible
692+
connections on.
692693

693694
| Possible Values | Default in Development | Default in Production |
694695
| ------------------- | ---------------------- | --------------------- |
@@ -859,20 +860,27 @@ The path where Cube loads data models from.
859860

860861
## `CUBEJS_SQL_PASSWORD`
861862

862-
Required password to access SQL API.
863+
A password required to access the [SQL API][ref-sql-api].
863864

864865
| Possible Values | Default in Development | Default in Production |
865866
| --------------- | ---------------------- | --------------------- |
866867
| A valid string | N/A | N/A |
867868

868869
## `CUBEJS_SQL_PORT`
869870

870-
The port to listen to MySQL compatibility connections on.
871+
The port used by the [SQL API][ref-sql-api] to listen to MySQL-compatible
872+
connections on.
871873

872874
| Possible Values | Default in Development | Default in Production |
873875
| ------------------- | ---------------------- | --------------------- |
874876
| A valid port number | N/A | N/A |
875877

878+
<WarningBox>
879+
880+
This environment variable is deprecated. Use `CUBEJS_PG_SQL_PORT` instead.
881+
882+
</WarningBox>
883+
876884
## `CUBEJS_SQL_SUPER_USER`
877885

878886
A name of specific user who will be allowed to change security context.
@@ -883,7 +891,7 @@ A name of specific user who will be allowed to change security context.
883891

884892
## `CUBEJS_SQL_USER`
885893

886-
Required username to access SQL API.
894+
A username required to access the [SQL API][ref-sql-api].
887895

888896
| Possible Values | Default in Development | Default in Production |
889897
| --------------- | ---------------------- | --------------------- |
@@ -1295,3 +1303,4 @@ The port for a Cube deployment to listen to API connections on.
12951303
[snowflake-docs-warehouse]:
12961304
https://docs.snowflake.com/en/user-guide/warehouses.html
12971305
[wiki-tz-database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
1306+
[ref-sql-api]: /backend/sql

docs/content/SQL-API/Overview.mdx

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Often, the SQL API is used to enable internal or self-serve
2323

2424
### <--{"id" : "SQL API"}--> Supported Tools
2525

26-
Cube SQL API has been tested with
26+
Cube SQL API has been tested with the following tools:
2727

2828
- psql CLI
2929
- Apache Superset
@@ -42,11 +42,33 @@ Cube SQL API has been tested with
4242

4343
<InfoBox>
4444

45-
Please see [this GitHub issue](https://github.com/cube-js/cube/issues/3906) for
46-
the tools roadmap and to suggest and vote for tools of your interest.
45+
Please use [this GitHub issue](https://github.com/cube-js/cube/issues/3906)
46+
to suggest tools of your interest and vote for already proposed ones.
4747

4848
</InfoBox>
4949

50+
## Configuration
51+
52+
### <--{"id" : "Configuration"}--> Cube Core
53+
54+
SQL API is configured via [environment variables][ref-config-env].
55+
56+
To enable the SQL API, set `CUBEJS_PG_SQL_PORT` to a port number you'd like
57+
to connect to with a Postgres-compatible tool.
58+
59+
Use `CUBEJS_SQL_USER` and `CUBEJS_SQL_PASSWORD` to configure credentials
60+
required to connect to the SQL API. You can also use
61+
[`checkSqlAuth`][ref-config-checksqlauth], [`canSwitchSqlUser`][ref-config-canswitchsqluser],
62+
and `CUBEJS_SQL_SUPER_USER` to configure [custom authentication][ref-sql-api-auth].
63+
64+
### <--{"id" : "Configuration"}--> Cube Cloud
65+
66+
To enable the SQL API in Cube Cloud, click&nbsp;<Btn>Deploy SQL API</Btn> on
67+
the&nbsp;<Btn>Overview</Btn> page, then click&nbsp;<Btn>How to connect your BI
68+
tool</Btn>. You should then see the following screen:
69+
70+
![SQL API details modal|690x428](https://ucarecdn.com/67508334-1641-43ec-9d50-a8f64629992b/)
71+
5072
## Querying Fundamentals
5173

5274
Under the hood, SQL API uses
@@ -240,14 +262,6 @@ Limit push down is supported by Cube however, a limit over 50,000 can't be
240262
overridden. In future versions, paging and streaming would be used to avoid this
241263
limitation.
242264

243-
## Enabling SQL API in Cube Cloud
244-
245-
To enable the SQL API in Cube Cloud, click&nbsp;<Btn>Deploy SQL API</Btn> from
246-
the&nbsp;<Btn>Overview</Btn> page, then click <Btn>How to connect your BI
247-
tool</Btn>. You should then see the following screen:
248-
249-
![SQL API details modal|690x428](https://ucarecdn.com/67508334-1641-43ec-9d50-a8f64629992b/)
250-
251265
## Examples
252266

253267
Consider the following data model:
@@ -519,6 +533,10 @@ WHERE is_completed = true
519533

520534
[ref-config-js]: /config
521535
[ref-dynamic-schemas]: /schema/dynamic-schema-creation
536+
[ref-config-env]: /reference/environment-variables
537+
[ref-sql-api-auth]: /backend/sql/security
538+
[ref-config-checksqlauth]: /config#options-reference-check-sql-auth
539+
[ref-config-canswitchsqluser]: /config#options-reference-can-switch-sql-user
522540
[ref-bi]: /config/downstream#bi-data-exploration-tools
523541
[ref-superset]: /config/downstream/superset
524542
[ref-tableau]: /config/downstream/tableau
@@ -528,4 +546,4 @@ WHERE is_completed = true
528546
[ref-low-code]: /config/downstream#low-code-tools-internal-tool-builders
529547
[ref-retool]: /config/downstream/retool
530548
[postgres-protocol]: https://www.postgresql.org/docs/current/protocol.html
531-
[cube-issbi]: https://cube.dev/use-cases/semantic-layer
549+
[cube-issbi]: https://cube.dev/use-cases/semantic-layer

docs/content/Workspace/Cube-IDE.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Cube IDE
2+
title: Data Model
33
permalink: /cloud/workspace/cube-ide
44
category: Workspace
55
menuOrder: 3

docs/content/Workspace/Development-API.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Development mode
33
permalink: /cloud/workspace/development-api
44
category: Workspace
5-
menuOrder: 8
5+
menuOrder: 11
66
---
77

88
Development mode allows to test and debug the data model in an isolated

docs/content/Workspace/Inspecting-Pre-aggregations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Pre-aggregation inspection
2+
title: Pre-Aggregations
33
permalink: /cloud/inspecting-pre-aggregations
44
category: Workspace
5-
menuOrder: 7
5+
menuOrder: 8
66
---
77

88
The Pre-Aggregations page in Cube Cloud allows you to inspect all

docs/content/Workspace/Inspecting-Queries.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Query History
33
permalink: /cloud/inspecting-queries
44
category: Workspace
5-
menuOrder: 6
5+
menuOrder: 7
66
---
77

88
The Query History screen in Cube Cloud is a one-stop shop for all performance

docs/content/Workspace/SQL-Runner.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: SQL Runner
33
permalink: /cloud/sql-runner
44
category: Workspace
5-
menuOrder: 4
5+
menuOrder: 5
66
---
77

88
The SQL Runner is a tool that allows you to execute SQL queries from Cube Cloud

0 commit comments

Comments
 (0)