@storecraft/database-postgres 1.0.17 → 1.2.5
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 +6 -5
- package/index.js +5 -5
- package/package.json +1 -2
package/README.md
CHANGED
@@ -41,14 +41,15 @@ const app = new App(
|
|
41
41
|
})
|
42
42
|
)
|
43
43
|
.withStorage(new NodeLocalStorage('storage'))
|
44
|
+
.init();
|
44
45
|
|
45
|
-
await app.
|
46
|
-
await
|
47
|
-
|
48
|
-
|
46
|
+
await migrateToLatest(app.__show_me_everything.db, false);
|
47
|
+
await app.__show_me_everything.vector_store.createVectorIndex();
|
48
|
+
|
49
|
+
http.createServer(app.handler).listen(
|
49
50
|
8000,
|
50
51
|
() => {
|
51
|
-
|
52
|
+
app.print_banner('http://localhost:8000');
|
52
53
|
}
|
53
54
|
);
|
54
55
|
|
package/index.js
CHANGED
@@ -15,7 +15,7 @@ import pg from 'pg';
|
|
15
15
|
export class Postgres extends SQL {
|
16
16
|
|
17
17
|
/** @satisfies {ENV<Config>} */
|
18
|
-
static EnvConfig = /** @type{const} */ ({
|
18
|
+
static EnvConfig = /** @type {const} */ ({
|
19
19
|
pool_config: {
|
20
20
|
host: 'POSTGRES_HOST',
|
21
21
|
port: 'POSTGRES_PORT',
|
@@ -48,16 +48,16 @@ export class Postgres extends SQL {
|
|
48
48
|
/** @type {SQL["init"]} */
|
49
49
|
init = (app) => {
|
50
50
|
this.pg_config.pool_config.host ??=
|
51
|
-
app.
|
51
|
+
app.env[Postgres.EnvConfig.pool_config.host];
|
52
52
|
|
53
53
|
this.pg_config.pool_config.port ??=
|
54
|
-
parseFloat(app.
|
54
|
+
parseFloat(app.env[Postgres.EnvConfig.pool_config.port]);
|
55
55
|
|
56
56
|
this.pg_config.pool_config.user ??=
|
57
|
-
app.
|
57
|
+
app.env[Postgres.EnvConfig.pool_config.user];
|
58
58
|
|
59
59
|
this.pg_config.pool_config.password ??=
|
60
|
-
app.
|
60
|
+
app.env[Postgres.EnvConfig.pool_config.password];
|
61
61
|
|
62
62
|
super.init(app);
|
63
63
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storecraft/database-postgres",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.5",
|
4
4
|
"description": "Official Postgres Database driver for storecraft",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Tomer Shalev (https://github.com/store-craft)",
|
@@ -32,7 +32,6 @@
|
|
32
32
|
"database-postgres:docker-compose-up": "docker compose -f ./tests/docker-compose.yml up -d ",
|
33
33
|
"database-postgres:test": "node ./tests/runner.test.js",
|
34
34
|
"test": "npm run database-postgres:test",
|
35
|
-
"prepublishOnly": "npm version patch --force",
|
36
35
|
"sc-publish": "npm publish"
|
37
36
|
},
|
38
37
|
"dependencies": {
|