This package works as an ORM for a specific database scheme used in the u-sports-live ecosystem. It uses sequelize to design a series of models that communicate with the database and perform queries/mutations.
To install the package you can simply run:
npm install @usportslive/database-models
After that you can start using it by just importing the module
// database.jsconst initialize = ;moduleexports =;
// index.jsconstsequelizeUserRoleSportTeamComment// ...} = ;sequelize;
As you can see, the package returns a sequelize (^5) instance that has all models, associations and hooks already loaded in it.
|db||The name of the database|
|user||The username which is used to authenticate against the database.|
|password||The password which is used to authenticate against the database.|
|options||An object with options (see more)|
Test are available although you need to have a mysql database with the credentials used in connection.spec.ts to make it work. You can run it with: