queryweave-sql 0.2.1

The SQL runtime of queryweave: database-agnostic sqlx query building (WHERE, ORDER BY, LIMIT/OFFSET, SET) from the data queryweave's derives generate.
Documentation
[package]

name = "queryweave-sql"

# The five crates are versioned in lockstep.

version = "0.2.1"

description = "The SQL runtime of queryweave: database-agnostic sqlx query building (WHERE, ORDER BY, LIMIT/OFFSET, SET) from the data queryweave's derives generate."

authors = ["Eduard Mihai Mitrică"]

license = "MIT OR Apache-2.0"

readme = "../README.md"

repository.workspace = true

keywords = ["sqlx", "sql", "filter", "pagination", "query"]

categories = ["database"]

edition.workspace = true

rust-version = "1.88"



[lints]

workspace = true



[dependencies]

queryweave = { path = "../queryweave", version = "0.2.1", default-features = false }



# The `sqlx` backend. No driver: it is generic over any database whose driver

# binds the domain's raw values (`BindValues`).

chrono = { workspace = true, optional = true }

sqlx = { workspace = true, optional = true }

# The `sea-query` backend (SeaORM's query builder).

sea-query = { workspace = true, optional = true, features = ["with-chrono"] }

# The `diesel` backend.

diesel = { workspace = true, optional = true, features = ["chrono"] }

mutants.workspace = true



[features]

# Merge patches (`MergePatch`, `MergePatchNullableFields`, `ValidateNonNullable`

# and their runtime): on by default; turn the default features off for the

# filters alone.

default = ["merge-patch", "sqlx"]

merge-patch = ["queryweave/merge-patch"]

# sqlx's `QueryBuilder` as a query the SQL is written into.

sqlx = ["dep:sqlx", "dep:chrono"]

# sea-query's statements (SeaORM's, through `QueryTrait::query`) as queries the

# SQL is written into.

sea-query = ["dep:sea-query"]

# Diesel's typed DSL (`queryweave_sql::diesel`): conditions, orderings, a page

# and assignments for an entity's columns, for the SQL types every backend has.

diesel = ["dep:diesel", "dep:chrono"]

# Each backend's own date-time types, through Diesel's feature of the same

# backend (which a Diesel application on it already enables): `Timestamptz`,

# `Datetime`, `TimestamptzSqlite`.

diesel-postgres = ["diesel", "diesel/postgres_backend"]

diesel-mysql = ["diesel", "diesel/mysql_backend"]

diesel-sqlite = ["diesel", "diesel/sqlite"]



[dev-dependencies]

# The SQLite tests' date-times, whichever backend runs them.

chrono.workspace = true

rstest.workspace = true

pretty_assertions.workspace = true

tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }

# The tests render and run the SQL on every database sqlx supports.

sqlx = { workspace = true, features = ["runtime-tokio", "postgres", "mysql", "sqlite", "chrono"] }

# The database tests (`tests/postgres.rs`, `tests/mysql.rs`) start their

# servers in containers.

testcontainers.workspace = true

# The feature checks' UI cases (`tests/ui/features`).

trybuild.workspace = true

# The sea-query backend's tests render each database's SQL, and run it on

# SQLite through sqlx.

sea-query = { workspace = true, features = ["backend-postgres", "backend-mysql", "backend-sqlite", "with-chrono"] }

sea-query-sqlx = { workspace = true, features = ["sqlx-sqlite", "with-chrono"] }

# The diesel backend's tests render each database's SQL, and run it on SQLite

# (bundled, so no system library is needed).

diesel = { workspace = true, features = ["sqlite", "postgres_backend", "mysql_backend", "chrono"] }

libsqlite3-sys.workspace = true

# The diesel backend against real Postgres, MySQL and MariaDB: Diesel's DSL over

# pure Rust drivers, so no libpq or mysqlclient is needed.

diesel-async = { workspace = true, features = ["postgres", "mysql"] }



# The SQL tests run through sqlx's `QueryBuilder`.

[[test]]

name = "sqlite"

required-features = ["sqlx"]



[[test]]

name = "postgres"

required-features = ["sqlx"]



[[test]]

name = "mysql"

required-features = ["sqlx"]



[[test]]

name = "sea_query_sqlite"

required-features = ["sea-query"]



[[test]]

name = "diesel_sqlite"

required-features = ["diesel-sqlite"]



[[test]]

name = "diesel_postgres"

required-features = ["diesel-postgres"]



[[test]]

name = "diesel_mysql"

required-features = ["diesel-mysql"]



# docs.rs documents every feature: the integrations and backends are opt-in.

[package.metadata.docs.rs]

all-features = true