1

I want to import csv file data into mysql database table I can do it using only mysql query but I am not able to do it by sequelize and express js please help me. Thanks in advance.

1 Answer 1

2

you need to use seeders. see the docs here on making and running seeds http://docs.sequelizejs.com/manual/migrations.html#creating-first-seed

you also need to convert your CSV to SQL. see here https://blog.sqlizer.io/posts/convert-csv-to-sql/

The format for RAW SQL in your seeder is listed below

module.exports = {
  up: queryInterface => queryInterface.sequelize.query(`
      // RAW QUERY HERE
  `),
};
,,,
Sign up to request clarification or add additional context in comments.

Comments

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.