You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 26, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 26, 2025. It is now read-only.
For foreign keys there are a number of options a foreign key may have, but from a definition standpoint adding the foreign key to the column definition make the most sense as each column may only reference a single foreign column.
What I propose is the following:
{username: {type: DataTypes.STRING,unique: "some-arbitrary-key",},session: {type: DataTypes.STRING,foreignKey: {table: "session-table",// example like Model.tableNamecolumn: "session-table-field-name",// example like Model.columnNameonDelete?: {cascade?: boolean,restrict?: boolean,setNull?: boolean,setDefault?: boolean,},onUpdate?: {cascade?: boolean,restrict?: boolean,setNull?: boolean,setDefault?: boolean,},},},}
I think this approach is fairly straight-forward and easy to follow.
Activity
Skye-31 commentedon Oct 14, 2022
Duplicate of #23?
kingmesal commentedon Oct 14, 2022
Why would foreign key definitions be a duplicate of join syntax ?
Foreign keys are not required to provide join support.
sunnhyn commentedon Dec 30, 2022
It seems great. 👍
chrisspiegl commentedon Mar 20, 2023
Are you planning to add support for the foreign keys and join syntax to build relationships with this ORM?
Would be awesome to fetch things more easily this way.
Skye-31 commentedon Mar 20, 2023
@chrisspiegl
Pulls welcome 😃