Closed DMaro28 closed 1 year ago
Hi, thank you for your feedback!
The column refModel TEXT NOT NULL REFERENCES DemoService.ReferenceModel
is the foreign key constraint that got created from the ModelProperty refModel: ReferenceModel
If this is not the foreign key you would expect could you please provide an example of PostgreSQL-code that contains it? As of the current state of this library it only generates Inlined Foreign Key constraints
If you would add more properties to ReferenceModel they would not be be inside of the Widget-Entity in the postgres-script. So only the (primary) key of the ReferenceModel is in the resulting postgres-script.
@DMaro28 was your question answered by this?
Yes, thank you.
Hi Niels! Firstly, great initiative with this emitter! In your comment here you are saying that "Having a model as a property will create a foreign key and also emit the referenced model". I'm having trouble producing this result with my initial testing.
Trying this syntax:
with this result:
Could you please provide an example of Typespec syntax that would produce foreign key with your emitter?