tink_sql icon indicating copy to clipboard operation
tink_sql copied to clipboard

Support foreign keys in create table query

Open kevinresol opened this issue 8 years ago • 2 comments

Proposed syntax:

@:foreign(User, id) var userId:Id<User>;

kevinresol avatar Oct 11 '17 08:10 kevinresol

Sounds good. An interesting question is how exactly the table should be identified (ideally it would be the name of the field on the database object that holds the table).

back2dos avatar Oct 11 '17 08:10 back2dos

This is tricky. Easiest way is to let user specify the table name @:foreign('table_name', id).

Problem is that, we can't know table name from the table class itself.

kevinresol avatar Oct 11 '17 09:10 kevinresol