Expand description
The shared internals of the sqlx-cloudflare drivers.
You want sqlx-cloudflare-d1 or
sqlx-cloudflare-do instead. Both are
SQLite behind a JavaScript API, so they share what this crate holds:
- the value model –
Value, bound and read alike, andTypeInfo– and the ±(2^53 − 1) rule JavaScript numbers impose on integers; - the
Type,EncodeandDecodeimpls, written into each driver byimpl_types!; - the conversion to and from JavaScript values (
js); DatabaseError, read from SQLite’s message text;QueryResult,BatchResultand the typing of a result’s columns (rows).
What a driver keeps for itself is the part the orphan rule will not let it
share: its Database type and the row, column, value and arguments types
whose sqlx traits name it.
This API serves those drivers and carries no stability promise of its own.
Modules§
- js
- The conversions between JavaScript values and this crate’s.
Macros§
- impl_
types - Writes
Type,EncodeandDecodefor the Rust types these backends can store, for the driver’s database type$db.
Structs§
- Batch
Result - What one statement of a batch did, and the rows it returned.
- Database
Error - An error the database returned for a statement.
- Query
Result - What a statement did.
Enums§
- Type
Info - The storage class of a single value, which is all these backends report.
- Value
- One SQLite value on the Rust side of the JavaScript boundary, in either direction: a parameter a query binds, or a value a result row holds.
Constants§
- MAX_
SAFE_ INTEGER - The largest integer a JavaScript number holds exactly: 2^53 − 1.
Number.MAX_SAFE_INTEGER, in other words.
Traits§
- AsValue
- The
Valuebehind a driver’sValueRef, which is what theDecodeimplsimpl_types!writes read from.
Functions§
- add_
argument - Encodes
valueontovalues, as one placeholder’s worth. - rows
- The rows of one result, from its column names and its rows of values.
- safe_
integer value, if a JavaScript number can carry it without rounding.