Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query

See original GitHub issue

I get this bug all the time. It’s a nightmare to debug.

It’d be really helpful if wherever this error is coming from, some information on what table/column/etc was being modified, and what the bad data is.

Error: Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query.
             at QueryCompiler_PG._prepUpdate (/Users/seph/Code/RSLTS/api/node_modules/knex/lib/query/compiler.js:814:13)
             at QueryCompiler_PG.update (/Users/seph/Code/RSLTS/api/node_modules/knex/lib/dialects/postgres/query/compiler.js:39:29)
             at QueryCompiler_PG.toSQL (/Users/seph/Code/RSLTS/api/node_modules/knex/lib/query/compiler.js:64:29)
             at Builder.toSQL (/Users/seph/Code/RSLTS/api/node_modules/knex/lib/query/builder.js:76:44)
             at /Users/seph/Code/RSLTS/api/node_modules/knex/lib/runner.js:30:36
         From previous event:
             at Runner.run (/Users/seph/Code/RSLTS/api/node_modules/knex/lib/runner.js:25:16)
             at Builder.Target.then (/Users/seph/Code/RSLTS/api/node_modules/knex/lib/interface.js:14:43)
             at _findOrGet.then.results (/Users/seph/Code/RSLTS/api/node_modules/feathers-knex/lib/index.js:275:29)
             at processImmediate (timers.js:638:19)
         From previous event:
             at Object._patch (/Users/seph/Code/RSLTS/api/node_modules/feathers-knex/lib/index.js:265:9)
             at callMethod (/Users/seph/Code/RSLTS/api/node_modules/@feathersjs/adapter-commons/src/service.ts:10:20)
             at Object.patch (/Users/seph/Code/RSLTS/api/node_modules/@feathersjs/adapter-commons/src/service.ts:120:12)
             at processHooks.call.then.hookObject (/Users/seph/Code/RSLTS/api/node_modules/@feathersjs/feathers/lib/hooks/index.js:56:27) },

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kibertoadcommented, Dec 28, 2019

Released in 0.20.5

0reactions
martinblosteincommented, May 28, 2020

Your workaround will insert nulls into the database if those fields are not populated. I’m not sure if that was the intention of your original query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mysql - knex.js - simpler way to update data - Stack Overflow
A good example for you would be this db("table") .update({deleted_at: "now()"}) .where("column", "value");. if you want more information ...
Read more >
Dropdown value to database - How To - Wappler Community
message: "Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query.
Read more >
Updating a record with Knex in a REST API
update() method takes changes as its argument and behaves like the regular SQL UPDATE statement: it updates the record with the changes passed ......
Read more >
tgriesser/knex - Gitter
trying update({column:undefined}) gave 'empty update detected' - and using update({column:knex.raw('NULL')}) gave a pg-native error - this can't be that hard...
Read more >
Updating records with AFTER business rules - ServiceNow
Solved: Hi, all For a while now, I have been going through some of my company's SN configuration and coding to review some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found