Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DELETE without providing full primary key #421

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ramikg
Copy link
Contributor

@ramikg ramikg commented Apr 30, 2024

Overview

Given a table with primary key ((partition1), column1, column2), Cassandra and the Node.js have a different behavior.
This PR changes the driver to conform to Cassandra's behavior.

Cassandra behavior

Allows DELETE statements which specify:

  • All of the partition key columns.
  • Some or all of the clustering columns, under the following condition:
    • If a clustering column is specified, the all of the higher-level/preceding columns must also be specified.

DataStax Node.js driver behavior

Requires all of the primary key columns (i.e. partition key and clustering columns) to be specified.
Not providing all primary key columns will result in the following error:

Error: No table matches (all PKs have to be specified)

Note on code review

This PR also changes the ModelMapper tests to have more indicative column names.
To make the PR easier to review, this minor refactor was done in a separate commit.

@ramikg ramikg force-pushed the hotfix/support-remove-without-full-primary-key branch from 4c2081e to 966c0f7 Compare December 25, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant