Skip to content

Mise Diagnostics

SteffenBlake edited this page Sep 28, 2026 · 1 revision

Mapping and SQL diagnostics

Mise's engine reports mapping and unsafe SQL problems at build time. Builders also validate their statement shape during configuration or compilation. The database checks schema-dependent SQL when the command executes.

Generator diagnostics

Code Cause What to check
MISE001 Empty table, column, qualifier, or alias name Supply a nonempty identifier
MISE002 A mapped property lacks [Column] Map each row property and table column
MISE003 Duplicate mapped identifier Check names under the engine's case rules
MISE004 Invalid primary-key position Use unique nonnegative positions
MISE005 Generated and computed metadata combined Choose one meaning for the column
MISE006 Target or containing type is not partial Add partial to the type hierarchy
MISE007 A row property cannot be assigned Match a constructor parameter or writable property
MISE008 No unique valid row constructor Keep exactly one valid materialization path
MISE009 Relationship names an unmapped target column Reference the correct generated *Col member
MISE010 Unsupported row type Use a concrete, nonstatic, non-ref-like row
MISE011 Relationship target uses the wrong table engine Use related tables from the same engine
MISE012 Runtime string used with :raw Use a constant SQL reference and bind values normally
MISE013 Multiple table engines on one type Choose one table engine
MISE014 Multiple row engines on one type Choose one row engine
MISE015 Table and row engine mismatch on one type Use matching engine attributes
MISE016 Generated member name collision Rename the colliding member or alias
MISE017 Known unsupported join Choose a supported join for that database
MISE018 A table target is not static Use a static partial table class

Generated names include Table, *Col, alias classes, and relationship join members. Reserve those names for the generated references. Check that the matching engine package is installed when no generated members appear.

Builder errors

Common invalid query shapes include a missing SELECT projection, two FROM sources, a relationship join without ON, a cross join with ON, incompatible child engines, and cycles through child builders. SQL Server paging also requires ORDER BY.

Common invalid command shapes include UPDATE without SET, INSERT without a source, mixing VALUES with a source query, adding INSERT clauses to UPDATE, and combining custom SQL with fluent statement modes.

Some checks fail when a method is called; others fail at Compile, which execution terminals call automatically. Compile a statement independently when diagnosing its shape.

Row binding failures

InvalidMappingException means the projection cannot bind to the mapped row, such as a missing column or duplicate matching column name. Inspect compiled.Text, then compare the actual result names with each row [Column].

MappingException includes materialization problems such as SQL NULL assigned to a non-nullable property. Consider nulls introduced by outer joins as well as nullability in the base schema.

Scalar casts can also fail when the provider's value type differs from the requested generic type. See Readers.

Database and lifecycle errors

Constraint violations, missing database objects, permissions, connection failures, provider timeouts, cancellation, and disposal failures propagate as exceptions. They do not automatically become Result.Error.

An active-operation error indicates overlapping work on one reader or writer, including an unconsumed stream. A transaction-disposal error indicates the writer ended before its adapter. See Resource lifetimes.

Clone this wiki locally