Skip to content

Commit 4731f4a

Browse files
committed
Revert "docs(schema): replace camel-case properties with snake-case"
This reverts commit 50cfd04.
1 parent eb97883 commit 4731f4a

File tree

7 files changed

+213
-212
lines changed

7 files changed

+213
-212
lines changed

docs/content/Schema/Reference/cube.mdx

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ cube(`Contacts`, {
228228

229229
## Parameters
230230

231-
### <--{"id" : "Parameters"}--> data_source
231+
### <--{"id" : "Parameters"}--> dataSource
232232

233-
Each cube in schema can have its own `data_source` name to support scenarios
233+
Each cube in schema can have its own `dataSource` name to support scenarios
234234
where data should be fetched from multiple databases. The value of the
235-
`data_source` parameter will be passed to the
235+
`dataSource` parameter will be passed to the
236236
[`driverFactory()`][ref-config-driverfactory] function as part of the `context`
237-
parameter. By default, each cube has a `default` value for its `data_source`; to
237+
parameter. By default, each cube has a `default` value for its `dataSource`; to
238238
override it you can use:
239239

240240
<CodeTabs>
@@ -243,7 +243,7 @@ override it you can use:
243243
cube(`OrderFacts`, {
244244
sql: `SELECT * FROM orders`,
245245

246-
data_source: `prod_db`,
246+
dataSource: `prod_db`,
247247
});
248248
```
249249

@@ -364,21 +364,21 @@ cube(`ExtendedOrderFacts`, {
364364
});
365365
```
366366

367-
### <--{"id" : "Parameters"}--> refresh_key
367+
### <--{"id" : "Parameters"}--> refreshKey
368368

369-
Cube's caching layer uses `refresh_key` queries to get the current version of
369+
Cube's caching layer uses `refreshKey` queries to get the current version of
370370
content for a specific cube. If a query result changes, Cube will invalidate all
371371
queries that rely on that cube.
372372

373-
The default values for `refresh_key` are
373+
The default values for `refreshKey` are
374374

375375
- `every: '2 minute'` for BigQuery, Athena, Snowflake, and Presto.
376376
- `every: '10 second'` for all other databases.
377377

378378
Refresh key of a query is a concatenation of all cubes refresh keys involved in
379379
query. For rollup queries pre-aggregation table name is used as a refresh key.
380380

381-
You can set up a custom refresh check SQL by changing `refresh_key` property.
381+
You can set up a custom refresh check SQL by changing `refreshKey` property.
382382
Often, a `MAX(updated_at_timestamp)` for OLTP data is a viable option, or
383383
examining a metadata table for whatever system is managing the data to see when
384384
it last ran. timestamp in that case.
@@ -389,10 +389,10 @@ it last ran. timestamp in that case.
389389
cube(`OrderFacts`, {
390390
sql: `SELECT * FROM orders`,
391391

392-
// With this refresh_key Cube will only refresh the data if
392+
// With this refreshKey Cube will only refresh the data if
393393
// the value of previous MAX(updated_at_timestamp) changed
394-
// By default Cube will check this refresh_key every 10 seconds
395-
refresh_key: {
394+
// By default Cube will check this refreshKey every 10 seconds
395+
refreshKey: {
396396
sql: `SELECT MAX(updated_at_timestamp) FROM orders`,
397397
},
398398
});
@@ -408,15 +408,15 @@ cubes:
408408
409409
</CodeTabs>
410410
411-
You can use interval based `refresh_key`. For example:
411+
You can use interval based `refreshKey`. For example:
412412

413413
<CodeTabs>
414414

415415
```javascript
416416
cube(`OrderFacts`, {
417417
sql: `SELECT * FROM orders`,
418418

419-
refresh_key: {
419+
refreshKey: {
420420
every: `1 hour`,
421421
},
422422
});
@@ -443,7 +443,7 @@ For example:
443443
```javascript
444444
cube(`OrderFacts`, {
445445
sql: `SELECT * FROM orders`,
446-
refresh_key: {
446+
refreshKey: {
447447
every: '30 5 * * 5',
448448
timezone: 'America/Los_Angeles',
449449
},
@@ -471,21 +471,21 @@ with support for seconds.
471471

472472
</WarningBox>
473473

474-
Such `refresh_key` is just a syntactic sugar over `refresh_key` SQL. It's
475-
guaranteed that `refresh_key` change its value at least once during `every`
474+
Such `refreshKey` is just a syntactic sugar over `refreshKey` SQL. It's
475+
guaranteed that `refreshKey` change it's value at least once during `every`
476476
interval. It will be converted to appropriate SQL select which value will change
477-
over time based on interval value. Values of interval based `refresh_key` are
477+
over time based on interval value. Values of interval based `refreshKey` are
478478
tried to be checked ten times within defined interval but not more than once per
479479
`1 second` and not less than once per `5 minute`. For example if interval is
480-
`10 minute` it's `refresh_key_renewal_threshold` will be 60 seconds and
481-
generated `refresh_key` SQL (Postgres) would be:
480+
`10 minute` it's `refreshKeyRenewalThreshold` will be 60 seconds and generated
481+
`refreshKey` SQL (Postgres) would be:
482482

483483
```sql
484484
SELECT FLOOR(EXTRACT(EPOCH FROM NOW()) / 600)
485485
```
486486

487-
For `5 second` interval `refresh_key_renewal_threshold` will be just 1 second
488-
and SQL will be:
487+
For `5 second` interval `refreshKeyRenewalThreshold` will be just 1 second and
488+
SQL will be:
489489

490490
```sql
491491
SELECT FLOOR(EXTRACT(EPOCH FROM NOW()) / 5)
@@ -520,7 +520,7 @@ SELECT FLOOR(EXTRACT(EPOCH FROM NOW()) / 5)
520520
└───────────────────────── second (0 - 59, optional)
521521
```
522522

523-
### <--{"id" : "Parameters"}--> rewrite_queries
523+
### <--{"id" : "Parameters"}--> rewriteQueries
524524

525525
Set this flag to true if you want Cube to rewrite your queries after final SQL
526526
has been generated. This may be helpful to apply filter pushdown optimizations
@@ -530,7 +530,7 @@ or reduce unnecessary query nesting. For example:
530530

531531
```javascript
532532
cube(`Tickets`, {
533-
rewrite_queries: true,
533+
rewriteQueries: true,
534534
});
535535
```
536536

@@ -602,9 +602,9 @@ cube(`Companies`, {
602602
});
603603
```
604604

605-
### <--{"id" : "Parameters"}--> sql_alias
605+
### <--{"id" : "Parameters"}--> sqlAlias
606606

607-
Use `sql_alias` when auto-generated cube alias prefix is too long and truncated
607+
Use `sqlAlias` when auto-generated cube alias prefix is too long and truncated
608608
by DB such as Postgres:
609609

610610
<CodeTabs>
@@ -613,7 +613,7 @@ by DB such as Postgres:
613613
cube(`OrderFacts`, {
614614
sql: `SELECT * FROM orders`,
615615

616-
sql_alias: `ofacts`,
616+
sqlAlias: `ofacts`,
617617

618618
// ...
619619
});
@@ -628,7 +628,7 @@ cubes:
628628
629629
</CodeTabs>
630630
631-
It'll generate aliases for members such as `ofacts__count`. `sql_alias` affects
631+
It'll generate aliases for members such as `ofacts__count`. `sqlAlias` affects
632632
all member names including pre-aggregation table names.
633633

634634
### <--{"id" : "Parameters"}--> title
@@ -705,7 +705,8 @@ cube(`OrderFacts`, {
705705
cubes:
706706
- name: OrderFacts
707707
sql: >
708-
SELECT * FROM orders WHERE {FILTER_PARAMS.OrderFacts.date.filter('date')}
708+
SELECT * FROM orders
709+
WHERE {FILTER_PARAMS.OrderFacts.date.filter('date')}
709710
measures:
710711
- name: count
711712
type: count

docs/content/Schema/Reference/dimensions.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ redirect_from:
1111
---
1212

1313
The `dimensions` property contains a set of dimensions. You can think about a
14-
dimension as an attribute related to a measure, e.g. the measure `user_count`
15-
can have dimensions like `country`, `age`, `occupation`, etc.
14+
dimension as an attribute related to a measure, e.g. the measure `userCount` can
15+
have dimensions like `country`, `age`, `occupation`, etc.
1616

1717
Any dimension should have the following properties: `name`, `sql` and `type`.
1818

@@ -209,7 +209,7 @@ cubes:
209209
210210
</CodeTabs>
211211
212-
### <--{"id" : "Parameters"}--> primary_key
212+
### <--{"id" : "Parameters"}--> primaryKey
213213
214214
Specify which dimension is a primary key for a cube. The default value is
215215
`false`.
@@ -218,7 +218,7 @@ A primary key is used to make [joins][ref-schema-ref-joins] work properly.
218218

219219
<WarningBox>
220220

221-
Setting `primary_key` to `true` will change the default value of `shown`
221+
Setting `primaryKey` to `true` will change the default value of `shown`
222222
parameter to `false`. If you still want `shown` to be `true`, set it manually.
223223

224224
</WarningBox>
@@ -231,7 +231,7 @@ cube('Products', {
231231
id: {
232232
sql: `id`,
233233
type: `number`,
234-
primary_key: true,
234+
primaryKey: true,
235235
},
236236
},
237237
});
@@ -249,7 +249,7 @@ cubes:
249249
250250
</CodeTabs>
251251
252-
### <--{"id" : "Parameters"}--> propagate_filters_to_sub_query
252+
### <--{"id" : "Parameters"}--> propagateFiltersToSubQuery
253253
254254
When this statement is set to `true`, the filters applied to the query will be
255255
passed to the [subquery][self-subquery].
@@ -262,8 +262,8 @@ cube('Products', {
262262
users_count: {
263263
sql: `${Users.count}`,
264264
type: `number`,
265-
sub_query: true,
266-
propagate_filters_to_sub_query: true,
265+
subQuery: true,
266+
propagateFiltersToSubQuery: true,
267267
},
268268
},
269269
});
@@ -276,8 +276,8 @@ cubes:
276276
- name: users_count
277277
sql: "{Users.count}"
278278
type: number
279-
sub_query: true
280-
propagate_filters_to_sub_query: true
279+
subQuery: true
280+
propagateFiltersToSubQuery: true
281281
```
282282
283283
</CodeTabs>
@@ -331,10 +331,10 @@ cube(`Orders`, {
331331
});
332332
```
333333

334-
### <--{"id" : "Parameters"}--> sub_query
334+
### <--{"id" : "Parameters"}--> subQuery
335335

336-
The `sub_query` statement allows you to reference a measure in a dimension. It's
337-
an advanced concept; you can learn more about it [here][ref-subquery].
336+
The `subQuery` statement allows you to reference a measure in a dimension. It's
337+
an advanced concept and you can learn more about it [here][ref-subquery].
338338

339339
<CodeTabs>
340340

@@ -344,7 +344,7 @@ cube('Products', {
344344
users_count: {
345345
sql: `${Users.count}`,
346346
type: `number`,
347-
sub_query: true,
347+
subQuery: true,
348348
},
349349
},
350350
});
@@ -357,7 +357,7 @@ cubes:
357357
- name: usersCount
358358
sql: "{Users.count}"
359359
type: number
360-
sub_query: true
360+
subQuery: true
361361
```
362362
363363
</CodeTabs>

0 commit comments

Comments
 (0)