@@ -11,6 +11,7 @@ Decorators and some other extras for sequelize (v3 + v4).
11
11
- [ ` @Column ` API] ( #column-api )
12
12
- [ Usage] ( #usage )
13
13
- [ Configuration] ( #configuration )
14
+ - [ globs] ( #globs )
14
15
- [ Model-path resolving] ( #model-path-resolving )
15
16
- [ Model association] ( #model-association )
16
17
- [ One-to-many] ( #one-to-many )
@@ -63,6 +64,8 @@ class Person extends Model<Person> {
63
64
```
64
65
The model needs to extend the ` Model ` class and has to be annotated with the ` @Table ` decorator. All properties that
65
66
should appear as a column in the database require the ` @Column ` annotation.
67
+
68
+ See more advanced example [ here] ( https://github.com/RobinBuschmann/sequelize-typescript-example ) .
66
69
67
70
### ` @Table `
68
71
The ` @Table ` annotation can be used without passing any parameters. To specify some more define options, use
@@ -209,6 +212,18 @@ sequelize config or add the required models later on by calling `sequelize.addMo
209
212
sequelize .addModels ([Person ]);
210
213
sequelize .addModels ([' path/to/models' ]);
211
214
```
215
+ ### globs
216
+ ``` typescript
217
+ import {Sequelize } from ' sequelize-typescript' ;
218
+
219
+ const sequelize = new Sequelize ({
220
+ ...
221
+ modelPaths : [__dirname + ' /**/*.model.ts' ]
222
+ });
223
+ // or
224
+ sequelize .addModels ([__dirname + ' /**/*.model.ts' ]);
225
+ ```
226
+
212
227
#### Model-path resolving
213
228
When using a path to resolve the required models, either the class has to be exported as default or if not exported
214
229
as default, the file should have the same name as the corresponding class:
0 commit comments