Каким-то образом моя среда sails.js 1.x стала поврежденной до такой степени, что я больше не могу делать собственные запросы к моей базе данных PostgreSQL. Я уверен, что проблема заключается в версии какого-либо пакета, потому что в течение выходных я экспериментировал с NodeJS 9, но этот код работал в пятницу, и я не вижу, чтобы найти проблему. Есть предложения?
sails> sails.getDatastore().sendNativeQuery('SELECT COUNT(*) FROM "user"').then(console.log);
Promise {
_bitField: 0,
_fulfillmentHandler0: undefined,
_rejectionHandler0: undefined,
_promise0: undefined,
_receiver0: undefined }
sails> UsageError: Sorry, this function doesn't know how to handle {...} callbacks.
If provided, the 2nd argument should be a function like `function(err,result){...}`
| If you passed in {...} on purpose as a "switchback" (dictionary of callbacks),
| please be aware that, as of machine v15, you can no longer pass in a switchback
| as the 2nd argument. And you can't pass a switchback in to .exec() anymore either.
| Instead, you'll need to explicitly call .switch().
[?] See https://sailsjs.com/support for help.
at /Users/patrick/src/healthcelerate/hc-registry/node_modules/sails-hook-orm/lib/datastore-method-utils/private/do-with-connection.js:133:24
at _makeCallToDuringFn (/Users/patrick/src/healthcelerate/hc-registry/node_modules/sails-hook-orm/lib/datastore-method-utils/private/do-with-connection.js:101:28)
at /Users/patrick/src/healthcelerate/hc-registry/node_modules/sails-hook-orm/lib/datastore-method-utils/private/do-with-connection.js:103:7
at /Users/patrick/src/healthcelerate/hc-registry/node_modules/sails-hook-orm/lib/datastore-method-utils/private/do-with-connection.js:66:14
at /Users/patrick/src/healthcelerate/hc-registry/node_modules/machinepack-postgresql/node_modules/machine/lib/private/help-build-machine.js:966:24
at Function.handlerCbs.success (/Users/patrick/src/healthcelerate/hc-registry/node_modules/machinepack-postgresql/node_modules/machine/lib/private/help-build-machine.js:826:26)
at cb (/Users/patrick/src/healthcelerate/hc-registry/node_modules/machinepack-postgresql/machines/get-connection.js:87:20)
at BoundPool.<anonymous> (/Users/patrick/src/healthcelerate/hc-registry/node_modules/pg-pool/index.js:137:9)
at bound (domain.js:301:14)
at runBound (domain.js:314:12)
at /Users/patrick/src/healthcelerate/hc-registry/node_modules/generic-pool/lib/generic-pool.js:347:9
at BoundPool.<anonymous> (/Users/patrick/src/healthcelerate/hc-registry/node_modules/pg-pool/index.js:103:7)
at Connection.<anonymous> (/Users/patrick/src/healthcelerate/hc-registry/node_modules/pg/lib/client.js:158:7)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:121:20)
at Connection.emit (events.js:211:7)
at Socket.<anonymous> (/Users/patrick/src/healthcelerate/hc-registry/node_modules/pg/lib/connection.js:121:12)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:607:20)
sails>
Любые советы или идеи будут очень ценными.