Skip to content

Add functionalities#10

Merged
rohaquinlop merged 12 commits into
mainfrom
add-functionalities
Sep 24, 2025
Merged

Add functionalities#10
rohaquinlop merged 12 commits into
mainfrom
add-functionalities

Conversation

@rohaquinlop
Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and refactors to the mock ScyllaDB implementation, focusing on more robust parsing and handling of primary keys, clustering orders, and lightweight transaction (LWT) conditions. It also enhances the parsing of CQL statements and improves the accuracy of table metadata representation. The most significant changes are grouped below:

Primary Key and Clustering Order Handling:

  • Refactored the parsing and storage of primary key information to distinguish between partition and clustering keys, supporting both inline and composite definitions. Added support for storing and utilizing clustering order information for columns, and ensured this metadata is reflected in both table and column representations (mockylla/parser/create.py, mockylla/classes/metadata.py, mockylla/classes/state.py).

CQL Statement Parsing Improvements:

  • Improved regular expressions for parsing CREATE TABLE, INSERT, SELECT, UPDATE, and DELETE statements to better support CQL syntax, including optional clauses and more flexible LIMIT expressions (mockylla/parser/__init__.py).

Lightweight Transaction (LWT) and Conditional Deletes:

  • Refactored the DELETE statement handler to support conditional deletes using LWT (IF, IF EXISTS, IF NOT EXISTS), including proper result row generation and integration with materialized view rebuilding (mockylla/parser/delete.py).

Expired Row Purging:

  • Added logic to purge expired rows from tables before returning data, ensuring returned results are up-to-date with TTL semantics (mockylla/classes/state.py).

Code Structure and Utility Improvements:

  • Introduced utility functions for splitting and parsing CQL components, and reorganized code for clarity and maintainability, such as extracting top-level comma splits and normalizing WHERE clauses with parameters (mockylla/parser/create.py, mockylla/parser/delete.py).

These changes collectively improve the accuracy, maintainability, and feature completeness of the mock ScyllaDB engine, especially around schema handling and query parsing.

…nd validation; add tests for COUNT, SUM, and error scenarios.
…ry parsing; refactor tests to include new scenarios.
…auses; implement COUNT(DISTINCT) and AVG functions; refactor tests to cover new scenarios.
…ove WHERE clause substitution, and add support for HAVING conditions; implement distinct clause extraction and validation for aggregates.
…data classes, improve CREATE TABLE parsing to support composite keys and clustering orders, and add tests for composite primary key metadata.
…, select, and delete operations; add tests for TTL expiration and timestamp precedence.
…rations to support IF conditions; add tests for conditional inserts, updates, and deletes.
…ews in INSERT, UPDATE, and DELETE operations; add tests for materialized view consistency across data modifications.
… operations with improved condition checks, row management, and TTL support; add tests for TTL and writetime functions in SELECT queries.
@rohaquinlop rohaquinlop merged commit 0f6a824 into main Sep 24, 2025
16 checks passed
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