sequelize / sequelize/sequelize

instance.destroy(...) does not return any information if rows has been deleted or not

Open
#4,124 36 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
30.4k
Forks
4.3k
Avg merge
1d 6h
Merged PRs (30d)
68

Description

using Sequelize 3.3.2

var user = User.build({ id: 1 }, { isNewRecord: false })
user.destroy()
.then(function(){
  console.log(arguments)
})

Code above always prints { '0': [] } no matter if row has been deleted or not. I am not sure if this is intentional, but it would useful to know that... Also returning option could be very useful (postgres) as I've mentioned in #4122

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the instance.destroy() entry point shown in the reproduction and compare behavior when the row exists versus when it has already been deleted. Review the related returning discussion in #4122, then define completion as exposing distinguishable deletion information and clarify whether PostgreSQL returning support is part of this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, sql
Domain
backend, database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.