Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upInsertable structs with missing fields should cause compile-time error #599
Comments
This comment has been minimized.
|
This is a (very) long term goal. I think this is more likely to end up being a lint than a hard error, as actually representing this in the type system is likely impossible unless we have some form of anonymous struct/record. |
This comment has been minimized.
|
This is no longer a goal of the project. Properly supporting this would require not just know about the type and default of the column, but also any triggers that could fire. If we were truly to support this we would also need to care about constraints as well. Ultimately the revised goal of the project is to prevent all errors on select statements at compile time, and many classes of errors on insert/update, but not all. |
Boscop commentedJan 31, 2017
When I have an Insertable struct that is missing fields for columns of the table that are
NOT NULLand have no default value, it still compiles fine.I think it would be nice if it caused an error at compile-time.