@platformatic/db-core 2.72.0 → 3.0.0-alpha.1

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 +18 -14
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -3,24 +3,28 @@
3
3
  const fp = require('fastify-plugin')
4
4
  const sqlMapper = require('@platformatic/sql-mapper')
5
5
 
6
- const defaults = [{
7
- module: '@platformatic/sql-events',
8
- configKey: 'events',
9
- }, {
10
- module: '@platformatic/sql-graphql',
11
- configKey: 'graphql',
12
- }, {
13
- module: '@platformatic/sql-openapi',
14
- configKey: 'openapi',
15
- }]
6
+ const defaults = [
7
+ {
8
+ module: '@platformatic/sql-events',
9
+ configKey: 'events'
10
+ },
11
+ {
12
+ module: '@platformatic/sql-graphql',
13
+ configKey: 'graphql'
14
+ },
15
+ {
16
+ module: '@platformatic/sql-openapi',
17
+ configKey: 'openapi'
18
+ }
19
+ ]
16
20
 
17
21
  module.exports = fp(async function (app, opts) {
18
- app.register(sqlMapper, {
19
- ...opts,
22
+ await app.register(sqlMapper, {
23
+ ...opts
20
24
  })
21
25
 
22
26
  for (const obj of defaults) {
23
- registerAndConfig(obj)
27
+ await registerAndConfig(obj)
24
28
  }
25
29
 
26
30
  function registerAndConfig ({ module, configKey }) {
@@ -28,7 +32,7 @@ module.exports = fp(async function (app, opts) {
28
32
  const sqlModule = require(module)
29
33
  const config = typeof opts[configKey] === 'object' ? opts[configKey] : {}
30
34
  return app.register(sqlModule, {
31
- ...config,
35
+ ...config
32
36
  })
33
37
  }
34
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/db-core",
3
- "version": "2.72.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "fastify-plugin": "^5.0.0",
26
- "@platformatic/sql-events": "2.72.0",
27
- "@platformatic/sql-graphql": "2.72.0",
28
- "@platformatic/sql-openapi": "2.72.0",
29
- "@platformatic/sql-mapper": "2.72.0"
26
+ "@platformatic/sql-events": "3.0.0-alpha.1",
27
+ "@platformatic/sql-mapper": "3.0.0-alpha.1",
28
+ "@platformatic/sql-graphql": "3.0.0-alpha.1",
29
+ "@platformatic/sql-openapi": "3.0.0-alpha.1"
30
30
  },
31
31
  "scripts": {
32
32
  "test": "pnpm run lint && borp",