liveBook · Manning

SQLx

SQLx is a Rust asynchronous toolkit for interacting with relational databases, mapping query results to Rust types, and optionally checking SQL queries at compile time.

How 2 Manning books explain it

Rust Servers, Services, and Apps

SQLx is a Rust library for asynchronous, compile-time checked interaction with SQL databases.

How it is used
Connects an asynchronous Actix Web service to Postgres so its course APIs can persist and retrieve data.
How deep it goes
Works through dependency and database setup, a standalone connection test, pool integration, queries, row conversion, and tests.
Examples
Uses a course table and tutor-course APIs to demonstrate fetch_all, fetch_one, and INSERT ... RETURNING.
What you can do after
Build it from scratch: configure a Postgres connection, then implement pooled asynchronous database access for course APIs.

Read how Rust Servers, Services, and Apps explains SQLx →

Code Like a Pro in Rust

SQLx is a Rust asynchronous SQL toolkit for communicating with relational databases and mapping query results to Rust types.

How it is used
Connects a Rust HTTP REST API to SQLite for asynchronous data access.
How deep it goes
Works through pool initialization, migrations, row mapping, binding, and query execution, but does not detail the migration API.
Examples
Uses a SQLite-backed todo API with a pool initializer and asynchronous list, read, create, and update methods.
What you can do after
Apply it via SQLx to initialize a SQLite pool, run migrations, and implement asynchronous database operations.

Read how Code Like a Pro in Rust explains SQLx →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.