# Async I/O and coroutines

Every query API in sqlx4k is a `suspend` function that returns a `Result`: `execute`, `fetchAll`, `begin`, `transaction { }` and the generated repository methods suspend instead of blocking the calling thread, and report failures through the `Result` instead of throwing. Database calls therefore compose with the rest of your coroutine code, from `async` and `withTimeout` to structured concurrency, and the I/O underneath is non-blocking on every platform.

This guide covers the core API, shared by every driver:

- [Connection pool](<https://smyrgeorge.github.io/sqlx4k/guide/connection-pool/index.md>): configuring the pool, and acquiring connections.
- [Running queries](<https://smyrgeorge.github.io/sqlx4k/guide/queries/index.md>): `execute`, `executeWithResult`, `fetchAll`, `fetch` and prepared statements.
- [Mapping rows](<https://smyrgeorge.github.io/sqlx4k/guide/mapping/index.md>): row mappers and custom value converters.
- [Transactions](<https://smyrgeorge.github.io/sqlx4k/guide/transactions/index.md>): transactions, savepoints and `TransactionContext`.
- [Migrations](<https://smyrgeorge.github.io/sqlx4k/guide/migrations/index.md>): running and validating database migrations.

For the generated repositories, see [Code generation](<https://smyrgeorge.github.io/sqlx4k/codegen/index.md>).
