Skip to content

Commit a3d1f3f

Browse files
authored
Merge branch 'dev' into dependabot/github_actions/dev/philss/rustler-precompiled-action-1.1.5
2 parents 9834b9d + 74a1af2 commit a3d1f3f

15 files changed

Lines changed: 140 additions & 107 deletions

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.9.1] - 2026-05-07
9+
10+
### Fixed
11+
12+
- **PRAGMA Statement Routing** - PRAGMA statements are now correctly routed through the `query()` path rather than the execute path, fixing incorrect behaviour when reading PRAGMA values (e.g. `PRAGMA journal_mode`, `PRAGMA synchronous`) via the Ecto adapter.
13+
14+
### Changed
15+
16+
- **Upstream Status Notice** - Added a note to the README and Hex documentation about Turso's transition away from libSQL toward their new Turso library (a full SQLite rewrite in Rust). `ecto_libsql` will continue to receive bug fixes and security updates; see the README for more context.
17+
- **Dependency Updates** - Bumped `db_connection` 2.9.0 → 2.10.0, `ecto` 3.13.5 → 3.13.6, `jason` 1.4.4 → 1.4.5, `rustler` 0.37.3 → 0.37.4, `libsql` crates 0.9.29 → 0.9.30, plus various transitive Rust dependency updates.
18+
- **CI Toolchain** - Replaced `erlef/setup-beam` with `mise` for Elixir/OTP version management; updated to current Elixir/OTP versions; applied `zizmor` GitHub Actions security hardening.
19+
20+
### Security
21+
22+
- Acknowledged three additional `rustls-webpki` 0.102.x advisories (RUSTSEC-2026-0049, RUSTSEC-2026-0098, RUSTSEC-2026-0099, RUSTSEC-2026-0104) in `cargo deny` - all are transitive via libsql's pinned `rustls 0.22.x` dependency and cannot be resolved until libsql updates upstream.
23+
824
## [0.9.0] - 2026-02-02
925

1026
### Added
@@ -16,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1632

1733
- **`Repo.exists?` Generates Valid SQL** - Fixed empty SELECT clause generating invalid SQL (`SELECT FROM "users"` instead of `SELECT 1 FROM "users"`), causing syntax errors. (Thanks [@ricardo-valero](https://github.com/ricardo-valero) for [PR #69](https://github.com/ocean/ecto_libsql/pull/69)!)
1834
- **NIF Cross-Compilation Workflow** - Fixed multiple issues preventing successful cross-compilation in GitHub Actions:
19-
- Fixed Cargo workspace target directory mismatch build output goes to the workspace root `target/` directory, not the crate subdirectory
35+
- Fixed Cargo workspace target directory mismatch - build output goes to the workspace root `target/` directory, not the crate subdirectory
2036
- Moved `.cargo/config.toml` to workspace root so musl `-crt-static` rustflags are found when building from workspace root
2137
- Added `Cross.toml` for `RUSTLER_NIF_VERSION` environment passthrough to cross containers
2238
- Consolidated macOS runners to macos-15 (Apple Silicon) for both architectures

CLAUDE.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@
1414
1. Run formatters: `mix format && cd native/ecto_libsql && cargo fmt`
1515
2. Verify checks pass: `mix format --check-formatted && cargo fmt --check`
1616
3. **Only then** commit: `git commit -m "..."`
17-
- **NEVER use `.unwrap()` in production Rust code** use `safe_lock` helpers (see [Error Handling](#error-handling-patterns))
17+
- **NEVER use `.unwrap()` in production Rust code** - use `safe_lock` helpers (see [Error Handling](#error-handling-patterns))
1818
- **Tests MAY use `.unwrap()`** for simplicity
1919

2020
---
2121

2222
## Landing the Plane (Session Completion)
2323

24-
**MANDATORY WORKFLOW work is NOT complete until `git commit` succeeds:**
24+
**MANDATORY WORKFLOW - work is NOT complete until `git commit` succeeds:**
2525

26-
1. **File issues for remaining work** create Beads issues for anything needing follow-up
27-
2. **Run quality gates** (if code changed) tests, linters, builds
28-
3. **Update issue status** close finished work, update in-progress items
26+
1. **File issues for remaining work** - create Beads issues for anything needing follow-up
27+
2. **Run quality gates** (if code changed) - tests, linters, builds
28+
3. **Update issue status** - close finished work, update in-progress items
2929
4. **COMMIT**:
3030
```bash
3131
git commit -m "Your commit message"
3232
bd sync
3333
```
34-
5. **Clean up** clear stashes, prune remote branches
35-
6. **Verify** all changes committed
34+
5. **Clean up** - clear stashes, prune remote branches
35+
6. **Verify** - all changes committed
3636
7. **Hand off** - provide context for next session
3737

3838
**If commit fails, resolve and retry until it succeeds.**
@@ -71,11 +71,11 @@ Rust NIF (libsql-rs, connection registry, async runtime)
7171
### Key Files
7272

7373
**Elixir:**
74-
- `lib/ecto_libsql.ex` DBConnection protocol
75-
- `lib/ecto_libsql/native.ex` NIF wrappers
76-
- `lib/ecto_libsql/state.ex` Connection state
77-
- `lib/ecto/adapters/libsql.ex` Main adapter
78-
- `lib/ecto/adapters/libsql/connection.ex` SQL generation
74+
- `lib/ecto_libsql.ex` - DBConnection protocol
75+
- `lib/ecto_libsql/native.ex` - NIF wrappers
76+
- `lib/ecto_libsql/state.ex` - Connection state
77+
- `lib/ecto/adapters/libsql.ex` - Main adapter
78+
- `lib/ecto/adapters/libsql/connection.ex` - SQL generation
7979

8080
**Rust** (`native/ecto_libsql/src/`):
8181

@@ -98,8 +98,8 @@ Rust NIF (libsql-rs, connection registry, async runtime)
9898
| `tests/` | Test modules |
9999

100100
**Tests:**
101-
- `test/*.exs` Elixir tests (adapter, integration, migrations, error handling, Turso)
102-
- `native/ecto_libsql/src/tests/` Rust tests (constants, utils, integration)
101+
- `test/*.exs` - Elixir tests (adapter, integration, migrations, error handling, Turso)
102+
- `native/ecto_libsql/src/tests/` - Rust tests (constants, utils, integration)
103103

104104
### Key Data Structures
105105

@@ -139,7 +139,7 @@ git checkout -b feature-descriptive-name # or bugfix-descriptive-name
139139
- **NEVER run `git clean`** without explicit user approval
140140
- **NEVER run `git checkout .`** or `git restore .` on the whole repo
141141
- **NEVER run `git reset --hard`** without explicit user approval
142-
- Untracked files stay in place across branch switches this is expected
142+
- Untracked files stay in place across branch switches - this is expected
143143

144144
### PR Workflow
145145

@@ -158,7 +158,7 @@ git branch -d feature-descriptive-name
158158

159159
### Pre-Commit Checklist
160160

161-
**STRICT ORDER do NOT skip steps or reorder:**
161+
**STRICT ORDER - do NOT skip steps or reorder:**
162162

163163
```bash
164164
# 1. Format code (must come FIRST)
@@ -221,11 +221,11 @@ git add . && git commit -m "..."
221221

222222
## Adding a New NIF Function
223223

224-
**Modern Rustler auto-detects all `#[rustler::nif]` functions no manual registration needed.**
224+
**Modern Rustler auto-detects all `#[rustler::nif]` functions - no manual registration needed.**
225225

226-
1. **Choose the right module** connection lifecycle → `connection.rs`, query execution → `query.rs`, transactions → `transaction.rs`, batch → `batch.rs`, statements → `statement.rs`, cursors → `cursor.rs`, replication → `replication.rs`, metadata → `metadata.rs`, savepoints → `savepoint.rs`
227-
2. **Define the Rust NIF** with `#[rustler::nif(schedule = "DirtyIo")]` use `safe_lock` (never `.unwrap()`) see [Error Handling](#error-handling-patterns)
228-
3. **Add Elixir wrapper** in `lib/ecto_libsql/native.ex` NIF stub + safe wrapper using `EctoLibSql.State`
226+
1. **Choose the right module** - connection lifecycle → `connection.rs`, query execution → `query.rs`, transactions → `transaction.rs`, batch → `batch.rs`, statements → `statement.rs`, cursors → `cursor.rs`, replication → `replication.rs`, metadata → `metadata.rs`, savepoints → `savepoint.rs`
227+
2. **Define the Rust NIF** with `#[rustler::nif(schedule = "DirtyIo")]` - use `safe_lock` (never `.unwrap()`) - see [Error Handling](#error-handling-patterns)
228+
3. **Add Elixir wrapper** in `lib/ecto_libsql/native.ex` - NIF stub + safe wrapper using `EctoLibSql.State`
229229
4. **Add tests** in both Rust (`native/ecto_libsql/src/tests/`) and Elixir (`test/`)
230230
5. **Update documentation** in `USAGE.md` and `CHANGELOG.md`
231231

@@ -242,7 +242,7 @@ git add . && git commit -m "..."
242242

243243
### Rust Patterns (CRITICAL!)
244244

245-
**NEVER use `.unwrap()` in production code** see `RUST_ERROR_HANDLING.md` for comprehensive patterns.
245+
**NEVER use `.unwrap()` in production code** - see `RUST_ERROR_HANDLING.md` for comprehensive patterns.
246246

247247
#### Pattern 1: Lock a Registry
248248
```rust
@@ -443,12 +443,12 @@ if entry.conn_id != conn_id {
443443

444444
### Internal Documentation
445445

446-
- **[USAGE.md](USAGE.md)** API reference for library users
447-
- **[README.md](README.md)** User-facing documentation
448-
- **[CHANGELOG.md](CHANGELOG.md)** Version history
449-
- **[ECTO_MIGRATION_GUIDE.md](ECTO_MIGRATION_GUIDE.md)** Migrating from PostgreSQL/MySQL
450-
- **[RUST_ERROR_HANDLING.md](RUST_ERROR_HANDLING.md)** Error pattern reference
451-
- **[TESTING.md](TESTING.md)** Testing strategy and organisation
446+
- **[USAGE.md](USAGE.md)** - API reference for library users
447+
- **[README.md](README.md)** - User-facing documentation
448+
- **[CHANGELOG.md](CHANGELOG.md)** - Version history
449+
- **[ECTO_MIGRATION_GUIDE.md](ECTO_MIGRATION_GUIDE.md)** - Migrating from PostgreSQL/MySQL
450+
- **[RUST_ERROR_HANDLING.md](RUST_ERROR_HANDLING.md)** - Error pattern reference
451+
- **[TESTING.md](TESTING.md)** - Testing strategy and organisation
452452

453453
### External Documentation
454454

Cargo.lock

Lines changed: 32 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
`ecto_libsql` is an (unofficial) Elixir [Ecto](https://github.com/elixir-ecto/ecto) database adapter for [LibSQL](https://github.com/tursodatabase/libsql) database files, and databases hosted on [Turso](https://turso.tech/), built with Rust NIFs. It supports local libSQL/SQLite files, remote replica with synchronisation, and remote only Turso databases.
66

7+
> [!NOTE]
8+
> **Upstream status:** [Turso is now closer to transitioning away from libSQL](https://turso.tech/blog/sync-benchmark) (their fork of SQLite) in favour of their new [Turso](https://turso.tech/turso) library - their full rewrite of SQLite in Rust. Activity on the [libSQL repository](https://github.com/tursodatabase/libsql) has slowed significantly as a result. We are monitoring the situation. `ecto_libsql` will continue to receive bug fixes and security updates, but is likely to transition to maintenance mode as the Elixir/Turso ecosystem matures. For those interested in using the new Turso library, [turso_ex](https://github.com/bytebottom/turso_ex) is an early-stage Elixir adapter currently under development.
9+
710
## Installation
811

912
Add `ecto_libsql` to your dependencies in `mix.exs`:
1013

1114
```elixir
1215
def deps do
1316
[
14-
{:ecto_libsql, "~> 0.8.0"}
17+
{:ecto_libsql, "~> 0.9.0"}
1518
]
1619
end
1720
```

RELEASE_PROCESS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ git push
1616

1717
## 2. Create the GitHub release (triggers CI)
1818

19-
The CI workflow triggers on tags matching `*.*.*`. The tag must match the version in `mix.exs` exactly no `v` prefix, as the `base_url` in `native.ex` uses the raw version string.
19+
The CI workflow triggers on tags matching `*.*.*`. The tag must match the version in `mix.exs` exactly - no `v` prefix, as the `base_url` in `native.ex` uses the raw version string.
2020

2121
```bash
2222
gh release create X.Y.Z --title "vX.Y.Z" --draft --generate-notes
@@ -54,7 +54,7 @@ git commit -m "chore: update checksums for vX.Y.Z"
5454
git push
5555
```
5656

57-
This step is critical the checksum file must be in the package so Hex.pm users can verify the downloaded NIFs.
57+
This step is critical - the checksum file must be in the package so Hex.pm users can verify the downloaded NIFs.
5858

5959
## 6. Publish the GitHub release
6060

@@ -72,7 +72,7 @@ mix hex.publish
7272

7373
## Key Gotchas
7474

75-
- **Tag format**: Use `0.9.1` not `v0.9.1` the `base_url` in `native.ex` is `releases/download/#{version}`, so the tag and version must match exactly.
75+
- **Tag format**: Use `0.9.1` not `v0.9.1` - the `base_url` in `native.ex` is `releases/download/#{version}`, so the tag and version must match exactly.
7676
- **Checksum before publish**: Always regenerate and commit the checksum file *before* `mix hex.publish`. Without it, users get integrity errors when installing.
77-
- **`--ignore-unavailable`**: Use with caution only after confirming all 6 CI target builds have succeeded and all 6 release artefacts are present; otherwise it can mask missing binaries.
77+
- **`--ignore-unavailable`**: Use with caution - only after confirming all 6 CI target builds have succeeded and all 6 release artefacts are present; otherwise it can mask missing binaries.
7878
- **Test run option**: The `workflow_dispatch` trigger on the release workflow has a `test_only` input that skips the `gh release upload` step, useful for testing the build matrix without creating a real release.

0 commit comments

Comments
 (0)