@slickteam/nestjs-pg-typeorm 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,20 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Slickteam
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Slickteam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md CHANGED
@@ -1,69 +1,69 @@
1
- # Slick Nestjs Postresql Typeorm
2
-
3
- Available on npmjs.org : [@slickteam/nestjs-pg-typeorm](https://www.npmjs.com/package/@slickteam/nestjs-pg-typeorm)
4
-
5
- ## Usage
6
-
7
- - Install dependency
8
-
9
- ```bash
10
- npm i -S @slickteam/nestjs-pg-typeorm
11
- ```
12
-
13
- - In your environment file, add these lines :
14
-
15
- ```conf
16
- POSTGRESQL_ADDON_HOST=localhost
17
- POSTGRESQL_ADDON_PORT=5432
18
- POSTGRESQL_ADDON_USER=user
19
- POSTGRESQL_ADDON_PASSWORD=password
20
- POSTGRESQL_ADDON_DB=db_name
21
- POSTGRESQL_MAX_POOL_SIZE=25
22
- # Optionnel
23
- POSTGRESQL_SYNCHRONIZE=false
24
- POSTGRESQL_LOGGER=
25
- POSTGRESQL_ENTITY_PATH=dist/**/*.entity.js,dist/**/**/*.entity.js
26
- POSTGRESQL_MIGRATION_PATH=dist/migration/*.js
27
- ```
28
-
29
- - In module where you want use this module, add this :
30
-
31
- ```ts
32
- @Module({
33
- imports: [Warp10Module],
34
- controllers: [],
35
- providers: [],
36
- exports: [],
37
- })
38
- class ExempleModule {}
39
- ```
40
-
41
- ## Commands for package.json
42
-
43
- ```json
44
- {
45
- "scripts": {
46
- "migration:drop": "typeorm-ts-node-commonjs schema:drop -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js",
47
- "migration:show": "typeorm-ts-node-commonjs migration:show -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js",
48
- "migration:create": "typeorm-ts-node-commonjs migration:create",
49
- "migration:run": "typeorm-ts-node-commonjs migration:run -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js",
50
- "migration:revert": "typeorm-ts-node-commonjs migration:revert -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js"
51
- }
52
- }
53
- ```
54
-
55
- ## Dependencies version
56
-
57
- Nestjs
58
-
59
- - `@nestjs/common`: `^10.4.7`
60
- - `@nestjs/config`: `^3.3.0`
61
-
62
- Pg
63
-
64
- - `pg`: `^8.13.1`
65
-
66
- Typeorm
67
-
68
- - `@nestjs/typeorm`: `^10.0.2`
69
- - `typeorm`: `^0.3.20`
1
+ # Slick Nestjs Postresql Typeorm
2
+
3
+ Available on npmjs.org : [@slickteam/nestjs-pg-typeorm](https://www.npmjs.com/package/@slickteam/nestjs-pg-typeorm)
4
+
5
+ ## Usage
6
+
7
+ - Install dependency
8
+
9
+ ```bash
10
+ npm i -S @slickteam/nestjs-pg-typeorm
11
+ ```
12
+
13
+ - In your environment file, add these lines :
14
+
15
+ ```conf
16
+ POSTGRESQL_ADDON_HOST=localhost
17
+ POSTGRESQL_ADDON_PORT=5432
18
+ POSTGRESQL_ADDON_USER=user
19
+ POSTGRESQL_ADDON_PASSWORD=password
20
+ POSTGRESQL_ADDON_DB=db_name
21
+ POSTGRESQL_MAX_POOL_SIZE=25
22
+ # Optionnel
23
+ POSTGRESQL_SYNCHRONIZE=false
24
+ POSTGRESQL_LOGGER=
25
+ POSTGRESQL_ENTITY_PATH=dist/**/*.entity.js,dist/**/**/*.entity.js
26
+ POSTGRESQL_MIGRATION_PATH=dist/migration/*.js
27
+ ```
28
+
29
+ - In module where you want use this module, add this :
30
+
31
+ ```ts
32
+ @Module({
33
+ imports: [Warp10Module],
34
+ controllers: [],
35
+ providers: [],
36
+ exports: [],
37
+ })
38
+ class ExempleModule {}
39
+ ```
40
+
41
+ ## Commands for package.json
42
+
43
+ ```json
44
+ {
45
+ "scripts": {
46
+ "migration:drop": "typeorm-ts-node-commonjs schema:drop -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js",
47
+ "migration:show": "typeorm-ts-node-commonjs migration:show -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js",
48
+ "migration:create": "typeorm-ts-node-commonjs migration:create",
49
+ "migration:run": "typeorm-ts-node-commonjs migration:run -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js",
50
+ "migration:revert": "typeorm-ts-node-commonjs migration:revert -d ./node_modules/@slickteam/nestjs-pg-typeorm/dist/database-config.js"
51
+ }
52
+ }
53
+ ```
54
+
55
+ ## Dependencies version
56
+
57
+ Nestjs
58
+
59
+ - `@nestjs/common`: `^10.4.7`
60
+ - `@nestjs/config`: `^3.3.0`
61
+
62
+ Pg
63
+
64
+ - `pg`: `^8.13.1`
65
+
66
+ Typeorm
67
+
68
+ - `@nestjs/typeorm`: `^10.0.2`
69
+ - `typeorm`: `^0.3.20`
@@ -20,7 +20,12 @@ exports.databaseSettings = {
20
20
  synchronize: process.env.POSTGRESQL_SYNCHRONIZE === 'true',
21
21
  logger: postgresLogger(),
22
22
  poolSize: Number(process.env.POSTGRESQL_MAX_POOL_SIZE),
23
- entities: process.env.POSTGRESQL_ENTITY_PATH?.split(',') ?? ['dist/**/*.entity.js', 'dist/**/**/*.entity.js'],
23
+ entities: process.env.POSTGRESQL_ENTITY_PATH?.split(',') ?? [
24
+ 'dist/**/*entity.js',
25
+ 'dist/**/*Entity.js',
26
+ 'dist/**/**/*entity.js',
27
+ 'dist/**/**/*Entity.js',
28
+ ],
24
29
  migrations: [process.env.POSTGRESQL_MIGRATION_PATH ?? 'dist/migration/*.js'],
25
30
  };
26
31
  exports.default = new typeorm_1.DataSource(exports.databaseSettings);
@@ -1 +1 @@
1
- {"version":3,"file":"database-config.js","sourceRoot":"","sources":["../src/database-config.ts"],"names":[],"mappings":";;;AAAA,qCAAwD;AACxD,mCAA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