# devrimgunduz/pagila architecture

> Architecture diagram of the GitHub repository devrimgunduz/pagila, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devrimgunduz/pagila
- Repository: https://github.com/devrimgunduz/pagila

## Overview

Pagila is a PostgreSQL sample database for a DVD-rental domain, intended for queries, tutorials, and feature demonstrations. The main workflow is to create the schema, load its data, then query the database. The repository also provides separate JSONB package-metadata examples and SQL for temporal data and partition maintenance. The README documents full-text search, JSONB, pgvector, UUIDv7, and pgAdmin. No source excerpts were provided, so links between maintenance scripts and database objects are omitted where the README does not establish them.

Main entry points: [`pagila-schema.sql`](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql) (Rental Schema), [`pagila-schema-jsonb.sql`](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema-jsonb.sql) (Package JSONB Schema), [`pagila-data.sql`](https://github.com/devrimgunduz/pagila/blob/master/pagila-data.sql) (Rental Data), [`pagila-insert-data.sql`](https://github.com/devrimgunduz/pagila/blob/master/pagila-insert-data.sql) (Insert Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["DVD Rental Database"]
  node_schema[("Rental Schema<br/>[pagila-schema.sql]")]
  node_seed["Rental Data<br/>[pagila-data.sql]"]
  node_insert_data["Insert Data"]
end

subgraph group_features["Database Features"]
  node_fulltext["Full-text Search<br/>[pagila-schema.sql]"]
  node_actor_jsonb["Actor JSONB View<br/>[pagila-schema.sql]"]
  node_vector["Film Vectors<br/>[pagila-schema.sql]"]
  node_uuid["UUIDv7 IDs<br/>[pagila-schema.sql]"]
end

subgraph group_examples["JSONB Examples"]
  node_package_schema[("Package JSONB Schema")]
  node_apt_backup["APT Package Data"]
  node_yum_backup["YUM Package Data"]
end

subgraph group_maintenance["Data Maintenance"]
  node_temporal["Temporal Setup"]
  node_partman_setup["Partition Setup"]
  node_monthly_script["Monthly Data Script"]
  node_monthly_sql["Monthly Data SQL"]
  node_partman_maintenance["Partition Maintenance"]
end

node_user(("SQL User"))

node_user -->|"queries"| node_schema
node_schema -->|"precedes loading"| node_seed
node_schema -->|"precedes loading"| node_insert_data
node_schema -->|"defines"| node_fulltext
node_schema -->|"defines"| node_actor_jsonb
node_schema -->|"defines"| node_vector
node_schema -->|"defines"| node_uuid
node_user -->|"queries"| node_actor_jsonb
node_user -->|"queries"| node_vector
node_user -->|"loads example"| node_package_schema
node_package_schema -->|"loads data"| node_apt_backup
node_package_schema -->|"loads data"| node_yum_backup

click node_schema "https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql"
click node_seed "https://github.com/devrimgunduz/pagila/blob/master/pagila-data.sql"
click node_insert_data "https://github.com/devrimgunduz/pagila/blob/master/pagila-insert-data.sql"
click node_fulltext "https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql"
click node_actor_jsonb "https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql"
click node_vector "https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql"
click node_uuid "https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql"
click node_package_schema "https://github.com/devrimgunduz/pagila/blob/master/pagila-schema-jsonb.sql"
click node_apt_backup "https://github.com/devrimgunduz/pagila/blob/master/pagila-data-apt-jsonb.backup"
click node_yum_backup "https://github.com/devrimgunduz/pagila/blob/master/pagila-data-yum-jsonb.backup"
click node_temporal "https://github.com/devrimgunduz/pagila/blob/master/pagila-temporal-setup.sql"
click node_partman_setup "https://github.com/devrimgunduz/pagila/blob/master/pg_partman-setup.sql"
click node_monthly_script "https://github.com/devrimgunduz/pagila/blob/master/scripts/add_monthly_data.sh"
click node_monthly_sql "https://github.com/devrimgunduz/pagila/blob/master/scripts/add_monthly_data.sql"
click node_partman_maintenance "https://github.com/devrimgunduz/pagila/blob/master/scripts/run_partman_maintenance.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_schema,node_seed,node_insert_data,node_user toneBlue
class node_fulltext,node_actor_jsonb,node_vector,node_uuid toneAmber
class node_package_schema,node_apt_backup,node_yum_backup toneMint
class node_temporal,node_partman_setup,node_monthly_script,node_monthly_sql,node_partman_maintenance toneRose
```

## Components

### DVD Rental Database

- [Rental Schema](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql): `pagila-schema.sql`
- [Rental Data](https://github.com/devrimgunduz/pagila/blob/master/pagila-data.sql): `pagila-data.sql`
- [Insert Data](https://github.com/devrimgunduz/pagila/blob/master/pagila-insert-data.sql): `pagila-insert-data.sql`

### Database Features

- [Full-text Search](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql): `pagila-schema.sql`
- [Actor JSONB View](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql): `pagila-schema.sql`
- [Film Vectors](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql): `pagila-schema.sql`
- [UUIDv7 IDs](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema.sql): `pagila-schema.sql`

### JSONB Examples

- [Package JSONB Schema](https://github.com/devrimgunduz/pagila/blob/master/pagila-schema-jsonb.sql): `pagila-schema-jsonb.sql`
- [APT Package Data](https://github.com/devrimgunduz/pagila/blob/master/pagila-data-apt-jsonb.backup): `pagila-data-apt-jsonb.backup`
- [YUM Package Data](https://github.com/devrimgunduz/pagila/blob/master/pagila-data-yum-jsonb.backup): `pagila-data-yum-jsonb.backup`

### Data Maintenance

- [Temporal Setup](https://github.com/devrimgunduz/pagila/blob/master/pagila-temporal-setup.sql): `pagila-temporal-setup.sql`
- [Partition Setup](https://github.com/devrimgunduz/pagila/blob/master/pg_partman-setup.sql): `pg_partman-setup.sql`
- [Monthly Data Script](https://github.com/devrimgunduz/pagila/blob/master/scripts/add_monthly_data.sh): `scripts/add_monthly_data.sh`
- [Monthly Data SQL](https://github.com/devrimgunduz/pagila/blob/master/scripts/add_monthly_data.sql): `scripts/add_monthly_data.sql`
- [Partition Maintenance](https://github.com/devrimgunduz/pagila/blob/master/scripts/run_partman_maintenance.sh): `scripts/run_partman_maintenance.sh`

### Other components

- **SQL User**

## Connections

- SQL User → Rental Schema: queries (evidence: `README.md`)
- Rental Schema → Rental Data: precedes loading (evidence: `README.md`)
- Rental Schema → Insert Data: precedes loading (evidence: `README.md`)
- Rental Schema → Full-text Search: defines (evidence: `README.md`)
- Rental Schema → Actor JSONB View: defines (evidence: `README.md`)
- Rental Schema → Film Vectors: defines (evidence: `README.md`)
- Rental Schema → UUIDv7 IDs: defines (evidence: `README.md`)
- SQL User → Actor JSONB View: queries (evidence: `README.md`)
- SQL User → Film Vectors: queries (evidence: `README.md`)
- SQL User → Package JSONB Schema: loads example (evidence: `README.md`)
- Package JSONB Schema → APT Package Data: loads data (evidence: `README.md`)
- Package JSONB Schema → YUM Package Data: loads data (evidence: `README.md`)
