# Database

> Define storage rules, read rows and expose the database functions your UI needs.

## Documentation

- [Schemas and constraints](https://hulla.dev/docs/db/schemas.md): Define tables once, infer application types and enforce storage rules in PostgreSQL.
- [Data types and codecs](https://hulla.dev/docs/db/data-types.md): Choose application representations for PostgreSQL values without losing precision or hiding conversions.
- [Read and write data](https://hulla.dev/docs/db/database.md): Use typed PostgreSQL builders in server code and inside query or mutation handlers.
- [Queries and mutations](https://hulla.dev/docs/db/functions.md): Declare browser-callable reads and atomic writes, with typed input and server-side validation.
- [Live queries and pagination](https://hulla.dev/docs/db/live-queries.md): Observe server query results and load more pages without shifting the rows you already loaded.
- [Optimistic updates](https://hulla.dev/docs/db/optimistic-writes.md): Show a predicted change while a mutation runs, then let the server result settle the view.
- [Code generation](https://hulla.dev/docs/db/code-generation.md): Generate typed database imports and browser functions from your schema.
