Usually in the TypeSpec world we would name properties of other model-types like this:
@entity
model MyModel {
anotherModel: AnotherModel;
}
@entity
model AnotherModel {
@key id: numeric
}
this will produce the following schema:
CREATE TABLE AnotherModel (id NUMERIC PRIMARY KEY);
CREATE TABLE MyModel (
anotherModel NUMERIC NOT NULL REFERENCES AnotherModel
);
Now in the db-domain the referencing colums are usually suffixed with "id" or "_id" or they have another name altogether. It would be a good feature to be able to name properties. This should not only be done for manual references but also for automatic references!
(Maybe this needs another decorator altogether)
Usually in the TypeSpec world we would name properties of other model-types like this:
this will produce the following schema:
Now in the db-domain the referencing colums are usually suffixed with "id" or "_id" or they have another name altogether. It would be a good feature to be able to name properties. This should not only be done for manual references but also for automatic references! (Maybe this needs another decorator altogether)