azavea / azavea/fastdao

InvalidCastException when DAO property doesn't match SQL column data type

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Description

FastDAO fails to warn you if a C# property definition doesn't match the SQL definition.

Common scenario:
1. Define column as `DATETIME NULL`
2. Define a DAO binding property as `DateTime`
3. Error: If you don't populate that DateTime property, it will be set to a default value, and throw a SQL exception (Property should be defined as `DateTime?`)

It would be nice if FastDAO could generate a NHibernate mapping and compare it against the defined mapping to see if there are any glaring errors such as a type mismatch when an InvalidCastException occurs.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the DATETIME NULL and DateTime binding scenario described in the issue. Read the DAO binding behavior and the proposed NHibernate mapping comparison, then define what diagnostics should appear when an InvalidCastException results from a type mismatch. Done means the mismatch is detected and reported clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.