4 ms·
Does database/sql check syntax at compile time? Or do you just try to unit-test you out of that?
by thomasahle 10y ago
Does database/sql check syntax at compile time? Or do you just try to unit-test you out of that?
- snuxoll 10y agoNo, but even though Entity Framework (as an example) does check types at compile time it doesn't prevent you from making mistakes that will cause runtime errors (oh the number of times I have run into issues trying to do simple things like ThingsToCheck(x => x.Created <= DateTime.Now.AddHours(-1)) which you would think works, after all it compiles, but it will just throw a runtime error because LINQ to Entities doesn't know how to parse the expression tree). Type-safe ORM's don't preclude integration testing, end of story.