Expand description
Compatibility shim that exposes a sqlx-shaped API by re-exporting from
sqlx-core + sqlx-postgres directly.
Why this shim exists: depending on the sqlx umbrella crate transitively
pulls sqlx-sqlite into the resolve graph (Cargo’s resolver materialises the
optional dep even when no feature activates it), which pins libsqlite3-sys ^0.30.1 and conflicts with rusqlite 0.39’s libsqlite3-sys ^0.37 via the
links = "sqlite3" rule. Going direct to the split crates side-steps the
leak entirely. Downstream users keep writing cratestack::sqlx::X paths;
macro emissions stay unchanged.
SemVer caveat: sqlx-core documents itself as “not meant for general use”
without SemVer guarantees. The surface re-exported here is the narrow subset
the umbrella sqlx crate exposes, which is stable in practice across 0.8.x.
If sqlx-core breaks at a 0.8 patch, this shim adapts in one place.
Re-exports§
pub use sqlx_postgres as postgres;
Modules§
- database
- Traits to represent a database driver.
- decode
- encode
- error
- Types for working with errors produced by SQLx.
- migrate
- pool
- Provides the connection pool for asynchronous SQLx connections.
- query_
builder - Runtime query-builder API.
- types
Structs§
- PgConnection
- A connection to a PostgreSQL database.
- Pool
- An asynchronous pool of SQLx database connections.
- Postgres
- PostgreSQL database driver.
- Query
Builder - A builder type for constructing queries at runtime.
- RawSql
- One or more raw SQL statements, separated by semicolons (
;). - Transaction
- An in-progress database transaction or savepoint.
Enums§
- Either
- The enum
Eitherwith variantsLeftandRightis a general purpose sum type with two cases. - Error
- Represents all the ways a method can fail within SQLx.
Traits§
- Acquire
- Acquire connections or transactions from a database in a generic way.
- Arguments
- A tuple of arguments to be sent to the database.
- Column
- Column
Index - A type that can be used to index into a
RoworStatement. - Connect
Options - Connection
- Represents a single database connection.
- Database
- A database driver.
- Decode
- A type that can be decoded from the database.
- Encode
- Encode a single value to be sent to the database.
- Execute
- A type that may be executed against a database connection.
- Executor
- A type that contains or can provide a database connection to use for executing queries against the database.
- FromRow
- A record that can be built from a row returned by the database.
- Into
Arguments - PgExecutor
- An alias for
Executor<'_, Database = Postgres>. - Row
- Represents a single row from the database.
- Statement
- An explicitly prepared statement.
- Type
- Indicates that a SQL type is supported for a database.
- Type
Info - Provides information about a SQL type for the database driver.
- Value
- An owned value from the database.
- Value
Ref - A reference to a single value from the database.
Functions§
- query
- Execute a single SQL query as a prepared statement (transparently cached).
- query_
as - Execute a single SQL query as a prepared statement (transparently cached).
Maps rows to Rust types using
FromRow. - query_
as_ with - Execute a single SQL query, with the given arguments as a prepared statement (transparently cached).
Maps rows to Rust types using
FromRow. - query_
scalar - Execute a single SQL query as a prepared statement (transparently cached) and extract the first column of each row.
- query_
scalar_ with - Execute a SQL query as a prepared statement (transparently cached), with the given arguments, and extract the first column of each row.
- query_
with - Execute a SQL query as a prepared statement (transparently cached), with the given arguments.
- raw_sql
- Execute one or more statements as raw SQL, separated by semicolons (
;).
Type Aliases§
- PgPool
- An alias for
Pool, specialized for Postgres. - PgTransaction
- An alias for
Transaction, specialized for Postgres. - Result
- A specialized
Resulttype for SQLx.