Axel AMGHAR
Axel AMGHAR

Reputation: 315

Sequelize, How to change value after the instantiation?

I have a sequelize instantiation

new Sequelize('xxxx', 'xxxx' , null, {
    host: null,
    dialect: "xxxx",
    operatorsAliases: 0,

    pool: {
        max: 5,
        min: 0,
        acquire: 30000,
        idle: 10000
    }

And i want to change a certain value afterwards, like =>

my_instance_sequelize.host = 'new_xxxx'

but that don't change my value. How can i do it ?

Upvotes: 0

Views: 593

Answers (2)

Axel AMGHAR
Axel AMGHAR

Reputation: 315

Found an answer You can add config like that

my_instance_sequelize.config.host = 'new_xxxx'

Upvotes: 0

tbking
tbking

Reputation: 9096

Creating a Sequelize instance is basically creating a connection with the database. Changing host value afterwords is not going to change the connection. It requires creating a new instance.

So, if you want to change the host value of the Sequelize instance, you essentially wants to create a new instance.

Upvotes: 1

Related Questions