cmeeren/Facil
62.1
Adequate · 2 October 2026
43.8k
lines of production code
F#
primary language
2
measurements over time
What this system is
Facil is a .NET code generation and runtime library that produces F\# and C\# data access layers from SQL Server schemas. It handles complex type mappings, including spatial and hierarchy types, and supports advanced SQL features like temporary tables and script includes. The system also provides infrastructure for automated release management and comprehensive integration testing.
How it got here
2020 — SQL Server type expansion and .NET 10 migration
10 changes.
The project migrated its build infrastructure to the SLNX format and upgraded to .NET 10, while significantly enhancing SQL Server support through improved type handling for spatial and hierarchy data. This period introduced robust code generation features, including script includes and temporary table management, backed by comprehensive integration tests to verify the new capabilities.
2021–2026 — SQL Server type expansion and release automation
8 changes.
The project expanded SQL Server support by adding types such as hierarchyid, spatial data, and DateOnly, while refining the database generator to handle temporal tables and complex column scenarios. Concurrently, the team consolidated test assets, unified package smoke testing infrastructure, and introduced automated release workflows to streamline versioning and publishing.
Features
New release automation skill for Facil
A new 'release-facil' agent skill has been added to guide the preparation and publication of Facil releases. This includes a detailed workflow for version bumping, release note formatting (with specific requirements for breaking changes), local verification, and GitHub Release creation. It also introduces a new Node.js utility script, wait-for-nuget.js, to reliably confirm package availability on NuGet before publishing release notes, along with comprehensive tests for this utility.
.agents · high confidence
Support for SQL Server temporary tables in generated code
The C\# runtime now supports the use of SQL Server temporary tables within generated scripts. This change introduces new internal components (\TempTableData\, \TempTableLoader\) to handle bulk loading of data into temporary tables and implements automatic cleanup logic via \TempTableCleanupScope\ to ensure temporary tables are dropped after execution, even in asynchronous contexts or when transactions are involved.
src/Facil.Runtime.CSharp · high confidence
Support for SQL script includes and enhanced code generation configuration
The generator now supports including other SQL scripts within templates using the \{{include "path"}}\ syntax, with safeguards against cycles and path traversal. Additionally, the configuration schema has been expanded to allow overriding column nullability, specifying parameter DTO kinds (inline, nominal, or skip), and configuring SQL date types (DateOnly or DateTime). The default generated module visibility has also changed from internal to public.
src/Facil.Generator · high confidence
Architecture
Adopts SLNX solution format and updates build infrastructure
The project has migrated from the legacy .sln format to the new SLNX solution format (Facil.slnx), which reorganizes the solution structure and includes new solution items like .fantomasignore and AGENTS.md. This change is accompanied by the removal of the AppVeyor CI configuration (appveyor.yml) and the addition of a global.json to pin the .NET SDK version to 10.0.303. Additionally, Directory.Build.props now enforces reproducible builds and sets the project version to 3.2.0.
(repo-wide) · high confidence
Behavioural changes
Added SQL Server type support in test database schema
The test database schema now includes user-defined table types for SQL Server's HierarchyId, spatial (Geometry and Geography), and MAX-length string/binary types, alongside existing types for identity columns and fixed-length strings. These additions enable regression testing for truncation behavior and fix previous exceptions related to MAX length Table-Valued Parameters.
src/TestDb/dbo/User Defined Types · high confidence
Agent skills directory symlinked
The .claude/skills path is now a symbolic link pointing to ../.agents/skills, centralizing agent skill definitions in the .agents directory while making them accessible via the .claude configuration.
.claude · high confidence
Expanded SQL Server type support and test coverage for table scripts
The table script generation logic now supports additional SQL Server data types, including hierarchyid, spatial types (geometry and geography), and sql\_variant, while also correctly handling computed columns, identity columns, and temporal tables by ignoring generated-always columns in insert/update scripts. These changes are validated by a comprehensive set of new test tables covering all supported types, nullability overrides, camel-case column names, and edge cases like tables with only primary key columns or full-text indexes.
src/TestDb/dbo/Tables · high confidence
Improved SQL type handling and script parsing in the generator
The code generator now uses a more robust lookup for SQL type names by querying both system and user type IDs, and introduces a new \SqlTypeInfo\ structure that includes a \SqlClientValueBridge\ to correctly map SQL \date\ types to F\# \DateOnly\ (backed by \DateTime\ at the client level). Script parsing has been upgraded to use the TSql170 parser (supporting newer SQL Server syntax) and includes specific handling for \sp\_executesql\ calls. Additionally, temporary table names are now rewritten to global temp tables with a unique prefix to prevent collisions, and size/precision logic for SQL parameters and metadata has been refined to handle edge cases like \NChar\/\NVarChar\ size adjustments and specific precision requirements for \Float\ and \Time\ types.
Facil.Generator · high confidence
Improved cancellation handling and support for temporary tables in SQL queries
The SQL execution layer in \src/Facil.Runtime\ now supports temporary tables within scripts, allowing users to create and use temp tables during query execution. Additionally, query cancellation behavior has been normalized: when a request is cancelled, the system now throws an \OperationCanceledException\ instead of a generic \SqlException\, providing clearer feedback to the application. The generated code utilities have been updated to pass transaction contexts and temporary table data through the execution pipeline, ensuring these features work correctly with both eager and lazy query modes.
src/Facil.Runtime · high confidence
Local generator build integration and configuration updates
The DbGen test project now includes a local MSBuild targets file that automatically invokes the Facil generator from the built output directory before compilation, ensuring the generator is available locally. The project configuration has been updated to use a connection string pointing to the local machine (Data Source=.) with encryption disabled, and the generator assembly version is set to 3.2.0.
src/DbTests.DbGen · high confidence
Move SQL test scripts to DbGen project and add support for hierarchyid and spatial types
The SQL test scripts located in src/DbTests.DbGen/SQL have been moved from the previous src/DbTests and src/TestOutput locations into this dedicated DbGen project, consolidating the test assets. This change also introduces new test scripts to support SQL Server hierarchyid and spatial types (GEOMETRY and GEOGRAPHY), including definitions for temp tables using these types, and adds scripts to test dynamic SQL scenarios such as parameterized queries, TVPs, and result set overrides.
src/DbTests.DbGen/SQL · high confidence
Test database schema and build configuration updated
The TestDb project has been migrated to the modern SDK-style format using Microsoft.Build.Sql 2.2.0, switching the schema provider to SQL Server 2017 (Sql170) and simplifying the project file structure. A new FullTextCatalog and View1 have been added to the schema, and the post-deployment script now explicitly inserts data into TableWithNullabilityOverride. Additionally, the local database connection string in LocalDB.publish.xml has been changed from (LocalDb)\\MSSQLLocalDB to the local default instance (.).
src/TestDb · high confidence
Updated database generator to version 3.2.0 with enhanced type and script support
The DbGen tool has been regenerated for version 3.2.0, introducing support for SQL Server's DateOnly type (mapped to .NET DateOnly), SQL hierarchyid, and spatial types. The generated code now correctly handles GENERATED ALWAYS columns (e.g., temporal tables) by ignoring them in insert/update scripts, preserves MAX Unicode parameter sizes, and improves batch matching by schema rather than column order. Additionally, the generator now automatically drops and cleans up temporary tables, supports shared SQL script fragments, and includes new batch insert/update/merge scripts.
DbTests.DbGen · high confidence
Test coverage
Added database integration tests for new SQL Server types and script features; Added smoke tests for package validation; Expanded test database stored procedures for advanced SQL type coverage; Unified package smoke testing infrastructure added.
Dependencies
Upgrade to .NET 10 and .NET Standard 2.0 with major dependency updates
The project has been unified to target .NET Standard 2.0 for the runtime libraries and .NET 10 for the generator and test projects, dropping support for older frameworks like .NET 5 and .NET Core 3.1. This change includes significant dependency upgrades, most notably updating Microsoft.Data.SqlClient from version 2.1.0 to 5.2.2 and Microsoft.SqlServer.TransactSql.ScriptDom from 150.x to 180.x, alongside updates to FSharp.Core (to 9.0.100 in tooling, 6.0.0 in runtime), Expecto, and Hedgehog. The package build process has also been restructured to explicitly target the net10.0 generator output.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 62 → 62 (+0.3)
- Rubric changed (rubric-2026.09.13 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 59 → 59 (+0.0)
- Architecture 89 → 93 (+3.8)
- Maturity 64 → 65 (+1.1)
- Readiness 58 → 58 (+0.0)
- Security 75 → 75 (+0.0)
Resolved (3)
- Coverage not measured — no coverage collector is wired up
- Documentation: no architecture or design documentation (README.md)
- Hotspot: src/Facil.Generator/Render.fs (src/Facil.Generator/Render.fs)
Changes since last survey
- 1 commits — 1 feature/other, 0 fixes
By area
- .claude/skills — 1 commit
Notable commits
- change: Share agent skills with Claude Code
Architecture
- Unchanged — 1 containers · 3 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
cmeeren/Facil was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 2fc512f92dc893580b9ec55254b858a3e8b4a90c — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-351388015767.