buggins / ddbc

DDBC is DB Connector for D language (similar to JDBC)
78 stars 45 forks source link

null Date, DateTime, or SysTime default to 0001-Jan-01 #86

Closed SingingBush closed 4 years ago

SingingBush commented 4 years ago

If we have to default to something, the current time would be a better option for defaulting to. Really though it would be better to for the value to be null if that's what is in the database.

SingingBush commented 4 years ago

After doing some work on this I found that even if we return null both DateTime and SysTime will use 0001-Jan-01 so it either we should use Clock.currTime() to make sure it does something that's more likely to be useful or simply throw a SQLException. I've decided to go for using currTime and will push changes once tests working in all drivers