Repository navigation
OxideR-Query v0.2.2
An ergonomics fix. Purely additive: nothing is removed or renamed, and no behaviour changes.
The type-state markers are now in the prelude
Writing a helper that returns a statement needs the marker nameable:
fn new_user(name: &str) -> Insert<User, OneRow> {
User::insert().set(User::name, name.to_string())
}Before this release OneRow was reachable only as oxider_query::builder::OneRow, so the first thing you hit after moving a query out of the expression that built it was an import error for a type you had never had to write. The same held for Locked, Unlocked, NoRows, FromQuery, NoFrame and Framed.
All seven are now exported from the crate root and the prelude:
| Marker | Says |
|---|---|
Unlocked / Locked |
whether a Select carries a row-locking clause |
NoRows / OneRow / FromQuery |
where an Insert gets its rows |
NoFrame / Framed |
whether a Window has a frame |
These are never written while building a query, only while naming one, and naming one is exactly what a function signature does. That is why they belong beside the builders rather than a module deeper.
A doc test now writes all three kinds of signature with nothing imported but the prelude, which is the case that was broken:
use oxider_query::prelude::*;
fn new_user(name: &str) -> Insert<User, OneRow> { ... }
fn next_job() -> Select<Only<Job>, Nil, Locked> { ... }
fn trailing_total() -> Window<Nil, Framed> { ... }Chapter 15 of the guide gained a table of the markers.
How it was found
By writing an example project outside the workspace, against the published tag. From there the facade's exports are the whole API rather than an implementation detail, and the gap showed up immediately. The in-tree tests never saw it, because they can reach into any module they like.
Still true
The builder targets PostgreSQL, MySQL and SQLite. Execution covers PostgreSQL and SQLite; schema codegen is SQLite only. On MySQL you render here and bind with your own driver.
Pre-1.0: the API tracks latest stable Rust and will change.
Upgrading
Nothing to change. If you were importing a marker from oxider_query::builder, that path still works; the prelude import is now available as well.