sqlmodel-query 0.5.0

Type-safe SQL query builder for SQLModel Rust
docs.rs failed to build sqlmodel-query-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: sqlmodel-query-0.4.0

sqlmodel-query

Type-safe SQL query builder and expression DSL.

Role in the SQLModel Rust System

  • Provides select!/insert!/update!/delete! macros.
  • Builds SQL + params across Postgres/MySQL/SQLite dialects.
  • Executes via sqlmodel-core::Connection implementations.

Usage

Most users should depend on sqlmodel and import from sqlmodel::prelude::*. Use this crate directly if you are extending internals or building tooling around the core APIs.

Diagnostics

sqlmodel-query emits structured tracing events for inheritance mapping, polymorphic execution, and joined DML transactions:

  • sqlmodel_query::inheritance:
    • DEBUG: mapping resolution on builder initialization (model, strategy, parent, discriminator).
    • DEBUG: joined DML multi-statement transactions (table, op, pk_values) for observable inserts, updates, and deletes without dumping entire rows.
    • WARN: ambiguous rows during polymorphic joined hydration when multiple child table prefixes are non-NULL.
  • sqlmodel_query::polymorphic:
    • TRACE: generated polymorphic SQL query string, parameters, dialect, and child table prefixes.
  • Error Context:
    • Parent hydration errors during joined inheritance row hydration are wrapped in sqlmodel_core::Error::Type containing the parent table name and column prefix context.

Links