Fix: wrong bind on db.taskEx
This commit is contained in:
parent
440b8e7f61
commit
178f2dafde
2 changed files with 3 additions and 5 deletions
|
|
@ -12,13 +12,11 @@ const pgp = Pgp({
|
|||
obj.taskEx = function () {
|
||||
const args = pgp.utils.taskArgs(arguments)
|
||||
const { schema } = args.options
|
||||
if ('schema' in args.options) {
|
||||
delete args.options.schema
|
||||
}
|
||||
if (schema) {
|
||||
return obj.task.call(this, args.options, t => {
|
||||
return t.none('SET search_path to $1:name', [schema])
|
||||
.then(args.cb.bind(this, t))
|
||||
.then(args.cb.bind(t, t))
|
||||
})
|
||||
}
|
||||
return Promise.reject(new Error('No schema selected, cannot complete query'))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
const getSchema = () => 'public'
|
||||
|
||||
const getDefaultSchema = () => 'public2'
|
||||
const getDefaultSchema = () => 'public'
|
||||
|
||||
const any = (obj, query, variables) => {
|
||||
const schema = getSchema()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue