@@ -11,6 +11,7 @@ Decorators and some other extras for sequelize (v3 + v4).
1111 - [ ` @Column ` API] ( #column-api )
1212 - [ Usage] ( #usage )
1313 - [ Configuration] ( #configuration )
14+ - [ globs] ( #globs )
1415 - [ Model-path resolving] ( #model-path-resolving )
1516 - [ Model association] ( #model-association )
1617 - [ One-to-many] ( #one-to-many )
@@ -63,6 +64,8 @@ class Person extends Model<Person> {
6364```
6465The model needs to extend the ` Model ` class and has to be annotated with the ` @Table ` decorator. All properties that
6566should 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 ) .
6669
6770### ` @Table `
6871The ` @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
209212sequelize .addModels ([Person ]);
210213sequelize .addModels ([' path/to/models' ]);
211214```
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+
212227#### Model-path resolving
213228When using a path to resolve the required models, either the class has to be exported as default or if not exported
214229as default, the file should have the same name as the corresponding class:
0 commit comments