Skip to content

delRow does not delete row from db storage #249

@jay-zahiri

Description

@jay-zahiri

saveTable in getCommandFunctions isn't deleting rows.

It seems like the current delete SQL is telling db to NOT delete the deleteRowIds. I'm not sure if I'm misunderstanding something since it's been like this since initial commit 😬 but removing NOT resulted in what I would expect when calling delRow, i.e. delete the actual row in Postgres as well.

src/persisters/common/database/commands.ts#L287

// Delete rows
await databaseExecuteCommand(
  DELETE_FROM +
  escapeId(tableName) +
  getWhereCondition(tableName, condition) +
  // eslint-disable-next-line max-len
  `AND${escapeId(rowIdColumnName)}👉NOT👈 IN(${getPlaceholders(deleteRowIds)})`,
  deleteRowIds,
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions