Skip to main content

sqlx_cloudflare_core/
lib.rs

1//! The shared internals of the sqlx-cloudflare drivers.
2//!
3//! You want [`sqlx-cloudflare-d1`](https://docs.rs/sqlx-cloudflare-d1) or
4//! [`sqlx-cloudflare-do`](https://docs.rs/sqlx-cloudflare-do) instead. Both are
5//! SQLite behind a JavaScript API, so they share what this crate holds:
6//!
7//! - the value model -- [`Value`], bound and read alike, and [`TypeInfo`] --
8//!   and the ±(2^53 − 1) rule JavaScript numbers impose on integers;
9//! - the `Type`, `Encode` and `Decode` impls, written into each driver by
10//!   [`impl_types!`];
11//! - the conversion to and from JavaScript values ([`js`]);
12//! - [`DatabaseError`], read from SQLite's message text;
13//! - [`QueryResult`], [`BatchResult`] and the typing of a result's columns
14//!   ([`rows`]).
15//!
16//! What a driver keeps for itself is the part the orphan rule will not let it
17//! share: its `Database` type and the row, column, value and arguments types
18//! whose sqlx traits name it.
19//!
20//! This API serves those drivers and carries no stability promise of its own.
21
22mod arguments;
23mod error;
24pub mod js;
25mod result;
26mod row;
27mod types;
28mod value;
29
30pub use arguments::add_argument;
31pub use error::DatabaseError;
32pub use result::{BatchResult, QueryResult};
33pub use row::rows;
34pub use value::{safe_integer, AsValue, TypeInfo, Value, MAX_SAFE_INTEGER};
35
36// Named by `impl_types!`, which expands in a driver crate that need not
37// depend on sqlx-core under that name.
38#[doc(hidden)]
39pub use sqlx_core as __sqlx_core;