1

I use the Express node.js. With sequelize(mariadb).

show databases;
Database
> user
> board

I would like to use to create two database connections from a single website.

Directory Structure

models
|- user
    |- user.js    
|- board
    |- board.js
    |- comment.js

config.json

{
  "development": {
    "username": "root",
    "password": "test1234",
    "database": "testDB",
    "host": "127.0.0.1",
    "port": 3306,
    "dialect": "mariadb",
    "define": {
      "charset": "utf8",
      "collate": "utf8_general_ci"
    },
    "pool": {
      "max": 5,
      "min": 0,
      "idle": 10000
    }
  }
}

In the directory structure above, I need how to set sequelize connection.

One database connection has implemented a reporting api. http://docs.sequelizejs.com/en/1.7.0/articles/express/

I have a lot of beginners. This little detail is required. ( ex. directory structure, config.json, index.js and so on )

Sorry, Do not speak English well.

Have a nice day!

2
  • Possible duplicate of Sequelize: Using Multiple Databases Commented Aug 11, 2016 at 18:56
  • Thanks. I've done it. Commented Aug 16, 2016 at 3:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.