@platformatic/sql-events 0.7.0 → 0.8.0

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 (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -21,7 +21,12 @@ function setupEmitter ({ log, mq, mapper, connectionString }) {
21
21
 
22
22
  for (const entityName of Object.keys(mapper.entities)) {
23
23
  const entity = mapper.entities[entityName]
24
- const { primaryKey } = entity
24
+ // Skip entities with composite primary keys
25
+ /* istanbul ignore next */
26
+ if (entity.primaryKeys.size !== 1) {
27
+ continue
28
+ }
29
+ const primaryKey = entity.primaryKeys.values().next().value
25
30
  mapper.addEntityHooks(entityName, {
26
31
  async save (original, data) {
27
32
  const ctx = data.ctx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/sql-events",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Emit events via MQEmitter",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "homepage": "https://github.com/platformatic/platformatic#readme",
16
16
  "devDependencies": {
17
- "@platformatic/sql-mapper": "0.7.0",
17
+ "@platformatic/sql-mapper": "0.8.0",
18
18
  "fastify": "^4.6.0",
19
19
  "ioredis": "^5.2.3",
20
20
  "snazzy": "^9.0.0",