# gbtussi/aspobelisk architecture

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

- Interactive diagram: https://gitdiagram.com/gbtussi/aspobelisk
- Repository: https://github.com/gbtussi/aspobelisk

## Overview

aspObelisk is a Classic ASP ORM with a .NET CLI for schema introspection, model generation, and versioned migrations, plus an ASP runtime that executes ORM operations through ADODB. The main workflow is to configure a database source, introspect its schema, generate model files and a bootstrap include, then use those models from an ASP site. The README also documents migration creation, application, rollback, multi-source configuration, relationships, and fluent queries. Runtime internals and migration implementation details were not sampled, so those links are limited to documented behavior.

Main entry points: [`cli/src/Program.cs`](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Program.cs) (CLI commands), [`runtime/model.asp`](https://github.com/gbtussi/aspobelisk/blob/main/runtime/model.asp) (Active Record model), [`cli/src/Migrations/MigrationRunner.cs`](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Migrations/MigrationRunner.cs) (Migration runner), [`cli/src/Generators/ModelGenerator.cs`](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Generators/ModelGenerator.cs) (Generated models and bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and schema"]
  node_config["Source configuration<br/>[ConfigModel.cs]"]
  node_command["CLI commands<br/>[Program.cs]"]
  node_mysql["MySQL introspection"]
  node_sqlserver["SQL Server introspection"]
  node_relations["Relation builder<br/>[RelationBuilder.cs]"]
  node_schema["Table schema<br/>[SchemaModels.cs]"]
end

subgraph group_generation["Model generation"]
  node_generator["ASP code generator<br/>[ModelGenerator.cs]"]
  node_generated["Generated models and bootstrap<br/>[ModelGenerator.cs]"]
end

subgraph group_migrations["Migrations"]
  node_migrationfile["Migration files<br/>[MigrationFile.cs]"]
  node_migrationrunner["Migration runner<br/>[MigrationRunner.cs]"]
end

subgraph group_runtime["ASP runtime"]
  node_model["Active Record model<br/>[model.asp]"]
  node_context["Connection context<br/>[context.asp]"]
  node_connection["ADODB connection<br/>[connection.asp]"]
  node_builder["Query builder<br/>[query-builder.asp]"]
  node_hydrator["Recordset hydrator"]
end

node_maintainer(("Project maintainer"))
node_db[("MySQL / SQL Server")]
node_site(("Classic ASP site"))

node_maintainer -->|"runs commands"| node_command
node_command -->|"resolves sources"| node_config
node_command -->|"introspects schema"| node_mysql
node_command -->|"introspects schema"| node_sqlserver
node_mysql -->|"applies relations"| node_relations
node_sqlserver -->|"applies relations"| node_relations
node_command -->|"generates models"| node_generator
node_generator -->|"emits files"| node_generated
node_site -->|"includes bootstrap"| node_generated
node_generated -->|"delegates ORM work"| node_model
node_site -->|"uses models"| node_model
node_model -->|"configures connection"| node_context
node_context -.->|"provides connection"| node_connection
node_model -.->|"builds queries"| node_builder
node_builder -.->|"executes queries"| node_connection
node_connection -->|"queries via ADODB"| node_db
node_command -->|"creates scaffold"| node_migrationfile
node_command -->|"runs migrations"| node_migrationrunner
node_migrationrunner -->|"applies schema changes"| node_db
node_migrationrunner -.->|"reads up/down blocks"| node_migrationfile

click node_config "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Models/ConfigModel.cs"
click node_command "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Program.cs"
click node_mysql "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Schema/MySqlIntrospector.cs"
click node_sqlserver "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Schema/SqlServerIntrospector.cs"
click node_relations "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Schema/RelationBuilder.cs"
click node_schema "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Models/SchemaModels.cs"
click node_generator "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Generators/ModelGenerator.cs"
click node_generated "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Generators/ModelGenerator.cs"
click node_migrationfile "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Migrations/MigrationFile.cs"
click node_migrationrunner "https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Migrations/MigrationRunner.cs"
click node_model "https://github.com/gbtussi/aspobelisk/blob/main/runtime/model.asp"
click node_context "https://github.com/gbtussi/aspobelisk/blob/main/runtime/context.asp"
click node_connection "https://github.com/gbtussi/aspobelisk/blob/main/runtime/connection.asp"
click node_builder "https://github.com/gbtussi/aspobelisk/blob/main/runtime/query-builder.asp"
click node_hydrator "https://github.com/gbtussi/aspobelisk/blob/main/runtime/recordset-hydrator.asp"

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_config,node_command,node_mysql,node_sqlserver,node_relations,node_schema toneBlue
class node_generator,node_generated,node_db toneAmber
class node_migrationfile,node_migrationrunner toneMint
class node_model,node_context,node_connection,node_builder,node_hydrator toneRose
class node_maintainer,node_site toneIndigo
```

## Components

### CLI and schema

- [Source configuration](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Models/ConfigModel.cs): `cli/src/Models/ConfigModel.cs`
- [CLI commands](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Program.cs): `cli/src/Program.cs`
- [MySQL introspection](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Schema/MySqlIntrospector.cs): `cli/src/Schema/MySqlIntrospector.cs`
- [SQL Server introspection](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Schema/SqlServerIntrospector.cs): `cli/src/Schema/SqlServerIntrospector.cs`
- [Relation builder](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Schema/RelationBuilder.cs): `cli/src/Schema/RelationBuilder.cs`
- [Table schema](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Models/SchemaModels.cs): `cli/src/Models/SchemaModels.cs`

### Model generation

- [ASP code generator](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Generators/ModelGenerator.cs): `cli/src/Generators/ModelGenerator.cs`
- [Generated models and bootstrap](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Generators/ModelGenerator.cs): `cli/src/Generators/ModelGenerator.cs`

### Migrations

- [Migration files](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Migrations/MigrationFile.cs): `cli/src/Migrations/MigrationFile.cs`
- [Migration runner](https://github.com/gbtussi/aspobelisk/blob/main/cli/src/Migrations/MigrationRunner.cs): `cli/src/Migrations/MigrationRunner.cs`

### ASP runtime

- [Active Record model](https://github.com/gbtussi/aspobelisk/blob/main/runtime/model.asp): `runtime/model.asp`
- [Connection context](https://github.com/gbtussi/aspobelisk/blob/main/runtime/context.asp): `runtime/context.asp`
- [ADODB connection](https://github.com/gbtussi/aspobelisk/blob/main/runtime/connection.asp): `runtime/connection.asp`
- [Query builder](https://github.com/gbtussi/aspobelisk/blob/main/runtime/query-builder.asp): `runtime/query-builder.asp`
- [Recordset hydrator](https://github.com/gbtussi/aspobelisk/blob/main/runtime/recordset-hydrator.asp): `runtime/recordset-hydrator.asp`

### Other components

- **Project maintainer**
- **MySQL / SQL Server**
- **Classic ASP site**

## Connections

- Project maintainer → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Source configuration: resolves sources (evidence: `cli/src/Program.cs`)
- CLI commands → MySQL introspection: introspects schema (evidence: `cli/src/Program.cs`)
- CLI commands → SQL Server introspection: introspects schema (evidence: `cli/src/Program.cs`)
- MySQL introspection → Relation builder: applies relations (evidence: `cli/src/Schema/MySqlIntrospector.cs`)
- SQL Server introspection → Relation builder: applies relations (evidence: `cli/src/Schema/SqlServerIntrospector.cs`)
- CLI commands → ASP code generator: generates models (evidence: `cli/src/Program.cs`)
- ASP code generator → Generated models and bootstrap: emits files (evidence: `cli/src/Generators/ModelGenerator.cs`)
- Classic ASP site → Generated models and bootstrap: includes bootstrap (evidence: `README.md`)
- Generated models and bootstrap → Active Record model: delegates ORM work (evidence: `README.md`)
- Classic ASP site → Active Record model: uses models (evidence: `README.md`)
- Active Record model → Connection context: configures connection
- Connection context → ADODB connection: provides connection
- Active Record model → Query builder: builds queries
- Query builder → ADODB connection: executes queries
- ADODB connection → MySQL / SQL Server: queries via ADODB (evidence: `README.md`)
- CLI commands → Migration files: creates scaffold (evidence: `cli/src/Program.cs`)
- CLI commands → Migration runner: runs migrations (evidence: `cli/src/Program.cs`)
- Migration runner → MySQL / SQL Server: applies schema changes (evidence: `README.md`)
- Migration runner → Migration files: reads up/down blocks
