Implement "RESTRICT" foreign key constraint in Wt::Dbo module#161
Implement "RESTRICT" foreign key constraint in Wt::Dbo module#161emweb merged 3 commits intoemweb:masterfrom ekondayan:master
Conversation
* Add Wt::Dbo::Impl::FKOnUpdateRestrict = 0x08 and Wt::Dbo::Impl::FKOnDeleteRestrict = 0x40 * Change the bit flags of the other constants so the newly added ones fit nicely * Add SQL code generation
|
Thanks for your contribution. Your changes look good, and I know it's fairly trivial, but what would be better is if we had some unit tests, so if you can manage to write some unit tests that would be ideal. If you can check it with Sqlite3, we can make sure it works with all of the other ones. I suppose this is a case of checking Regards, |
|
I've written the test, but I do not know how to include it into the framework. |
* Add stand alone unit test * Code format - FKNotNull's assignment to be aligned with others
|
That's a good start, I can take it from there. Regards, |
|
There is something that bothers me a bit.
Do we need to add another variable
and change the if statement to
Or since all databases support the RESTRICT constraint, checking |
|
Good observation. It appears that that check is there for Oracle. I'm still checking to see what Oracle supports. The implementation seems to suggest that In any case, I don't think it's necessary to introduce a Regards, |
The RESTRICT foreign key constraint is supported by all the major databases.
It is a must have feature for quite a lot of database schemes.
It's implementation in the Wt::Dbo module is very straight forward process, so there is no apparent reason no to do so.
Tested: