Why I Built a Schema Drift Detector
The DBA added a column on Tuesday. Changed a type from INT to BIGINT. Made a nullable column NOT NULL. The ALTER scripts ran fine. The database was updated.
The C# classes? Nobody touched them.
The deploy went out Friday. Nothing crashed immediately — NHibernate silently ignores extra database columns. The problems showed up three weeks later, when a customer's data got silently truncated because a type mismatch clipped their input. By the time anyone noticed, hundreds of records were affected.
I've seen this happen. More than once.
The bug that doesn't crash
Schema drift is insidious because it doesn't throw exceptions. A type mismatch between NVARCHAR and VARCHAR might silently lose data. A column that went from nullable to NOT NULL might cause inserts to fail only when certain code paths are hit. A new column that nobody mapped just... doesn't exist to your application.
The manual way to catch this: open SSMS and Visual Studio side by side, scroll between the table definition and the C# class, compare column by column. For one table, 10-30 minutes. For 30 tables after a migration, a full day. And you'll still miss things. Humans are bad at spotting that NVARCHAR(100) quietly became NVARCHAR(200).
The tool AI can't replace
I'm going to be direct here. Products #1, #2, and #3 are code generators. They take format A and produce format B. Honestly? You can get similar results by pasting code into ChatGPT. I've said as much in those blog posts.
This tool is different.
A drift detector needs to read your actual .sql file from your actual database. Then read your actual .cs file from your actual project. Compare them column by column. Report every mismatch — missing columns, type differences, nullable inconsistencies.
SchemaDriftDetector.exe Customer.sql Customer.cs
You can't do this in a chat window. The AI doesn't have your files. It doesn't know your schema changed last Tuesday. It can't scan your project and tell you that Email is string in C# but NVARCHAR(200) in SQL and those don't match your mapping. This tool does, in 2 seconds.
What the output looks like
The report is straightforward: what's missing in C#, what's missing in SQL, what has a type mismatch, what has a nullable mismatch. Each issue tells you exactly what's wrong. If everything matches, you get "No mismatches found" and a clean exit code — useful if you want to wire it into CI.
No ambiguity. No "maybe check this." Either the schema and code match, or they don't, and here's exactly where they don't.
The turning point
This was Product #5, and it changed the nature of the toolkit. The first four products (#1, #2, #3, #4) created files. This one analyzes existing files and tells you what's wrong. Generators are nice-to-have. A validator that prevents production bugs is need-to-have.
I priced it at EUR 15 instead of EUR 10. Small difference, but it reflects the difference in value: this isn't about saving typing time. It's about the production incident you didn't have.
Available on Gumroad for EUR 15.