You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document tracks the progress of refactoring the codebase to consistently use prepared statements instead of simple statements throughout tests and examples, with proper context manager usage.
5
+
6
+
## Problem Statement
7
+
- Tests and examples are inconsistently using SimpleStatements with %s placeholders vs PreparedStatements with ? placeholders
8
+
- This causes confusion and test failures
9
+
- Not following best practices for production code examples
10
+
- Missing proper context manager usage in many places
11
+
12
+
## Guidelines
13
+
1.**Always use PreparedStatements** in:
14
+
- All integration tests (except specific SimpleStatement test)
15
+
- All unit test examples
16
+
- FastAPI example application
17
+
- All documentation examples
18
+
19
+
2.**Use SimpleStatements only in**:
20
+
- One dedicated test to verify SimpleStatement support
21
+
- DDL operations (CREATE, ALTER, DROP)
22
+
- System queries where parameters aren't needed
23
+
24
+
3.**Always use context managers** for:
25
+
- Cluster connections
26
+
- Session connections
27
+
- Streaming operations
28
+
29
+
## Files to Update
30
+
31
+
### Integration Tests
32
+
-[x] test_empty_resultsets.py - FIXED (all tests now use prepared statements)
33
+
-[ ] test_lwt_operations.py - Need to check
34
+
-[ ] test_basic_operations.py - Need to check
35
+
-[ ] test_cassandra_data_types.py - Need to check
36
+
-[ ] test_concurrent_operations.py - Need to check
37
+
-[ ] test_context_manager_safety_integration.py - Need to check
38
+
-[ ] test_long_lived_connections.py - Need to check
39
+
-[ ] test_network_failures.py - Need to check
40
+
-[ ] test_select_operations.py - Need to check
41
+
-[ ] test_streaming_operations.py - Need to check
42
+
-[ ] test_stress.py - Need to check
43
+
44
+
### Unit Tests
45
+
-[ ] Review all unit tests for SimpleStatement usage
0 commit comments