@superhero/eventflow-db 4.7.16 → 4.7.18

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ---
2
+ #### v4.7.18
3
+ ---
4
+
5
+ exporting the default config
6
+
7
+ ---
8
+ #### v4.7.17
9
+ ---
10
+
11
+ added an sql query to read distinct pid by domain
12
+
1
13
  ---
2
14
  #### v4.7.16
3
15
  ---
package/config.js CHANGED
@@ -17,7 +17,6 @@ export default
17
17
  debug : process.env.EVENTFLOW_MYSQL_DEBUG ?? false,
18
18
  trace : process.env.EVENTFLOW_MYSQL_TRACE ?? true,
19
19
  decimalNumbers : process.env.EVENTFLOW_MYSQL_DECIMAL_NUMBERS ?? false,
20
- disableEval : process.env.EVENTFLOW_MYSQL_DISABLE_EVAL ?? true,
21
20
  bigNumberStrings : process.env.EVENTFLOW_MYSQL_BIG_NUMBER_STRINGS ?? false,
22
21
  supportBigNumbers : process.env.EVENTFLOW_MYSQL_SUPPORT_BIG_NUMBERS ?? false,
23
22
  insecureAuth : process.env.EVENTFLOW_MYSQL_INSECURE_AUTH ?? false,
package/index.js CHANGED
@@ -316,6 +316,25 @@ export default class DB
316
316
  return result
317
317
  }
318
318
 
319
+ async readDistinctPidByDomain(domain)
320
+ {
321
+ let result
322
+
323
+ try
324
+ {
325
+ result = await this.gateway.query('event/read-distinct-pid-by-domain', domain)
326
+ }
327
+ catch(reason)
328
+ {
329
+ const error = new Error(`could not read distinct pids by domain: ${domain}`)
330
+ error.code = 'E_EVENTFLOW_DB_EVENT_READ_DISTINCT_PID_BY_DOMAIN'
331
+ error.cause = reason
332
+ throw error
333
+ }
334
+
335
+ return result
336
+ }
337
+
319
338
  async persistEventCpid(event_id, domain, cpid)
320
339
  {
321
340
  try
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superhero/eventflow-db",
3
- "version": "4.7.16",
3
+ "version": "4.7.18",
4
4
  "description": "Eventflow db is a set of common database logic in the eventflow ecosystem.",
5
5
  "keywords": [
6
6
  "eventflow"
@@ -8,7 +8,8 @@
8
8
  "license": "MIT",
9
9
  "type": "module",
10
10
  "exports": {
11
- ".": "./index.js"
11
+ ".": "./index.js",
12
+ "./config": "./config.js"
12
13
  },
13
14
  "scripts": {
14
15
  "test-build": "docker ps -q -f name=eventflow-mysql | grep -q . && docker stop eventflow-mysql; docker run --rm --name eventflow-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=eventflow -p 3306:3306 --health-cmd=\"mysqladmin ping -h 127.0.0.1 -uroot -proot --silent || exit 1\" --health-interval=10s --health-timeout=5s --health-retries=5 -d mysql:latest; until [ \"$(docker inspect --format='{{.State.Health.Status}}' eventflow-mysql)\" == \"healthy\" ]; do sleep 1; done",
@@ -20,9 +21,9 @@
20
21
  "@superhero/db": "^0.5.2"
21
22
  },
22
23
  "devDependencies": {
23
- "@superhero/audit": "4.7.16",
24
+ "@superhero/audit": "4.7.18",
24
25
  "@superhero/syntax-check": "0.0.2",
25
- "@superhero/locator": "4.7.16"
26
+ "@superhero/locator": "4.7.18"
26
27
  },
27
28
  "author": {
28
29
  "name": "Erik Landvall",
@@ -0,0 +1,4 @@
1
+ SELECT DISTINCT pid
2
+ FROM event
3
+ WHERE domain = CAST(? AS CHAR CHARACTER SET ascii) COLLATE ascii_bin
4
+ ORDER BY pid ASC