@ttoss/postgresdb 0.2.24 → 0.2.27
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/README.md +5 -5
- package/dist/esm/index.js +5 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -98,11 +98,11 @@ export const db = initialize({
|
|
|
98
98
|
**Option 2 - Environment variables (`.env`):**
|
|
99
99
|
|
|
100
100
|
```env
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
DATABASE_NAME=postgres
|
|
102
|
+
DATABASE_USER=postgres
|
|
103
|
+
DATABASE_PASSWORD=mysecretpassword
|
|
104
|
+
DATABASE_HOST=localhost
|
|
105
|
+
DATABASE_PORT=5432
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
Environment variables are automatically used if defined.
|
package/dist/esm/index.js
CHANGED
|
@@ -14,11 +14,11 @@ var initialize = /* @__PURE__ */__name(async ({
|
|
|
14
14
|
models,
|
|
15
15
|
...restOptions
|
|
16
16
|
}) => {
|
|
17
|
-
const username = process.env.
|
|
18
|
-
password = process.env.
|
|
19
|
-
database = process.env.
|
|
20
|
-
host = process.env.
|
|
21
|
-
port = Number(process.env.
|
|
17
|
+
const username = process.env.DATABASE_USER,
|
|
18
|
+
password = process.env.DATABASE_PASSWORD,
|
|
19
|
+
database = process.env.DATABASE_NAME,
|
|
20
|
+
host = process.env.DATABASE_HOST,
|
|
21
|
+
port = Number(process.env.DATABASE_PORT) || 5432;
|
|
22
22
|
if (!sequelize) {
|
|
23
23
|
sequelize = new Sequelize({
|
|
24
24
|
logging: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/postgresdb",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "A library to handle PostgreSQL database connections and queries",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/ttoss/ttoss.git",
|
|
12
|
+
"url": "git+https://github.com/ttoss/ttoss.git",
|
|
13
13
|
"directory": "packages/postgresdb"
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"jest": "^30.2.0",
|
|
33
33
|
"tsup": "^8.5.1",
|
|
34
|
-
"@ttoss/config": "^1.35.
|
|
34
|
+
"@ttoss/config": "^1.35.12"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"database",
|