Overview:
This issue outlines the need for the implementation of the Query
class within our ScyllaDB driver, focusing exclusively on enabling simple queries as per the Scylla Rust Driver documentation. This initial implementation will serve as the foundation for executing basic CQL commands, with more complex query capabilities to be added in subsequent enhancements.
Detailed Behavior:
The primary objective is to provide users with the ability to perform simple CQL queries against their ScyllaDB instances. The Query
class should encapsulate the logic required to construct and execute these queries. Once this class is implemented, the session
object's query
method should be able to accept a CQL query string, send it to the ScyllaDB cluster, and handle the response appropriately.
Here's a conceptual example of how the query
method might be used with the Query
class:
import { Cluster, Query } from "@lambda-group/scylladb";
const cluster = new Cluster({ nodes: ["127.0.0.1:9042"] });
const session = await cluster.connect("keyspace");
const query = new Query("SELECT * FROM my_table WHERE id = ?", [1]);
const result = await session.query(query);
Scope Limitation:
It's important to note that this issue strictly pertains to the simplest use case of the Query
class. Features like prepared statements, batch queries, and paginated queries are out of scope for this specific task and will be addressed in future issues.
Implementation Considerations:
- The
Query
class should be designed with extensibility in mind, as additional functionality will be added in the future.
- Proper error handling should be implemented to address scenarios like invalid CQL syntax, issues with the connection to the database, and server-side errors returned by ScyllaDB.
- The result set returned by the
query
method should be in a format that's easy to use and understand from a developer's perspective.
Related Issues or Discussions:
- This is a standalone issue, but it lays the groundwork for future enhancements to the
Query
class.
Assignees and Mentions:
- Contributors with experience in Node.js and familiarity with ScyllaDB or CQL should be considered for assignment. They can be '@' mentioned or assigned directly.
Impact:
- This basic implementation of the
Query
class is a critical step towards a fully functional ScyllaDB driver. It will enable developers to execute CQL commands from their applications using the driver.
Progress/Updates:
- This issue marks the beginning of this feature. Updates on development progress, including discussions, decisions made, code reviews, and phases of implementation, will be documented in this thread.
Contributors should also ensure that this feature is accompanied by appropriate unit tests to verify correct functionality and by updated documentation that explains how to perform simple queries using the new Query
class.