# databaseAuthBuilder

## Summary
Attach a concrete database adapter to `AuthBuilder` and transition into the typed builder phase.

## Symbol
- Name: `database`
- Original Symbol: `AuthBuilder::database`
- Kind: `method`
- Owner: `AuthBuilder`

## Signature
```rust
pub fn database<DB: DatabaseAdapter>(self, database: DB) -> TypedAuthBuilder<DB>
```

## Location
- `src/core/auth.rs`
- Re-exported from `src/lib.rs`

## Inputs
- `self`: required; consumes the untyped builder
- `database`: required; any concrete type implementing `DatabaseAdapter`

## Returns
- `TypedAuthBuilder<DB>`
- The returned builder stores the adapter inside `Arc<DB>` and carries forward the config and any builder-level middleware settings already applied

## Errors
- This method does not return an error

## Preconditions
- The adapter type must satisfy the `DatabaseAdapter` trait at compile time

## Side Effects
- None

## Guarantees
- The original `AuthBuilder` is consumed and cannot be reused
- The selected database type fixes the generic parameter for all later plugin registrations and for the final `AthenaAuth<DB>`
- Pending `csrf`, `rate_limit`, `cors`, `body_limit`, and `custom_middlewares` state is preserved
- The typed builder starts with empty `plugins` and `hooks` collections

## Examples
```rust
let builder = AuthBuilder::new(config)
    .database(MemoryDatabaseAdapter::new());
```

## Source of Truth
- Implementation: `src/core/auth.rs`
- Examples: `examples/auth_builder_minimal.rs`, `examples/auth_core_ok.rs`
- Call sites: `tests/compatibility_tests.rs`, `src/tests/route_collision_precedence_tests.rs`
