Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ numeric measure:
```yaml
cubes:
- name: cube_with_big_numbers
sql: >
sql: |
SELECT 123::BIGINT AS number UNION ALL
SELECT 9007199254740991::BIGINT AS number UNION ALL
SELECT 9999999999999999::BIGINT AS number
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/product/apis-integrations/recipes/sorting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Consider the following data model:
```yaml
cubes:
- name: sort_nulls
sql: >
sql: |
SELECT 1234 AS value UNION ALL
SELECT 5678 AS value UNION ALL
SELECT NULL AS value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Let's use an example of a cube with a nested SQL query:
```yaml
cubes:
- name: users_with_organizations
sql: >
sql: |
WITH users AS (
SELECT
md5(company) AS organization_id,
Expand Down Expand Up @@ -168,7 +168,7 @@ properties][ref-schema-ref-preagg-buildrange]:
```yaml
cubes:
- name: users_with_organizations
sql: >
sql: |
WITH users AS (
SELECT
md5(company) AS organization_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cubes:
granularity: day
partition_granularity: month # this is where we specify the partition
refreshKey:
sql: >
sql: |
SELECT max(updated_at) FROM public.orders WHERE
{FILTER_PARAMS.orders.created_at.filter('created_at')}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ This is the `products` cube for the `avocado` tenant:
```yaml
cubes:
- name: products
sql: >
sql: |
SELECT * FROM public.Products WHERE MOD (id, 2) = 1
```

Expand All @@ -417,7 +417,7 @@ This is the `products` cube for the `mango` tenant:
```yaml
cubes:
- name: products
sql: >
sql: |
SELECT * FROM public.Products WHERE MOD (id, 2) = 0
```

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/product/configuration/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ You can use the custom value from extend context in your data model like this:

cubes:
- name: users
sql: >
sql: |
SELECT *
FROM users
WHERE organization_id={{ securityContext['active_organization'] }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,16 @@ See [this issue](https://github.com/cube-js/cube/issues/9285) for details.

</ReferenceBox>

## `CUBEJS_YAML_FOLDED_STRINGS_AS_LITERAL`

If `true`, enables interpreting [folded strings][ref-yaml-folded-and-literal] in
YAML-based data model files as literal strings. This affects how line breaks and spaces
are handled in multi-line strings.

| Possible Values | Default in Development | Default in Production |
| --------------- | ---------------------- | --------------------- |
| `true`, `false` | `true` | `true` |

## `CUBEJS_WEB_SOCKETS`

If `true`, then use WebSocket for data fetching.
Expand Down Expand Up @@ -1799,4 +1809,5 @@ The port for a Cube deployment to listen to API connections on.
[ref-multi-stage-calculations]: /product/data-modeling/concepts/multi-stage-calculations
[ref-folders]: /product/data-modeling/reference/view#folders
[ref-dataviz-tools]: /product/configuration/visualization-tools
[ref-context-to-app-id]: /product/configuration/reference/config#context_to_app_id
[ref-context-to-app-id]: /product/configuration/reference/config#context_to_app_id
[ref-yaml-folded-and-literal]: /product/data-modeling/dynamic/jinja#folded-and-literal-strings
4 changes: 2 additions & 2 deletions docs/pages/product/data-modeling/concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ cube(`orders`, {
```yaml
cubes:
- name: orders
sql: >
sql: |
SELECT *
FROM orders, line_items
WHERE orders.id = line_items.order_id
Expand Down Expand Up @@ -564,7 +564,7 @@ Consider the following cube:
```yaml
cubes:
- name: employees
sql: >
sql: |
SELECT 1 AS id, 'Ali' AS first_name, 20 AS age, 'Los Gatos' AS city UNION ALL
SELECT 2 AS id, 'Bob' AS first_name, 30 AS age, 'San Diego' AS city UNION ALL
SELECT 3 AS id, 'Eve' AS first_name, 40 AS age, 'San Diego' AS city
Expand Down
12 changes: 6 additions & 6 deletions docs/pages/product/data-modeling/concepts/calculated-members.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ integer value.
```yaml
cubes:
- name: orders
sql: >
sql: |
SELECT 1 AS id, 'processing' AS status UNION ALL
SELECT 2 AS id, 'completed' AS status UNION ALL
SELECT 3 AS id, 'completed' AS status
Expand Down Expand Up @@ -177,7 +177,7 @@ between `orders` and `users`:
```yaml
cubes:
- name: orders
sql: >
sql: |
SELECT 1 AS id, 1 AS user_id UNION ALL
SELECT 2 AS id, 1 AS user_id UNION ALL
SELECT 3 AS id, 2 AS user_id
Expand All @@ -202,7 +202,7 @@ cubes:
relationship: one_to_many

- name: users
sql: >
sql: |
SELECT 1 AS id, 'Alice' AS name UNION ALL
SELECT 2 AS id, 'Bob' AS name

Expand Down Expand Up @@ -308,7 +308,7 @@ granularity. It can be one of the [default granularities][ref-default-granularit
```yaml
cubes:
- name: users
sql: >
sql: |
SELECT '2025-01-01T00:00:00Z' AS created_at UNION ALL
SELECT '2025-02-01T00:00:00Z' AS created_at UNION ALL
SELECT '2025-03-01T00:00:00Z' AS created_at
Expand Down Expand Up @@ -416,7 +416,7 @@ relationship between `orders` and `users`:
```yaml
cubes:
- name: orders
sql: >
sql: |
SELECT 1 AS id, 1 AS user_id UNION ALL
SELECT 2 AS id, 1 AS user_id UNION ALL
SELECT 3 AS id, 2 AS user_id
Expand All @@ -437,7 +437,7 @@ cubes:
relationship: one_to_many

- name: users
sql: >
sql: |
SELECT 1 AS id, 'Alice' AS name UNION ALL
SELECT 2 AS id, 'Bob' AS name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ First, the `sql` parameter can be overridden in each child cube:
```yaml
cubes:
- name: product_purchases
sql: >
sql: |
SELECT *
FROM events
WHERE {FILTER_PARAMS.product_purchases.timestamp.filter('time')}
Expand Down Expand Up @@ -172,7 +172,7 @@ in the SQL query:
```yaml
cubes:
- name: base_events
sql: >
sql: |
SELECT *
FROM events
WHERE
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/product/data-modeling/concepts/data-blending.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ cube(`all_sales`, {
```yaml
cubes:
- name: all_sales
sql: >
sql: |
SELECT
amount,
user_id AS customer_id,
Expand Down Expand Up @@ -228,7 +228,7 @@ cubes:
- sql: "{CUBE}.row_type = 'retail'"

- name: online_revenue_percentage
sql: >
sql: |
{online_revenue} /
NULLIF({online_revenue} + {offline_revenue}, 0)
type: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Data model:

cubes:
- name: orders
sql: >
sql: |
SELECT 1 AS id, '2025-01-01'::TIMESTAMP AS time UNION ALL
SELECT 2 AS id, '2025-01-11'::TIMESTAMP AS time UNION ALL
SELECT 3 AS id, '2025-01-21'::TIMESTAMP AS time UNION ALL
Expand Down Expand Up @@ -136,7 +136,7 @@ Data model:
```yaml
cubes:
- name: period_to_date
sql: >
sql: |
SELECT '2024-01-01'::TIMESTAMP AS time, 1000 AS revenue UNION ALL
SELECT '2024-02-01'::TIMESTAMP AS time, 1000 AS revenue UNION ALL
SELECT '2024-03-01'::TIMESTAMP AS time, 1000 AS revenue UNION ALL
Expand Down Expand Up @@ -220,7 +220,7 @@ Data model:
```yaml
cubes:
- name: prior_date
sql: >
sql: |
SELECT '2023-04-01'::TIMESTAMP AS time, 1000 AS revenue UNION ALL
SELECT '2023-05-01'::TIMESTAMP AS time, 1000 AS revenue UNION ALL
SELECT '2023-06-01'::TIMESTAMP AS time, 1000 AS revenue UNION ALL
Expand Down Expand Up @@ -350,7 +350,7 @@ Data model:
```yaml
cubes:
- name: percent_of_total
sql: >
sql: |
SELECT 1 AS id, 1000 AS revenue, 'A' AS product, 'USA' AS country UNION ALL
SELECT 2 AS id, 2000 AS revenue, 'B' AS product, 'USA' AS country UNION ALL
SELECT 3 AS id, 3000 AS revenue, 'A' AS product, 'Austria' AS country UNION ALL
Expand Down Expand Up @@ -417,7 +417,7 @@ Data model:
```yaml
cubes:
- name: ranking
sql: >
sql: |
SELECT 1 AS id, 1000 AS revenue, 'A' AS product, 'USA' AS country UNION ALL
SELECT 2 AS id, 2000 AS revenue, 'B' AS product, 'USA' AS country UNION ALL
SELECT 3 AS id, 3000 AS revenue, 'A' AS product, 'Austria' AS country UNION ALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ cube(`students`, {
cubes:
- name: teachers
extends: users
sql: >
sql: |
SELECT *
FROM {users.sql()}
WHERE type = 'teacher'

- name: students
extends: users
sql: >
sql: |
SELECT *
FROM {users.sql()}
WHERE type = 'student'
Expand Down
Loading
Loading