nodejs-driver
nodejs-driver copied to clipboard
Support `DELETE` without providing full primary key
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.
Are there any news about this PR?