minimonolith 0.26.12 → 0.26.19

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minimonolith",
3
3
  "type": "module",
4
- "version": "0.26.12",
4
+ "version": "0.26.19",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -10,12 +10,21 @@ import postConnection from '../postConnection/index.js'
10
10
  const META_MODULE='DATABASE', META_METHOD='POST',
11
11
  META_ROUTE=META_MODULE+'_'+META_METHOD;
12
12
 
13
- export default async ({ DB_DIALECT='sqlite', DB_HOST=undefined,
14
- DB_PORT=undefined, DB_DB=undefined,
15
- DB_USER=undefined, DB_PASS=undefined, DB_STORAGE=':memory:'} = {}) =>
13
+ export default async ({ DB_DIALECT, DB_HOST,
14
+ DB_PORT, DB_DB, DB_USER, DB_PASS, DB_STORAGE }) =>
16
15
  {
17
16
 
18
17
  try {
18
+
19
+ const DB_VARS = Object.fromEntries(
20
+ Object.entries({
21
+ DB_DIALECT, DB_HOST, DB_PORT, DB_DB,
22
+ DB_USER, DB_PASS, DB_STORAGE })
23
+ .filter(([key, val]) => val != null)
24
+ );
25
+
26
+ LOG_MODULE.postDEBUG(`DB vars:`, DB_VARS);
27
+
19
28
  if (DB_DIALECT!=='sqlite' && (!DB_HOST || !DB_PORT ||
20
29
  !DB_DB || !DB_USER || !DB_PASS)) {
21
30
 
@@ -27,15 +36,6 @@ export default async ({ DB_DIALECT='sqlite', DB_HOST=undefined,
27
36
  const SEQUELIZE_OPTIONS = { dialect: DB_DIALECT, host: DB_HOST,
28
37
  port: DB_PORT, storage: DB_STORAGE, logging: false };
29
38
 
30
- const DB_VARS = Object.fromEntries(
31
- Object.entries({
32
- DB_DIALECT, DB_HOST, DB_PORT, DB_DB,
33
- DB_USER, DB_PASS, DB_STORAGE })
34
- .filter(([key, val]) => val != null)
35
- );
36
-
37
- LOG_MODULE.postDEBUG(`DB vars:`, DB_VARS);
38
-
39
39
  API_MODULE.get().ORM = new Sequelize(DB_DB, DB_USER,
40
40
  DB_PASS, SEQUELIZE_OPTIONS);
41
41
  await postConnection(API_MODULE.get().ORM);