haxetink / tink_sql

SQL embedded into Haxe
MIT License
53 stars 16 forks source link

Support foreign keys in create table query #36

Open kevinresol opened 7 years ago

kevinresol commented 7 years ago

Proposed syntax:

@:foreign(User, id) var userId:Id<User>;
back2dos commented 7 years ago

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).

kevinresol commented 7 years ago

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.