Skip to content

Commit 19b3bf6

Browse files
author
Wojciechowski Marcin
committed
Replace inject connection with dataSource
1 parent 411fa64 commit 19b3bf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/techniques/sql.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ You can also inject the `DataSource` or `EntityManager` for a given data source:
559559
@Injectable()
560560
export class AlbumsService {
561561
constructor(
562-
@InjectConnection('albumsConnection')
562+
@InjectDataSource('albumsConnection')
563563
private dataSource: DataSource,
564564
@InjectEntityManager('albumsConnection')
565565
private entityManager: EntityManager,
@@ -1149,7 +1149,7 @@ You can also inject the `Sequelize` instance for a given connection:
11491149
@Injectable()
11501150
export class AlbumsService {
11511151
constructor(
1152-
@InjectConnection('albumsConnection')
1152+
@InjectDataSource('albumsConnection')
11531153
private sequelize: Sequelize,
11541154
) {}
11551155
}
@@ -1165,7 +1165,7 @@ It's also possible to inject any `Sequelize` instance to the providers:
11651165
useFactory: (albumsSequelize: Sequelize) => {
11661166
return new AlbumsService(albumsSequelize);
11671167
},
1168-
inject: [getConnectionToken('albumsConnection')],
1168+
inject: [getDataSourceToken('albumsConnection')],
11691169
},
11701170
],
11711171
})

0 commit comments

Comments
 (0)