@superhero/eventflow-db 4.3.2 → 4.3.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.
Files changed (3) hide show
  1. package/config.js +21 -3
  2. package/index.js +6 -1
  3. package/package.json +1 -1
package/config.js CHANGED
@@ -11,22 +11,40 @@ export default
11
11
  {
12
12
  db:
13
13
  {
14
+ // @link: https://sidorares.github.io/node-mysql2/docs/examples/connections/create-connection
15
+ // @link: https://sidorares.github.io/node-mysql2/docs/examples/connections/create-pool
16
+
14
17
  debug : process.env.EVENTFLOW_MYSQL_DEBUG ?? false,
18
+ trace : process.env.EVENTFLOW_MYSQL_TRACE ?? true,
19
+ decimalNumbers : process.env.EVENTFLOW_MYSQL_DECIMAL_NUMBERS ?? false,
20
+ disableEval : process.env.EVENTFLOW_MYSQL_DISABLE_EVAL ?? true,
21
+ bigNumberStrings : process.env.EVENTFLOW_MYSQL_BIG_NUMBER_STRINGS ?? false,
22
+ supportBigNumbers : process.env.EVENTFLOW_MYSQL_SUPPORT_BIG_NUMBERS ?? false,
15
23
  insecureAuth : process.env.EVENTFLOW_MYSQL_INSECURE_AUTH ?? false,
16
24
  enableKeepAlive : process.env.EVENTFLOW_MYSQL_ENABLE_KEEP_ALIVE ?? true,
25
+ keepAliveInitialDelay : process.env.EVENTFLOW_MYSQL_KEEP_ALIVE_DELAY ?? 0,
17
26
  waitForConnections : process.env.EVENTFLOW_MYSQL_WAIT_FOR_CONN ?? true,
27
+ compress : process.env.EVENTFLOW_MYSQL_COMPRESS ?? false,
18
28
  namedPlaceholders : process.env.EVENTFLOW_MYSQL_NAMED_PLACEHOLDERS ?? false,
19
- idleTimeout : process.env.EVENTFLOW_MYSQL_IDLE_TIMEOUT ?? 0,
20
- keepAliveInitialDelay : process.env.EVENTFLOW_MYSQL_KEEP_ALIVE_DELAY ?? 0,
29
+ maxIdle : process.env.EVENTFLOW_MYSQL_MAX_IDLE ??
30
+ process.env.EVENTFLOW_MYSQL_CONNECTION_LIMIT ?? 10,
31
+ idleTimeout : process.env.EVENTFLOW_MYSQL_IDLE_TIMEOUT ?? 60e3,
21
32
  queueLimit : process.env.EVENTFLOW_MYSQL_QUEUE_LIMIT ?? 0,
22
33
  connectionLimit : process.env.EVENTFLOW_MYSQL_CONNECTION_LIMIT ?? 10,
23
- flags : process.env.EVENTFLOW_MYSQL_FLAGS ?? '',
34
+ flags : process.env.EVENTFLOW_MYSQL_FLAGS ?? false,
35
+ ssl : process.env.EVENTFLOW_MYSQL_SSL ?? false,
24
36
  charset : process.env.EVENTFLOW_MYSQL_CHARSET ?? 'utf8mb4',
25
37
  timezone : process.env.EVENTFLOW_MYSQL_TIMEZONE ?? 'Z',
26
38
  host : process.env.EVENTFLOW_MYSQL_HOST ?? 'localhost',
27
39
  port : process.env.EVENTFLOW_MYSQL_PORT ?? '3306',
40
+ socketPath : process.env.EVENTFLOW_MYSQL_SOCKET_PATH ?? false,
28
41
  user : process.env.EVENTFLOW_MYSQL_USER ?? 'root',
29
42
  password : process.env.EVENTFLOW_MYSQL_PASS ?? 'root',
43
+ passwordSha1 : process.env.EVENTFLOW_MYSQL_PASS_SHA1 ?? false,
44
+ // multifactor authentication support
45
+ password1 : process.env.EVENTFLOW_MYSQL_PASS_1 ?? false,
46
+ password2 : process.env.EVENTFLOW_MYSQL_PASS_2 ?? false,
47
+ password3 : process.env.EVENTFLOW_MYSQL_PASS_3 ?? false,
30
48
  database : process.env.EVENTFLOW_MYSQL_DB ?? 'eventflow',
31
49
  }
32
50
  }
package/index.js CHANGED
@@ -30,6 +30,11 @@ export default class DB
30
30
  this.gateway = gateway
31
31
  }
32
32
 
33
+ async destroy()
34
+ {
35
+ await this.close()
36
+ }
37
+
33
38
  async close()
34
39
  {
35
40
  await this.gateway.close()
@@ -306,7 +311,7 @@ export default class DB
306
311
  error.code = 'E_EVENTFLOW_DB_EVENT_READ_BY_PID'
307
312
  error.cause = reason
308
313
  throw error
309
- }
314
+ }
310
315
 
311
316
  return result
312
317
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superhero/eventflow-db",
3
- "version": "4.3.2",
3
+ "version": "4.3.5",
4
4
  "description": "Eventflow db is a set of common database logic in the eventflow ecosystem.",
5
5
  "keywords": [
6
6
  "eventflow"