sequelize postgres code example

Example 1: sequelize mariadb example

const sequelize = new Sequelize('database', 'username', 'password', {
  dialect: 'mariadb',
  dialectOptions: {
    // Your mariadb options here
    // connectTimeout: 1000
  }
});

Example 2: new Sequelize('featherstutorial', 'databaseUser', 'databasePassword'

var sequelize = new Sequelize('database', 'username', 'password', {
  host: "my.server.tld",
  port: 12345
})

Example 3: sequelize sqlite example

const sequelize = new Sequelize('database', 'username', 'password', {
  dialect: 'sqlite',
  storage: 'path/to/database.sqlite' // or ':memory:'
  dialectOptions: {
    // Your sqlite3 options here
  }
});

Example 4: new Sequelize('featherstutorial', 'databaseUser', 'databasePassword'

var sequelize = new Sequelize('mysql://user:[email protected]:9821/dbname', {
  // Look to the next section for possible options
})

Example 5: sequelize node js postgres association

sequelize node js postgres association

Tags:

Misc Example