Skip to content

Commit

Permalink
docs: update orm.md (#3833)
Browse files Browse the repository at this point in the history
* Update orm.md

Add Different path support for DataSource

* Update orm.md

Update orm.md

* Update orm.md

修改路径和文件名的匹配方式

* Update orm.md

Update orm.md

* Update orm.md

Update orm.md
  • Loading branch information
flyingcrp authored May 7, 2024
1 parent 6657446 commit 8bc2f2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 7 additions & 3 deletions site/docs/extensions/orm.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,14 @@ export default {
// 配置实体模型
entities: [Photo],

// 或者扫描形式
// 支持如下的扫描形式,为了兼容我们可以同时进行.js和.ts匹配,⬇️
entities: [
'**/entity/*.entity{.ts,.js}'
'entity', // 特定目录
'**/abc/**', // 仅获取包含 abc 字符的目录下的文件
'abc/**/*.{j,t}s', // 特定目录 + 通配
'abc/*.entity.{j,t}s', // 匹配后缀
'**/*.entity.{j,t}s', // 通配加后缀匹配
'**/*.{j,t}s', // 后缀匹配
]
}
}
Expand Down Expand Up @@ -1680,4 +1685,3 @@ export default {
- 1、检查 `config.default.ts` 中的 `entities` 配置是否正确
- 2、检查 `configuration.ts` 文件,确认是否引入 orm
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,14 @@ export default {
// Configure the entity model
entities: [Photo],

// or scan format
// or scan format,For compatibility we can match .js and .ts at the same time
entities: [
'**/entity/*.entity{.ts,.js}'
'entity', // Specific directory
'**/abc/**', // Gets only files in directories that contain abc characters
'abc/**/*.{j,t}s', // Specific directory + suffix matching
'abc/*.entity.{j,t}s', // suffix matching
'**/*.entity.{j,t}s', // wildcard path + suffix matching
'**/*.{j,t}s', // suffix matching
]
}
}
Expand Down

0 comments on commit 8bc2f2b

Please sign in to comment.