# amandev17/pyflashdb architecture

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

- Interactive diagram: https://gitdiagram.com/amandev17/pyflashdb
- Repository: https://github.com/amandev17/pyflashdb

## Overview

pyflashdb is a database-agnostic Python CRUD, schema, and export API for MySQL, PostgreSQL, SQLite, and MongoDB. The main workflow is: a caller configures FlashDB (directly or from a URL), invokes a unified operation, and FlashDB dispatches it to the selected adapter, which executes against that database. Shared filtering, schema definitions, SQL dialects, pooling, triggers, and exports support that workflow. The graph also shows the deprecated `flash` API. Some links rely on README or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`pyflashdb/core.py`](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/core.py) (FlashDB API), [`pyflashdb/adapters/sql.py`](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/sql.py) (Shared SQL runtime), [`flash/core.py`](https://github.com/amandev17/pyflashdb/blob/main/flash/core.py) (Legacy Flash API), [`pyflashdb/adapters/mongo_adapter.py`](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/mongo_adapter.py) (MongoDB adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_flashdb["FlashDB API<br/>[core.py]"]
  node_urls["URL configuration<br/>[urls.py]"]
  node_exports["Data export<br/>[export.py]"]
  node_plugins["Plugins<br/>[plugins.py]"]
end

subgraph group_shared["Shared Behavior"]
  node_filters["Filter semantics<br/>[filters.py]"]
  node_schema["Schema definitions<br/>[schema.py]"]
  node_triggers["Operation triggers<br/>[triggers.py]"]
  node_dialects["SQL dialects<br/>[dialects.py]"]
  node_pool["Connection pool<br/>[pool.py]"]
end

subgraph group_backends["Database Backends"]
  node_base["Adapter interface<br/>[base.py]"]
  node_sql["Shared SQL runtime<br/>[sql.py]"]
  node_mysql["MySQL adapter<br/>[mysql_adapter.py]"]
  node_postgres["PostgreSQL adapter"]
  node_sqlite["SQLite adapter<br/>[sqlite_adapter.py]"]
  node_mongo["MongoDB adapter<br/>[mongo_adapter.py]"]
end

subgraph group_legacy["Legacy API"]
  node_legacy_core["Legacy Flash API<br/>[core.py]"]
  node_legacy_filters["Legacy filters<br/>[filters.py]"]
  node_legacy_triggers["Legacy triggers<br/>[triggers.py]"]
  node_legacy_exceptions["Legacy exceptions<br/>[exceptions.py]"]
  node_legacy_mongo["Legacy MongoDB<br/>[mongo_adapter.py]"]
  node_legacy_mysql["Legacy MySQL<br/>[mysql_adapter.py]"]
  node_legacy_postgres["Legacy PostgreSQL"]
end

node_caller(("Python caller"))
node_database[("Configured database")]

node_caller -->|"uses API"| node_flashdb
node_flashdb -->|"parses URLs"| node_urls
node_flashdb -->|"dispatches to"| node_mysql
node_flashdb -->|"dispatches to"| node_postgres
node_flashdb -->|"dispatches to"| node_sqlite
node_flashdb -->|"dispatches to"| node_mongo
node_flashdb -->|"fires hooks"| node_triggers
node_flashdb -->|"exports data"| node_exports
node_flashdb -->|"operates on"| node_database
node_mysql -->|"uses runtime"| node_sql
node_postgres -->|"uses runtime"| node_sql
node_sqlite -->|"uses runtime"| node_sql
node_sql -->|"implements"| node_base
node_mongo -->|"implements"| node_base
node_sql -->|"compiles filters"| node_filters
node_sql -->|"uses dialect"| node_dialects
node_sql -->|"uses pool"| node_pool
node_mongo -->|"translates filters"| node_filters
node_mongo -->|"validates schema"| node_schema
node_dialects -->|"renders DDL"| node_schema
node_caller -.->|"uses legacy API"| node_legacy_core
node_legacy_core -->|"dispatches to"| node_legacy_mongo
node_legacy_core -->|"dispatches to"| node_legacy_mysql
node_legacy_core -->|"dispatches to"| node_legacy_postgres
node_legacy_core -->|"uses filters"| node_legacy_filters
node_legacy_core -->|"fires hooks"| node_legacy_triggers
node_legacy_mongo -->|"raises errors"| node_legacy_exceptions
node_legacy_mysql -->|"translates filters"| node_legacy_filters
node_legacy_postgres -->|"translates filters"| node_legacy_filters

click node_flashdb "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/core.py"
click node_urls "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/urls.py"
click node_exports "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/export.py"
click node_plugins "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/plugins.py"
click node_filters "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/filters.py"
click node_schema "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/schema.py"
click node_triggers "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/triggers.py"
click node_dialects "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/dialects.py"
click node_pool "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/pool.py"
click node_base "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/base.py"
click node_sql "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/sql.py"
click node_mysql "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/mysql_adapter.py"
click node_postgres "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/postgres_adapter.py"
click node_sqlite "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/sqlite_adapter.py"
click node_mongo "https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/mongo_adapter.py"
click node_legacy_core "https://github.com/amandev17/pyflashdb/blob/main/flash/core.py"
click node_legacy_filters "https://github.com/amandev17/pyflashdb/blob/main/flash/filters.py"
click node_legacy_triggers "https://github.com/amandev17/pyflashdb/blob/main/flash/triggers.py"
click node_legacy_exceptions "https://github.com/amandev17/pyflashdb/blob/main/flash/exceptions.py"
click node_legacy_mongo "https://github.com/amandev17/pyflashdb/blob/main/flash/adapters/mongo_adapter.py"
click node_legacy_mysql "https://github.com/amandev17/pyflashdb/blob/main/flash/adapters/mysql_adapter.py"
click node_legacy_postgres "https://github.com/amandev17/pyflashdb/blob/main/flash/adapters/postgres_adapter.py"

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_flashdb,node_urls,node_exports,node_plugins toneBlue
class node_filters,node_schema,node_triggers,node_dialects,node_pool,node_database toneAmber
class node_base,node_sql,node_mysql,node_postgres,node_sqlite,node_mongo toneMint
class node_legacy_core,node_legacy_filters,node_legacy_triggers,node_legacy_exceptions,node_legacy_mongo,node_legacy_mysql,node_legacy_postgres toneRose
class node_caller toneIndigo
```

## Components

### Public API

- [FlashDB API](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/core.py): `pyflashdb/core.py`
- [URL configuration](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/urls.py): `pyflashdb/urls.py`
- [Data export](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/export.py): `pyflashdb/export.py`
- [Plugins](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/plugins.py): `pyflashdb/plugins.py`

### Shared Behavior

- [Filter semantics](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/filters.py): `pyflashdb/filters.py`
- [Schema definitions](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/schema.py): `pyflashdb/schema.py`
- [Operation triggers](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/triggers.py): `pyflashdb/triggers.py`
- [SQL dialects](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/dialects.py): `pyflashdb/dialects.py`
- [Connection pool](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/pool.py): `pyflashdb/pool.py`

### Database Backends

- [Adapter interface](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/base.py): `pyflashdb/adapters/base.py`
- [Shared SQL runtime](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/sql.py): `pyflashdb/adapters/sql.py`
- [MySQL adapter](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/mysql_adapter.py): `pyflashdb/adapters/mysql_adapter.py`
- [PostgreSQL adapter](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/postgres_adapter.py): `pyflashdb/adapters/postgres_adapter.py`
- [SQLite adapter](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/sqlite_adapter.py): `pyflashdb/adapters/sqlite_adapter.py`
- [MongoDB adapter](https://github.com/amandev17/pyflashdb/blob/main/pyflashdb/adapters/mongo_adapter.py): `pyflashdb/adapters/mongo_adapter.py`

### Legacy API

- [Legacy Flash API](https://github.com/amandev17/pyflashdb/blob/main/flash/core.py): `flash/core.py`
- [Legacy filters](https://github.com/amandev17/pyflashdb/blob/main/flash/filters.py): `flash/filters.py`
- [Legacy triggers](https://github.com/amandev17/pyflashdb/blob/main/flash/triggers.py): `flash/triggers.py`
- [Legacy exceptions](https://github.com/amandev17/pyflashdb/blob/main/flash/exceptions.py): `flash/exceptions.py`
- [Legacy MongoDB](https://github.com/amandev17/pyflashdb/blob/main/flash/adapters/mongo_adapter.py): `flash/adapters/mongo_adapter.py`
- [Legacy MySQL](https://github.com/amandev17/pyflashdb/blob/main/flash/adapters/mysql_adapter.py): `flash/adapters/mysql_adapter.py`
- [Legacy PostgreSQL](https://github.com/amandev17/pyflashdb/blob/main/flash/adapters/postgres_adapter.py): `flash/adapters/postgres_adapter.py`

### Other components

- **Python caller**
- **Configured database**

## Connections

- Python caller → FlashDB API: uses API (evidence: `README.md`)
- FlashDB API → URL configuration: parses URLs (evidence: `pyflashdb/core.py`)
- FlashDB API → MySQL adapter: dispatches to (evidence: `pyflashdb/core.py`)
- FlashDB API → PostgreSQL adapter: dispatches to (evidence: `pyflashdb/core.py`)
- FlashDB API → SQLite adapter: dispatches to (evidence: `pyflashdb/core.py`)
- FlashDB API → MongoDB adapter: dispatches to (evidence: `pyflashdb/core.py`)
- FlashDB API → Operation triggers: fires hooks (evidence: `pyflashdb/core.py`)
- FlashDB API → Data export: exports data (evidence: `pyflashdb/core.py`)
- FlashDB API → Configured database: operates on (evidence: `README.md`)
- MySQL adapter → Shared SQL runtime: uses runtime (evidence: `pyflashdb/adapters/mysql_adapter.py`)
- PostgreSQL adapter → Shared SQL runtime: uses runtime (evidence: `pyflashdb/adapters/postgres_adapter.py`)
- SQLite adapter → Shared SQL runtime: uses runtime (evidence: `pyflashdb/adapters/sqlite_adapter.py`)
- Shared SQL runtime → Adapter interface: implements (evidence: `pyflashdb/adapters/sql.py`)
- MongoDB adapter → Adapter interface: implements (evidence: `pyflashdb/adapters/mongo_adapter.py`)
- Shared SQL runtime → Filter semantics: compiles filters (evidence: `pyflashdb/adapters/sql.py`)
- Shared SQL runtime → SQL dialects: uses dialect (evidence: `pyflashdb/adapters/sql.py`)
- Shared SQL runtime → Connection pool: uses pool (evidence: `pyflashdb/adapters/sql.py`)
- MongoDB adapter → Filter semantics: translates filters (evidence: `pyflashdb/adapters/mongo_adapter.py`)
- MongoDB adapter → Schema definitions: validates schema (evidence: `pyflashdb/adapters/mongo_adapter.py`)
- SQL dialects → Schema definitions: renders DDL (evidence: `pyflashdb/dialects.py`)
- Python caller → Legacy Flash API: uses legacy API (evidence: `README.md`)
- Legacy Flash API → Legacy MongoDB: dispatches to (evidence: `flash/core.py`)
- Legacy Flash API → Legacy MySQL: dispatches to (evidence: `flash/core.py`)
- Legacy Flash API → Legacy PostgreSQL: dispatches to (evidence: `flash/core.py`)
- Legacy Flash API → Legacy filters: uses filters (evidence: `flash/core.py`)
- Legacy Flash API → Legacy triggers: fires hooks (evidence: `flash/core.py`)
- Legacy MongoDB → Legacy exceptions: raises errors (evidence: `flash/adapters/mongo_adapter.py`)
- Legacy MySQL → Legacy filters: translates filters (evidence: `flash/adapters/mysql_adapter.py`)
- Legacy PostgreSQL → Legacy filters: translates filters (evidence: `flash/adapters/postgres_adapter.py`)
