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
-`connection.rs` - Connection lifecycle, establishment, and state management
16
16
-`query.rs` - Basic query execution and result handling
@@ -38,6 +38,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
38
38
39
39
### Fixed
40
40
41
+
-**Critical Rust NIF Thread Safety and Scheduler Issues**
42
+
-**Registry Lock Management**: Fixed all functions to drop registry locks before entering `TOKIO_RUNTIME.block_on()` async blocks
43
+
-`execute_batch()` and `execute_transactional_batch()` in `batch.rs`: Simplified function signatures, dropped `conn_map` lock before async operations
44
+
-`declare_cursor()` in `cursor.rs`: Dropped `conn_map` lock before async block
45
+
-`do_sync()` in `query.rs`: Dropped `conn_map` lock before async block
46
+
-`savepoint()`, `release_savepoint()`, and `rollback_to_savepoint()` in `savepoint.rs`: Now use `TransactionEntryGuard` pattern to avoid holding `TXN_REGISTRY` lock during async operations
47
+
-`prepare_statement()` in `statement.rs`: Now clones inner connection Arc and drops client lock before async block, preventing locks from being held across await points
48
+
-`begin_transaction()` and `begin_transaction_with_behavior()` in `transaction.rs`: Now clone inner connection Arc and drop all locks before async transaction creation, preventing locks from being held across await points
49
+
-**DirtyIo Scheduler Annotations**: Added `#[rustler::nif(schedule = "DirtyIo")]` to blocking NIFs
50
+
-`last_insert_rowid()`, `changes()`, and `is_autocommit()` in `metadata.rs`
51
+
- Prevents blocking the BEAM scheduler during I/O operations
52
+
-**Atom Naming Consistency**: Renamed `remote_primary` atom to `remote` in `constants.rs` and `decode.rs`
53
+
- Fixes mismatch between Rust atom (`remote_primary()`) and Elixir convention (`:remote`)
54
+
-`decode_mode()` now correctly decodes `:remote` atoms from Elixir
55
+
-**Binary Allocation Error Handling**: Return `:error` atom instead of `nil` when binary allocation fails
56
+
- Updated `cursor.rs` and `utils.rs` to use `:error` atom for `OwnedBinary::new()` allocation failures
57
+
- Provides clearer indication of allocation errors in query results
58
+
-**SQL Identifier Quoting**: Added proper quoting for SQLite identifiers in PRAGMA queries (`utils.rs`)
59
+
- Table and index names are now properly quoted with double quotes
60
+
- Internal double quotes are escaped by doubling them
61
+
- Defensive programming against potential edge cases with special characters in identifiers
62
+
-**Performance Optimizations**:
63
+
-**Replication**: `max_write_replication_index()` in `replication.rs` now calls synchronous method directly instead of wrapping in `TOKIO_RUNTIME.block_on()`
64
+
- Eliminates unnecessary async overhead for synchronous operations
65
+
-**Connection**: `connect()` in `connection.rs` now uses shared global `TOKIO_RUNTIME` instead of creating a new runtime per connection
66
+
- Prevents resource exhaustion under high connection rates
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1141,7 +1141,7 @@ When working on this codebase:
1141
1141
1142
1142
## Summary
1143
1143
1144
-
EctoLibSql is a production-ready Ecto adapter for LibSQL/Turso with full Ecto support, three connection modes, advanced features (vector search, encryption, streaming), zero panic risk, lots of tests, and comprehensive documentation.
1144
+
EctoLibSql is a production-ready Ecto adapter for LibSQL/Turso with full Ecto support, three connection modes, advanced features (vector search, encryption, streaming), zero panic risk, extensive test coverage, and comprehensive documentation.
1145
1145
1146
1146
**Key Principle**: Safety first. All Rust code uses proper error handling to protect the BEAM VM. Errors are returned as tuples that can be supervised gracefully.
0 commit comments