Skip to content

Commit b7a8181

Browse files
authored
docs(config): add warning about FileRepository only using files from a single directory (cube-js#5301)
1 parent b6e7d04 commit b7a8181

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

docs/content/Configuration/Config.mdx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -775,12 +775,23 @@ and sets it to `req.securityContext`.
775775

776776
## SchemaFileRepository
777777

778+
<WarningBox>
779+
780+
The default implementation of the `SchemaFileRepository` contract is defined by
781+
the [`FileRepository`][gh-cube-filerepo] class. When using
782+
[`FileRepository`][gh-cube-filerepo], all schema files must be within the same
783+
directory.
784+
785+
</WarningBox>
786+
787+
[gh-cube-filerepo]:
788+
https://github.com/cube-js/cube.js/blob/master/packages/cubejs-server-core/src/core/FileRepository.ts
789+
778790
The `SchemaFileRepository` contract defines an async `dataSchemaFiles` function
779791
which returns the files to compile for a schema. Returned by
780-
[repositoryFactory][self-repofactory].
781-
`@cubejs-backend/server-core/core/FileRepository` is the default implementation
782-
of the `SchemaFileRepository` contract which accepts
783-
[schemaPath][self-schemapath] in the constructor.
792+
[repositoryFactory][self-repofactory]. The [`FileRepository`][gh-cube-filerepo]
793+
implementation of the `SchemaFileRepository` contract accepts a
794+
[`schemaPath`][self-schemapath] in its constructor.
784795

785796
```javascript
786797
class ApiFileRepository {
@@ -825,7 +836,7 @@ module.exports = {
825836
[self-opts-sched-refresh-ctxs]: #scheduled-refresh-contexts
826837
[self-opts-sched-refresh-tz]: #scheduled-refresh-time-zones
827838
[self-repofactory]: #repositoryFactory
828-
[self-schemafilerepo]: #SchemaFileRepository
839+
[self-schemafilerepo]: #schema-file-repository
829840
[self-schemapath]: #schemaPath
830841
[ref-exec-environment-globals]:
831842
/schema/reference/execution-environment#node-js-globals-process-env-console-log-and-others

0 commit comments

Comments
 (0)