-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Clean up SQLite WAL files in test teardown #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add cleanup for -shm and -wal files in test teardown callbacks to prevent leftover SQLite WAL mode files between test runs.
WalkthroughThis PR removes two documentation files, updates one issue's status in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/ecto_libsql_test.exs (1)
497-497: Suggest adding WAL file cleanup for encrypted databases.For consistency with the PR objective and the cleanup patterns added elsewhere in this file, consider also removing -shm and -wal files for the encrypted database files. The same applies to the cleanup at lines 540, 604, and 670.
🔎 Proposed additions for consistent cleanup
For line 497:
# Clean up File.rm("z_ecto_libsql_test-encrypted.db") +File.rm("z_ecto_libsql_test-encrypted.db-shm") +File.rm("z_ecto_libsql_test-encrypted.db-wal")For line 540:
# Clean up File.rm("z_ecto_libsql_test-encrypted2.db") +File.rm("z_ecto_libsql_test-encrypted2.db-shm") +File.rm("z_ecto_libsql_test-encrypted2.db-wal")For line 604:
# Clean up File.rm("z_ecto_libsql_test-encrypted3.db") +File.rm("z_ecto_libsql_test-encrypted3.db-shm") +File.rm("z_ecto_libsql_test-encrypted3.db-wal")For line 670:
# Clean up File.rm("z_ecto_libsql_test-encrypted4.db") +File.rm("z_ecto_libsql_test-encrypted4.db-shm") +File.rm("z_ecto_libsql_test-encrypted4.db-wal")
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
mix.lockis excluded by!**/*.lock
📒 Files selected for processing (19)
.beads/issues.jsonlFEATURE_ANALYSIS_SUMMARY.mdecto_libsql_development_guide.mdtest/advanced_features_test.exstest/batch_features_test.exstest/connection_features_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/ecto_libsql_test.exstest/ecto_migration_test.exstest/ecto_sql_compatibility_test.exstest/fuzz_test.exstest/pragma_test.exstest/prepared_statement_test.exstest/savepoint_test.exstest/security_test.exstest/statement_features_test.exstest/statement_ownership_test.exstest/stmt_caching_benchmark_test.exs
💤 Files with no reviewable changes (2)
- ecto_libsql_development_guide.md
- FEATURE_ANALYSIS_SUMMARY.md
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ex,exs,rs,md}
📄 CodeRabbit inference engine (CLAUDE.md)
ALWAYS use British/Australian English spelling and grammar for code, comments, and documentation, except where required for function calls, SQL keywords, error messages, or compatibility with external systems that may use US English
Files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
**/*.{ex,exs}
📄 CodeRabbit inference engine (CLAUDE.md)
ALWAYS run the Elixir formatter (
mix format --check-formatted) before committing changes and fix any issues
**/*.{ex,exs}: For Ecto schema definitions in Elixir, useEcto.SchemaandEcto.Changesetmodules to define data models with proper validation and type annotations
Use prepared statements with automatic caching for repeated queries in ecto_libsql to achieve ~10-15x performance improvement; statements are cached internally and bindings are cleared via stmt.reset() between calls
For bulk insert operations in ecto_libsql, use batch_transactional/2 to group multiple inserts into a single atomic transaction, providing better performance than individual inserts
Always use pattern matching for database operation results in ecto_libsql to handle both success and error cases; never use bare unwrap patterns that could crash the VM
For read-heavy workloads with ecto_libsql, use remote replica mode (libsql:// URI with local database file and sync: true) to achieve microsecond read latency from local SQLite while auto-syncing writes to remote Turso
Use vector embeddings with ecto_libsql for semantic search by creating vector columns with EctoLibSql.Native.vector_type/2, storing embeddings via vector() SQL function, and querying with vector_distance_cos/2 for cosine distance calculation
For transaction handling in ecto_libsql, use transaction behaviours (DEFERRED, IMMEDIATE, EXCLUSIVE, READ_ONLY) to control lock acquisition; use IMMEDIATE for write-heavy workloads to prevent writer starvation
Use savepoints (create_savepoint, release_savepoint_by_name, rollback_to_savepoint_by_name) within transactions for partial rollback and error recovery, particularly in batch import scenarios
For large result set processing in ecto_libsql, use DBConnection.stream/3 with cursor-based streaming instead of loading all rows into memory; configure batch size with max_rows option
Use EctoLibSql.Pragma module to configure SQLite parameters: enable_foreign_keys/1, set_journal_mode/2 (p...
Files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
test/**/*.exs
📄 CodeRabbit inference engine (CLAUDE.md)
test/**/*.exs: Add tests for all new features in appropriate Elixir test files (test/ecto_*_test.exs) and Rust test modules (native/ecto_libsql/src/tests/), covering happy path, error cases, edge cases, and type conversions
Add comprehensive tests for unsupported functions asserting that they always return {:error, :unsupported} and that they don't modify database state or corrupt connections
Files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
test/**/*.{ex,exs}
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*.{ex,exs}: For testing, use fixtures or factories (e.g., ExMachina) to create test data in a predictable, maintainable way rather than hardcoding test data
Document and test all database edge cases: NULL handling, type coercions, constraint violations, and concurrent modifications
Files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
test/**/*migration*test.exs
📄 CodeRabbit inference engine (CLAUDE.md)
For SQLite migrations that require column type changes or drops (which SQLite doesn't support via ALTER), use the table recreation pattern: create new table, copy data with transformations, swap tables, and recreate indexes
Files:
test/ecto_migration_test.exs
🧠 Learnings (32)
📓 Common learnings
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to lib/ecto/adapters/libsql.ex : When implementing Ecto storage operations (create, drop, status) in lib/ecto/adapters/libsql.ex, ensure they properly handle both local SQLite and remote Turso databases via the connection mode in EctoLibSql.State
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use EctoLibSql.Pragma module to configure SQLite parameters: enable_foreign_keys/1, set_journal_mode/2 (preferably WAL), set_cache_size/2, set_synchronous/2, and user_version/1 for schema versioning
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Always clean up prepared statement resources by calling EctoLibSql.Native.close_stmt/1 when statements are no longer needed
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/pragma_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_integration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use prepared statements with automatic caching for repeated queries in ecto_libsql to achieve ~10-15x performance improvement; statements are cached internally and bindings are cleared via stmt.reset() between calls
Applied to files:
test/stmt_caching_benchmark_test.exstest/statement_ownership_test.exstest/prepared_statement_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/**/*.exs : Add comprehensive tests for unsupported functions asserting that they always return {:error, :unsupported} and that they don't modify database state or corrupt connections
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs.beads/issues.jsonl
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to test/**/*.{ex,exs} : Document and test all database edge cases: NULL handling, type coercions, constraint violations, and concurrent modifications
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs.beads/issues.jsonl
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to lib/**/*.ex : When working with database locks, use transactions with proper timeout configuration, ensure connections are properly closed in try-after blocks, and use immediate/exclusive transaction behaviours for write-heavy workloads to minimise lock contention
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/pragma_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Implement supervision tree for database workers to handle connection lifecycle and enable automatic restart on connection failure
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: When debugging failing tests, run with trace (`mix test file.exs --trace`), verify NIF compilation (`File.exists?("priv/native/ecto_libsql.so")`), check Rust output with `cargo test -- --nocapture`, and run Rust tests independently to isolate issues
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Always handle database connection errors gracefully by pattern matching on {:ok, state} and {:error, reason} tuples; use supervision trees to manage connection lifecycle
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/**/*migration*test.exs : For SQLite migrations that require column type changes or drops (which SQLite doesn't support via ALTER), use the table recreation pattern: create new table, copy data with transformations, swap tables, and recreate indexes
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to native/ecto_libsql/src/!(tests)/**/*.rs : In Rust async blocks within NIFs, drop registry locks before entering the `TOKIO_RUNTIME.block_on(async { ... })` call to prevent deadlocks, then re-acquire locks if needed after the async block completes
Applied to files:
test/stmt_caching_benchmark_test.exstest/savepoint_test.exstest/statement_ownership_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/ecto_migration_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to lib/ecto_libsql/native.ex : For each new Rust NIF function, add corresponding Elixir NIF stubs and safe wrapper functions in lib/ecto_libsql/native.ex, with proper state management via EctoLibSql.State
Applied to files:
test/stmt_caching_benchmark_test.exstest/savepoint_test.exstest/pragma_test.exstest/prepared_statement_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use Repo.transaction/1 with with/1 clauses to handle multiple database operations atomically and rollback on error
Applied to files:
test/stmt_caching_benchmark_test.exstest/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to lib/ecto/adapters/libsql.ex : When implementing Ecto storage operations (create, drop, status) in lib/ecto/adapters/libsql.ex, ensure they properly handle both local SQLite and remote Turso databases via the connection mode in EctoLibSql.State
Applied to files:
test/stmt_caching_benchmark_test.exstest/savepoint_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/**/*.exs : Add tests for all new features in appropriate Elixir test files (test/ecto_*_test.exs) and Rust test modules (native/ecto_libsql/src/tests/), covering happy path, error cases, edge cases, and type conversions
Applied to files:
test/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/advanced_features_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs.beads/issues.jsonl
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to config/test.exs : Configure Repo in test environment to use in-memory or separate test database; avoid sharing production database with tests
Applied to files:
test/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/advanced_features_test.exstest/pragma_test.exstest/ecto_sql_compatibility_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/turso_remote_test.exs : For Turso remote tests, use environment variables TURSO_DB_URI and TURSO_AUTH_TOKEN, loading them from .env.local file before running tests; remote tests should be skipped by default if credentials are missing
Applied to files:
test/connection_features_test.exstest/ecto_libsql_test.exstest/ecto_adapter_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to config/**/*.{exs,ex} : For ecto_libsql, use local mode (database: "file.db") for development and testing; use remote replica mode for production
Applied to files:
test/connection_features_test.exstest/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/advanced_features_test.exstest/pragma_test.exstest/ecto_sql_compatibility_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to priv/repo/migrations/*.{ex,exs} : When migrating from standard SQLite to libSQL with ALTER COLUMN, understand that changes only affect new/updated rows; use table recreation pattern on standard SQLite if full revalidation is needed
Applied to files:
test/savepoint_test.exstest/batch_features_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_migration_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to native/ecto_libsql/src/!(tests)/**/*.rs : In Rust, all non-test code must have no `.unwrap()` calls; this was a critical refactoring in v0.5.0 to eliminate 146 unwrap calls and prevent BEAM VM crashes from panics in native code
Applied to files:
test/savepoint_test.exstest/ecto_libsql_test.exstest/statement_ownership_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/ecto_sql_compatibility_test.exstest/prepared_statement_test.exstest/ecto_adapter_test.exstest/ecto_integration_test.exstest/fuzz_test.exstest/ecto_migration_test.exstest/statement_features_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use savepoints (create_savepoint, release_savepoint_by_name, rollback_to_savepoint_by_name) within transactions for partial rollback and error recovery, particularly in batch import scenarios
Applied to files:
test/savepoint_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : For read-heavy workloads with ecto_libsql, use remote replica mode (libsql:// URI with local database file and sync: true) to achieve microsecond read latency from local SQLite while auto-syncing writes to remote Turso
Applied to files:
test/batch_features_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use EctoLibSql.Pragma module to configure SQLite parameters: enable_foreign_keys/1, set_journal_mode/2 (preferably WAL), set_cache_size/2, set_synchronous/2, and user_version/1 for schema versioning
Applied to files:
test/ecto_libsql_test.exstest/advanced_features_test.exstest/pragma_test.exstest/security_test.exstest/prepared_statement_test.exstest/ecto_integration_test.exstest/ecto_migration_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to priv/repo/migrations/*.{ex,exs} : In Ecto migrations with ecto_libsql, use ALTER COLUMN to modify column attributes (type, NOT NULL, DEFAULT, CHECK, REFERENCES); note that changes only apply to new/updated rows and existing data is not revalidated
Applied to files:
test/ecto_libsql_test.exstest/ecto_migration_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Store encryption keys in environment variables or secret management services, not hardcoded; use at least 32-character encryption keys for database encryption with ecto_libsql
Applied to files:
test/security_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Always use pattern matching for database operation results in ecto_libsql to handle both success and error cases; never use bare unwrap patterns that could crash the VM
Applied to files:
test/ecto_sql_compatibility_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to native/ecto_libsql/src/tests/**/*.rs : In Rust test modules (marked with `#[cfg(test)]`), `.unwrap()` is permitted for simplicity, but production code must never use it
Applied to files:
test/ecto_adapter_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to native/ecto_libsql/src/!(tests)/**/*.rs : In Rust, use the `safe_lock(®ISTRY, "context_description")` helper function instead of directly calling `.lock().unwrap()` on Mutex types to safely acquire locks with proper error handling
Applied to files:
test/ecto_adapter_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to test/**/*.{ex,exs} : For testing, use fixtures or factories (e.g., ExMachina) to create test data in a predictable, maintainable way rather than hardcoding test data
Applied to files:
test/ecto_integration_test.exstest/fuzz_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to priv/repo/migrations/*.{ex,exs} : Document RANDOM ROWID usage in migrations as a libSQL extension not available in standard SQLite; note that it is mutually exclusive with WITHOUT ROWID and AUTOINCREMENT
Applied to files:
test/ecto_migration_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to priv/repo/migrations/*.{ex,exs} : Use foreign key constraints in migrations with references/2 and on_delete options (delete_all, nilify_all) to maintain referential integrity
Applied to files:
test/ecto_migration_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to native/ecto_libsql/src/!(tests)/**/*.rs : When adding a new NIF function in Rust, place it in the appropriate module based on functionality: connection.rs (lifecycle), query.rs (execution), transaction.rs (transactions), batch.rs (batch operations), statement.rs (prepared statements), cursor.rs (streaming), replication.rs (replica sync), metadata.rs (metadata access), or savepoint.rs (nested transactions)
Applied to files:
.beads/issues.jsonl
🧬 Code graph analysis (5)
test/stmt_caching_benchmark_test.exs (1)
test/turso_remote_test.exs (1)
defp cleanup_local_db(db_path) do(35-41)
test/connection_features_test.exs (1)
test/turso_remote_test.exs (1)
defp cleanup_local_db(db_path) do(35-41)
test/savepoint_test.exs (2)
test/turso_remote_test.exs (1)
defp cleanup_local_db(db_path) do(35-41)native/ecto_libsql/src/tests/integration_tests.rs (1)
cleanup_test_db(18-20)
test/batch_features_test.exs (1)
test/turso_remote_test.exs (1)
defp cleanup_local_db(db_path) do(35-41)
test/statement_ownership_test.exs (1)
test/turso_remote_test.exs (1)
defp cleanup_local_db(db_path) do(35-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Elixir 1.18.0 / OTP 27.0 / ubuntu-latest
- GitHub Check: Elixir 1.18.0 / OTP 27.0 / macos-latest
- GitHub Check: Analyze (rust)
🔇 Additional comments (13)
test/pragma_test.exs (1)
14-15: LGTM! Proper WAL file cleanup added.The addition of
-shmand-walfile cleanup correctly addresses SQLite Write-Ahead Logging artefacts left after tests. UsingFile.rm/1without explicit error handling is acceptable in test teardown, as it returns{:error, :enoent}for non-existent files without raising.test/stmt_caching_benchmark_test.exs (1)
29-30: Consistent WAL cleanup pattern completed across test suite.This completes the systematic addition of SQLite WAL artefact cleanup across all test files in the PR. The consistent pattern of removing
-shmand-walfiles after test execution ensures no auxiliary database files are left behind between test runs.test/prepared_statement_test.exs (1)
33-34: LGTM! Proper cleanup of SQLite auxiliary files.The addition of WAL (Write-Ahead Log) and SHM (Shared Memory) file cleanup is correct and ensures no leftover ancillary files remain after tests. The use of
File.rm/1(which silently ignores errors if files don't exist) is appropriate for best-effort cleanup operations.test/batch_features_test.exs (1)
17-18: LGTM! Consistent cleanup pattern applied.The WAL and SHM file cleanup follows the same pattern used across the test suite, ensuring complete teardown of SQLite database artifacts.
test/savepoint_test.exs (1)
39-40: LGTM! Complete test database cleanup.Properly extends teardown to remove SQLite WAL and SHM files, preventing leftover artifacts between test runs.
test/security_test.exs (1)
36-37: LGTM! Cleanup properly positioned within error handling.The WAL and SHM file cleanup is correctly placed within the
on_exitcallback and benefits from the existingtry-rescueblock that handles disconnect errors.test/fuzz_test.exs (1)
39-40: LGTM! Essential cleanup for fuzz testing.Proper cleanup of WAL and SHM files is particularly important for fuzz tests, which exercise arbitrary inputs and may leave the database in various states. This ensures a clean slate for each test run.
test/statement_ownership_test.exs (1)
24-25: LGTM! Both test databases properly cleaned up.Correctly extends cleanup to remove auxiliary files for both test databases used in cross-connection ownership tests. The pattern is consistently applied to
db_file1anddb_file2.Also applies to: 27-28
test/ecto_adapter_test.exs (1)
12-16: LGTM! Cleanup refactored and enhanced.The
on_exitcallback now provides comprehensive cleanup of the test database and its auxiliary files. The initial cleanup at line 10 is retained, and theon_exitensures complete teardown regardless of test outcome..beads/issues.jsonl (1)
17-17: Status update noted.Issue
el-fpistatus updated fromopentoin_progress, indicating work has commenced on fixing the binary data round-trip test failure for single null byte values.test/ecto_libsql_test.exs (3)
8-9: LGTM! Proper cleanup of SQLite auxiliary files.The addition of -shm and -wal file removal ensures clean test state by removing any leftover Write-Ahead Logging mode files from previous test runs.
11-16: LGTM! Proper teardown in on_exit callback.The on_exit callback ensures bar.db and its WAL auxiliary files are cleaned up after all tests complete, maintaining test isolation and preventing leftover files between test runs.
36-37: LGTM! Consistent per-test cleanup.The addition of -shm and -wal file cleanup in the per-test on_exit callback maintains consistency with the setup_all cleanup pattern and ensures proper test isolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/ecto_libsql_test.exs (1)
8-16: LGTM! Comprehensive WAL cleanup added.The additions properly clean up SQLite Write-Ahead Logging auxiliary files (-shm and -wal) for the bar database in both initial setup and teardown. This prevents leftover files between test runs.
Optional: Consider a helper function to reduce duplication
The pattern of cleaning up base + -shm + -wal files is repeated throughout the test suite. Consider extracting to a helper:
+ defp cleanup_db_files(base_name) do + File.rm(base_name) + File.rm(base_name <> "-shm") + File.rm(base_name <> "-wal") + end + setup_all do # Clean up any existing test database from previous runs - File.rm("z_ecto_libsql_test-bar.db") - File.rm("z_ecto_libsql_test-bar.db-shm") - File.rm("z_ecto_libsql_test-bar.db-wal") + cleanup_db_files("z_ecto_libsql_test-bar.db") on_exit(fn -> # Clean up bar.db at end of all tests too - File.rm("z_ecto_libsql_test-bar.db") - File.rm("z_ecto_libsql_test-bar.db-shm") - File.rm("z_ecto_libsql_test-bar.db-wal") + cleanup_db_files("z_ecto_libsql_test-bar.db") end)This same helper could be used in setup callbacks and encryption tests as well.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.beads/issues.jsonltest/ecto_libsql_test.exs
🚧 Files skipped from review as they are similar to previous changes (1)
- .beads/issues.jsonl
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ex,exs,rs,md}
📄 CodeRabbit inference engine (CLAUDE.md)
ALWAYS use British/Australian English spelling and grammar for code, comments, and documentation, except where required for function calls, SQL keywords, error messages, or compatibility with external systems that may use US English
Files:
test/ecto_libsql_test.exs
**/*.{ex,exs}
📄 CodeRabbit inference engine (CLAUDE.md)
ALWAYS run the Elixir formatter (
mix format --check-formatted) before committing changes and fix any issues
**/*.{ex,exs}: For Ecto schema definitions in Elixir, useEcto.SchemaandEcto.Changesetmodules to define data models with proper validation and type annotations
Use prepared statements with automatic caching for repeated queries in ecto_libsql to achieve ~10-15x performance improvement; statements are cached internally and bindings are cleared via stmt.reset() between calls
For bulk insert operations in ecto_libsql, use batch_transactional/2 to group multiple inserts into a single atomic transaction, providing better performance than individual inserts
Always use pattern matching for database operation results in ecto_libsql to handle both success and error cases; never use bare unwrap patterns that could crash the VM
For read-heavy workloads with ecto_libsql, use remote replica mode (libsql:// URI with local database file and sync: true) to achieve microsecond read latency from local SQLite while auto-syncing writes to remote Turso
Use vector embeddings with ecto_libsql for semantic search by creating vector columns with EctoLibSql.Native.vector_type/2, storing embeddings via vector() SQL function, and querying with vector_distance_cos/2 for cosine distance calculation
For transaction handling in ecto_libsql, use transaction behaviours (DEFERRED, IMMEDIATE, EXCLUSIVE, READ_ONLY) to control lock acquisition; use IMMEDIATE for write-heavy workloads to prevent writer starvation
Use savepoints (create_savepoint, release_savepoint_by_name, rollback_to_savepoint_by_name) within transactions for partial rollback and error recovery, particularly in batch import scenarios
For large result set processing in ecto_libsql, use DBConnection.stream/3 with cursor-based streaming instead of loading all rows into memory; configure batch size with max_rows option
Use EctoLibSql.Pragma module to configure SQLite parameters: enable_foreign_keys/1, set_journal_mode/2 (p...
Files:
test/ecto_libsql_test.exs
test/**/*.exs
📄 CodeRabbit inference engine (CLAUDE.md)
test/**/*.exs: Add tests for all new features in appropriate Elixir test files (test/ecto_*_test.exs) and Rust test modules (native/ecto_libsql/src/tests/), covering happy path, error cases, edge cases, and type conversions
Add comprehensive tests for unsupported functions asserting that they always return {:error, :unsupported} and that they don't modify database state or corrupt connections
Files:
test/ecto_libsql_test.exs
test/**/*.{ex,exs}
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*.{ex,exs}: For testing, use fixtures or factories (e.g., ExMachina) to create test data in a predictable, maintainable way rather than hardcoding test data
Document and test all database edge cases: NULL handling, type coercions, constraint violations, and concurrent modifications
Files:
test/ecto_libsql_test.exs
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use EctoLibSql.Pragma module to configure SQLite parameters: enable_foreign_keys/1, set_journal_mode/2 (preferably WAL), set_cache_size/2, set_synchronous/2, and user_version/1 for schema versioning
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to test/**/*.{ex,exs} : Document and test all database edge cases: NULL handling, type coercions, constraint violations, and concurrent modifications
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/**/*.exs : Add comprehensive tests for unsupported functions asserting that they always return {:error, :unsupported} and that they don't modify database state or corrupt connections
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use EctoLibSql.Pragma module to configure SQLite parameters: enable_foreign_keys/1, set_journal_mode/2 (preferably WAL), set_cache_size/2, set_synchronous/2, and user_version/1 for schema versioning
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/**/*migration*test.exs : For SQLite migrations that require column type changes or drops (which SQLite doesn't support via ALTER), use the table recreation pattern: create new table, copy data with transformations, swap tables, and recreate indexes
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/**/*.exs : Add tests for all new features in appropriate Elixir test files (test/ecto_*_test.exs) and Rust test modules (native/ecto_libsql/src/tests/), covering happy path, error cases, edge cases, and type conversions
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to priv/repo/migrations/*.{ex,exs} : When migrating from standard SQLite to libSQL with ALTER COLUMN, understand that changes only affect new/updated rows; use table recreation pattern on standard SQLite if full revalidation is needed
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to lib/ecto/adapters/libsql.ex : When implementing Ecto storage operations (create, drop, status) in lib/ecto/adapters/libsql.ex, ensure they properly handle both local SQLite and remote Turso databases via the connection mode in EctoLibSql.State
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to native/ecto_libsql/src/!(tests)/**/*.rs : In Rust, all non-test code must have no `.unwrap()` calls; this was a critical refactoring in v0.5.0 to eliminate 146 unwrap calls and prevent BEAM VM crashes from panics in native code
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to config/**/*.{exs,ex} : For ecto_libsql, use local mode (database: "file.db") for development and testing; use remote replica mode for production
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to priv/repo/migrations/*.{ex,exs} : In Ecto migrations with ecto_libsql, use ALTER COLUMN to modify column attributes (type, NOT NULL, DEFAULT, CHECK, REFERENCES); note that changes only apply to new/updated rows and existing data is not revalidated
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to config/test.exs : Configure Repo in test environment to use in-memory or separate test database; avoid sharing production database with tests
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Always clean up prepared statement resources by calling EctoLibSql.Native.close_stmt/1 when statements are no longer needed
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: When debugging failing tests, run with trace (`mix test file.exs --trace`), verify NIF compilation (`File.exists?("priv/native/ecto_libsql.so")`), check Rust output with `cargo test -- --nocapture`, and run Rust tests independently to isolate issues
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to lib/**/*.ex : When working with database locks, use transactions with proper timeout configuration, ensure connections are properly closed in try-after blocks, and use immediate/exclusive transaction behaviours for write-heavy workloads to minimise lock contention
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Always handle database connection errors gracefully by pattern matching on {:ok, state} and {:error, reason} tuples; use supervision trees to manage connection lifecycle
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Use Repo.transaction/1 with with/1 clauses to handle multiple database operations atomically and rollback on error
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Implement supervision tree for database workers to handle connection lifecycle and enable automatic restart on connection failure
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to test/turso_remote_test.exs : For Turso remote tests, use environment variables TURSO_DB_URI and TURSO_AUTH_TOKEN, loading them from .env.local file before running tests; remote tests should be skipped by default if credentials are missing
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-27T00:00:44.643Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T00:00:44.643Z
Learning: Applies to **/*.{ex,exs} : Store encryption keys in environment variables or secret management services, not hardcoded; use at least 32-character encryption keys for database encryption with ecto_libsql
Applied to files:
test/ecto_libsql_test.exs
📚 Learning: 2025-12-17T11:58:26.477Z
Learnt from: CR
Repo: ocean/ecto_libsql PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T11:58:26.477Z
Learning: Applies to native/ecto_libsql/src/!(tests)/**/*.rs : In Rust, use the `safe_lock(®ISTRY, "context_description")` helper function instead of directly calling `.lock().unwrap()` on Mutex types to safely acquire locks with proper error handling
Applied to files:
test/ecto_libsql_test.exs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Elixir 1.18.0 / OTP 27.0 / ubuntu-latest
- GitHub Check: Elixir 1.18.0 / OTP 27.0 / macos-latest
- GitHub Check: Analyze (rust)
🔇 Additional comments (2)
test/ecto_libsql_test.exs (2)
36-37: LGTM! Per-test WAL cleanup is correct.The additions ensure that each test's unique database file has its WAL auxiliary files cleaned up properly, maintaining good test isolation.
498-499: LGTM! Encryption test cleanups are comprehensive.All four encryption tests now properly clean up WAL auxiliary files alongside the main database files. This ensures no leftover -shm or -wal files persist after encrypted database tests.
Also applies to: 543-544, 609-610, 677-678
Add cleanup for -shm and -wal files in test teardown callbacks to prevent leftover SQLite WAL mode files between test runs.
Summary by CodeRabbit
Tests
Documentation
Chores
Note: No user-facing functionality was changed.
✏️ Tip: You can customize this high-level summary in your review settings.