How yuebo119/palorm works
PalORM is a Native-AOT-oriented .NET micro-ORM. Its main workflow starts with an application defining entities and queries; the Roslyn generator validates entities and emits mapping, command, and migration code at compile time. At runtime, a DataSession and query executor use a selected database provider to perform CRUD, queries, and bulk operations. Separate documented capabilities include resilience, caching, auditing, and schema scaffolding. Edges follow the sampled calls or README descriptions; unsampled internals are represented only where the README documents their role.
Main entry points: DataSession.cs Data session · PalORMGenerator.cs Incremental generator · QueryBuilder.cs Query builder · DataSession_Bulk.cs Bulk operations
Components 24
Compile-time generation
- Compile diagnostics
src/PalORM.SourceGen/PalORMAnalyzer.cs - Table model
src/PalORM.SourceGen/TableModel.cs - Incremental generator
src/PalORM.SourceGen/PalORMGenerator.cs - Command generation
src/PalORM.SourceGen/CommandFactoryEmitter.cs - Row mapping
src/PalORM.SourceGen/RowFactoryEmitter.cs - Migration DDL
src/PalORM.SourceGen/MigrationEmitter.cs
ORM runtime
- Data session
src/PalORM.Core/DataSession.cs - Session options
src/PalORM.Core/DbOptions.cs - Query builder
src/PalORM.Core/QueryBuilder.cs - Query execution
src/PalORM.Core/QueryBuilderExtensions.cs - CRUD operations
src/PalORM.Core/DataSession.Crud.cs - Bulk operations
src/PalORM.Core/DataSession_Bulk.cs - CRUD metadata
src/PalORM.Core/CrudMetadata.cs - Retry and breaker
src/PalORM.Core/Resilience.cs - Query cache
src/PalORM.Core/DataSessionCache.cs - Audit interception
src/PalORM.Core/AuditInterceptor.cs
Database providers
- PostgreSQL provider
src/PalORM.PostgreSql/PostgreSqlProvider.cs - MySQL provider
src/PalORM.MySql/MySqlProvider.cs - SQLite provider
src/PalORM.Sqlite/SqliteProvider.cs
Schema tooling
- Entity scaffolding
tools/PalORM.Scaffold/EntityGenerator.cs - Schema providers
tools/PalORM.Scaffold/ISchemaProvider.cs
Other components
- Application
- Entity models
- Database
Connections 29
- Application → Entity models: defines
README.md - Entity models → Compile diagnostics: diagnosed by
README.md - Entity models → Incremental generator: processed at compile time
README.md - Incremental generator → Table model: builds model
src/PalORM.SourceGen/TableModel.cs - Incremental generator → Command generation: emits commands
README.md - Incremental generator → Row mapping: emits mappings
README.md - Incremental generator → Migration DDL: emits DDL
README.md - Application → Data session: creates session
README.md - Data session → Session options: uses configuration
src/PalORM.Core/DataSession.cs - Application → Query builder: builds query
README.md - Query builder → Query execution: executes via
src/PalORM.Core/QueryBuilderExtensions.cs - Data session → CRUD operations: provides operations
README.md - Data session → Bulk operations: provides bulk API
README.md - Bulk operations → CRUD metadata: uses metadata
- Query execution → Database: runs SQL
- CRUD operations → Database: reads and writes
- Bulk operations → Database: bulk writes
- Data session → PostgreSQL provider: selects provider
src/PalORM.Core/DataSession.cs - Data session → MySQL provider: selects provider
src/PalORM.Core/DataSession.cs - Data session → SQLite provider: selects provider
src/PalORM.Core/DataSession.cs - PostgreSQL provider → Database: connects to
- MySQL provider → Database: connects to
- SQLite provider → Database: connects to
- Data session → Retry and breaker: runs resilient reads
README.md - Query builder → Query cache: supports query cache
README.md - Data session → Audit interception: supports auditing
README.md - Application → Entity scaffolding: generates entities
README.md - Entity scaffolding → Schema providers: uses schema provider
tools/PalORM.Scaffold/Program.cs - Schema providers → Database: reads schema