I am working to make a storage provider to nestjs/throttler for MySQL Database with Sequelize Module. I wanted to see if this is a good apparoch. I have made one that behave similarly with the original rate limiter logic. The only problem is the sequelize model needs to be added manually on AppModule when declaring Sequelize Module. However, I'm just curious if this is a good idea to start with. I've only code on the side or as hobby and have limited knowledge with NestJS. I'm writing my first NestJS backend server atm for my website. I'd like to see if anyone have any concerns with this apparoch.
// app.module.ts
@Module({
imports: [
ThrottlerModule.forRoot({
throttlers: [
{
ttl: seconds(10),
limit: 2,
},
],
storage: new ThrottlerStorageMysqlService(Record),
}),
SequelizeModule.forRoot({
dialect: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: '',
database: 'development',
autoLoadModels: true,
synchronize: true,
models: [Record],
}),
],
controllers: [AppController],
providers: [AppService],
})