# githemiao/orm-lite architecture

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

- Interactive diagram: https://gitdiagram.com/githemiao/orm-lite
- Repository: https://github.com/githemiao/orm-lite

## Overview

ORM Lite is a header-only C++ ORM for SQLite. A consumer defines mapped entities and builds typed expressions and queries through the ORM API; the ORM turns those operations into SQL and dispatches them through the SQLite connector. The sampled source shows expression/query construction, entity metadata, delete operations, callback-based SQL execution, and nullable values. Other documented capabilities are not expanded beyond what the README and sampled excerpts support.

Main entry points: [`src/ormlite.h`](https://github.com/githemiao/orm-lite/blob/master/src/ormlite.h) (ORM API), [`src/sqlite_connector.h`](https://github.com/githemiao/orm-lite/blob/master/src/sqlite_connector.h) (SQL connector), [`src/nullable.h`](https://github.com/githemiao/orm-lite/blob/master/src/nullable.h) (Nullable values), [`src/sqlite3.h.zip`](https://github.com/githemiao/orm-lite/blob/master/src/sqlite3.h.zip) (SQLite engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orm["ORM library"]
  node_orm_api["ORM API<br/>[ormlite.h]"]
  node_entity_mapping["Entity mapping<br/>[ormlite.h]"]
  node_query_dsl["Query DSL<br/>[ormlite.h]"]
  node_nullable["Nullable values<br/>[nullable.h]"]
end

subgraph group_storage["SQLite storage"]
  node_connector["SQL connector<br/>[sqlite_connector.h]"]
  node_sqlite[("SQLite engine<br/>[sqlite3.h.zip]")]
end

node_consumer(("C++ consumer"))

node_consumer -->|"uses"| node_orm_api
node_orm_api -->|"maps entities"| node_entity_mapping
node_orm_api -->|"builds queries"| node_query_dsl
node_orm_api -->|"dispatches SQL"| node_connector
node_orm_api -->|"uses values"| node_nullable
node_connector -->|"executes SQL"| node_sqlite

click node_orm_api "https://github.com/githemiao/orm-lite/blob/master/src/ormlite.h"
click node_entity_mapping "https://github.com/githemiao/orm-lite/blob/master/src/ormlite.h"
click node_query_dsl "https://github.com/githemiao/orm-lite/blob/master/src/ormlite.h"
click node_nullable "https://github.com/githemiao/orm-lite/blob/master/src/nullable.h"
click node_connector "https://github.com/githemiao/orm-lite/blob/master/src/sqlite_connector.h"
click node_sqlite "https://github.com/githemiao/orm-lite/blob/master/src/sqlite3.h.zip"

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_orm_api,node_entity_mapping,node_query_dsl,node_nullable toneBlue
class node_connector,node_sqlite toneAmber
class node_consumer toneIndigo
```

## Components

### ORM library

- [ORM API](https://github.com/githemiao/orm-lite/blob/master/src/ormlite.h): `src/ormlite.h`
- [Entity mapping](https://github.com/githemiao/orm-lite/blob/master/src/ormlite.h): `src/ormlite.h`
- [Query DSL](https://github.com/githemiao/orm-lite/blob/master/src/ormlite.h): `src/ormlite.h`
- [Nullable values](https://github.com/githemiao/orm-lite/blob/master/src/nullable.h): `src/nullable.h`

### SQLite storage

- [SQL connector](https://github.com/githemiao/orm-lite/blob/master/src/sqlite_connector.h): `src/sqlite_connector.h`
- [SQLite engine](https://github.com/githemiao/orm-lite/blob/master/src/sqlite3.h.zip): `src/sqlite3.h.zip`

### Other components

- **C++ consumer**

## Connections

- C++ consumer → ORM API: uses
- ORM API → Entity mapping: maps entities
- ORM API → Query DSL: builds queries
- ORM API → SQL connector: dispatches SQL
- ORM API → Nullable values: uses values
- SQL connector → SQLite engine: executes SQL
