|
3 | 3 | Typed SQL for F#, from one source, on .NET **and** through Fable to **Rust**, |
4 | 4 | **JavaScript NodeJs** and **Erlang/BEAM**. |
5 | 5 |
|
6 | | -NOTE: Rust is "coming soon" as it needs some Fable side PRs merged first. |
| 6 | +NOTE: Rust needs a Fable newer than 5.15 — the fixes are merged on Fable's main branch, awaiting release. |
7 | 7 |
|
8 | 8 | Point the generator at your database, get a module per table with typed columns |
9 | 9 | and row mappers, and write queries against them: |
@@ -57,26 +57,20 @@ value you supply is a bound parameter, never concatenated into the statement. |
57 | 57 | | .NET | ADO.NET (any `DbConnection`) | nothing | full suite, over `Microsoft.Data.Sqlite` | |
58 | 58 | | JavaScript | `node:sqlite` (Node 22.5+) | Fable 5.15 | full suite | |
59 | 59 | | Erlang / BEAM | *none yet* | Fable 5.15 | everything except the driver | |
60 | | -| Rust | sqlx + SQLite (bundled) | **unreleased Fable**, see below | full suite | |
61 | | -| Rust | sqlx + **PostgreSQL** | **unreleased Fable**, see below | full suite, against PostgreSQL 18 | |
62 | | -| Rust | sqlx + MySQL / MariaDB | **unreleased Fable**, see below | compiles and connects; **not run against a server** | |
| 60 | +| Rust | sqlx + SQLite (bundled) | Fable built from `main` (see below) | full suite | |
| 61 | +| Rust | sqlx + **PostgreSQL** | Fable built from `main` (see below) | full suite, against PostgreSQL 18 | |
| 62 | +| Rust | sqlx + MySQL / MariaDB | Fable built from `main` (see below) | compiles and connects; **not run against a server** | |
63 | 63 |
|
64 | 64 | **.NET, JavaScript and BEAM work on released Fable today** — all three were run |
65 | 65 | against Fable 5.15.0 from NuGet, not a local build. |
66 | 66 |
|
67 | | -**Rust needs a Fable fix that has not shipped yet.** Two independent reasons, |
68 | | -both in the Rust async runtime: |
69 | | - |
70 | | -- The async computation builder has no `Combine`, so `Db.submit` and |
71 | | - `Db.inTransaction` -- which use a `for` loop and a `try/with` inside an |
72 | | - `async` block -- fail to compile with *no `singleton` in `AsyncBuilder_`*. |
73 | | -- Awaiting a task sleeps 100 ms per poll, which measured 2718 ms for 65 ms of |
74 | | - real work. Every query would pay it. |
75 | | - |
76 | | -Both are fixed by the `fix/rust-async` branch in |
77 | | -[fable-compiler/Fable](https://github.com/fable-compiler/Fable). Until it is |
78 | | -merged and released, build Fable from that branch and point `FABLE_LOCAL_DLL` |
79 | | -at it; see [GAPS.md](GAPS.md). |
| 67 | +**Rust works on Fable's `main` branch; the release carrying it is pending.** |
| 68 | +The fixes it needed — the async builder's `Combine`, the async runtime's |
| 69 | +polling overhead, exception and type-test codegen, string enumeration — are |
| 70 | +all merged into [fable-compiler/Fable](https://github.com/fable-compiler/Fable) |
| 71 | +(PRs #4916–#4918, #4920, #4921), and the full suite passes against a compiler |
| 72 | +built from unmodified `main`. Until the next Fable release ships, build Fable |
| 73 | +from `main` and point `FABLE_LOCAL_DLL` at it; see [GAPS.md](GAPS.md). |
80 | 74 |
|
81 | 75 | The three Rust backends are one code path — sqlx's `Any` driver picks the engine |
82 | 76 | from the URL — so they differ only in connection string, placeholder syntax and |
@@ -110,9 +104,9 @@ The packages carry their F# sources under `fable/`, the way Fable libraries do, |
110 | 104 | so a Fable project compiles the library to its own target while .NET uses the |
111 | 105 | compiled assembly from the same package. |
112 | 106 |
|
113 | | -JavaScript and BEAM need nothing beyond released Fable. Rust additionally needs |
114 | | -the unmerged fix described under [Status](#status), and the consuming crate's |
115 | | -`Cargo.toml` needs the driver stack the connector calls into: |
| 107 | +JavaScript and BEAM need nothing beyond released Fable. Rust needs a Fable |
| 108 | +built from `main` until the next release ships (see [Status](#status)), and the |
| 109 | +consuming crate's `Cargo.toml` needs the driver stack the connector calls into: |
116 | 110 |
|
117 | 111 | ```toml |
118 | 112 | [dependencies] |
|
0 commit comments