@superhero/eventflow-db 4.7.16 → 4.7.17

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,9 @@
1
+ ---
2
+ #### v4.7.17
3
+ ---
4
+
5
+ added an sql query to read distinct pid by domain
6
+
1
7
  ---
2
8
  #### v4.7.16
3
9
  ---
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.17",
4
4
  "description": "Eventflow db is a set of common database logic in the eventflow ecosystem.",
5
5
  "keywords": [
6
6
  "eventflow"
@@ -20,9 +20,9 @@
20
20
  "@superhero/db": "^0.5.2"
21
21
  },
22
22
  "devDependencies": {
23
- "@superhero/audit": "4.7.16",
23
+ "@superhero/audit": "4.7.17",
24
24
  "@superhero/syntax-check": "0.0.2",
25
- "@superhero/locator": "4.7.16"
25
+ "@superhero/locator": "4.7.17"
26
26
  },
27
27
  "author": {
28
28
  "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