Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit 850b467

Browse files
authored
refactor(export): add export * for sequelize base classes
* refactor(package.json): change the name and add repository url * refactor(export): add export * for sequelize base classes * fix(datasource): handle `user` and `username` both in config default config generated with `lb4 datasource` adds `user` but sequelize uses `username`
1 parent a1dd46f commit 850b467

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "loopback4-sequelize",
2+
"name": "loopback4-sequelize-extension",
33
"version": "0.0.1",
44
"description": "Loopback 4 extension that provides Sequelize powered repository methods.",
55
"keywords": [
@@ -30,7 +30,7 @@
3030
},
3131
"repository": {
3232
"type": "git",
33-
"url": ""
33+
"url": "https://github.com/shubhamp-sf/loopback4-sequelize-extension"
3434
},
3535
"author": "Shubham Prajapat <shubham.prajapat@sourcefuse.com>",
3636
"license": "",

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './component';
22
export * from './keys';
3+
export * from './sequelize';
34
export * from './types';

src/sequelize/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './sequelize.datasource.base';
2+
export * from './sequelize.repository.base';

src/sequelize/sequelize.datasource.base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class SequelizeDataSource
66
extends juggler.DataSource
77
implements LifeCycleObserver
88
{
9-
constructor(public config: SequelizeOptions) {
9+
constructor(public config: SequelizeOptions & {user?: string}) {
1010
super(config);
1111
}
1212
sequelize?: Sequelize;
@@ -18,7 +18,7 @@ export class SequelizeDataSource
1818
port: this.config.port,
1919
database: this.config.database,
2020
dialect: 'postgres',
21-
username: this.config.username,
21+
username: this.config.user ?? this.config.username,
2222
password: this.config.password,
2323
logging: console.log,
2424
});

0 commit comments

Comments
 (0)