Remove double quotes from a Table Name using SEQUELIZE Nodejs

0 votes

used Nodejs' SEQUELIZE to construct an Account table in the PostgreSQL database. The tables were made using npx commands.

$ npx sequelize db:create
$ npx sequelize db:migrate

Double-quotes are used while creating the table by default. For instance, the sql command might be as follows if I wanted to verify the entries in the Account table:

SELECT * FROM "Account";

I want to remove the double-quotes from the table name i.e.

SELECT * FROM Account;

The option (options.quoteIdentifiers) in the Sequelize Manual specifies that it should be set to false in order to have Postgres treat table names and attributes as case-insensitive and to avoid double quoting them.

The Account table is still formed with double quotes even after I added this option to my code. I'm unsure if I've made any mistakes. Check out my code down below. I appreciate it.

var sequelize = new Sequelize(dbConfig.DB, dbConfig.USER, dbConfig.PASSWORD,
  options.quoteIdentifiers = false, 
  {
  host: dbConfig.HOST,
  dialect: dbConfig.dialect,
  pool: {
    max: dbConfig.pool.max,
    min: dbConfig.pool.min,
    acquire: dbConfig.pool.acquire,
    idle: dbConfig.pool.idle
  }
},
);
module.exports = (sequelize, DataTypes) => {
  const Account = sequelize.define('Account', {
    epprojectname: DataTypes.STRING,
    username: DataTypes.STRING,
    projectid: DataTypes.STRING,
    vendorparameters: DataTypes.STRING,
    credentials: DataTypes.STRING,
    author: DataTypes.STRING,
    localnumber: DataTypes.STRING,
    loginid: DataTypes.INTEGER,
  }, {
    freezeTableName: true,
  },
  );
Jun 27, 2022 in Node-js by Vaani
• 7,020 points
1,209 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Node-js

0 votes
1 answer

How to extract request http headers from a request using NodeJS connect?

Hello @kartik, To see a list of HTTP ...READ MORE

answered Jul 15, 2020 in Node-js by Niroj
• 82,880 points
22,393 views
0 votes
1 answer

Is there a way to download videos from YouTube Studio using NodeJS

Try this project in the github repository ...READ MORE

answered May 27, 2022 in Node-js by Neha
• 9,060 points
1,427 views
0 votes
1 answer

Can I display a TV channel from TV tuner card using NodeJS for an Electron APP?

Tvheadend is a streaming server for live ...READ MORE

answered Jun 10, 2022 in Node-js by Neha
• 9,060 points
580 views
0 votes
1 answer

Download a file from NodeJS Server using Express

Because the file's name is just 'download' ...READ MORE

answered Jun 13, 2022 in Node-js by Neha
• 9,060 points
6,950 views
0 votes
1 answer

How nodejs get file name from absolute path?

Hello @kartik, Use the basename method of the path module: path.basename('/foo/bar/baz/asdf/quux.html') // returns 'quux.html' If you ...READ MORE

answered Jul 14, 2020 in Node-js by Niroj
• 82,880 points
3,066 views
0 votes
1 answer

Auto deduct the payment from account using razorpay in nodejs

To interface with Razorpay APIs, install the ...READ MORE

answered Jun 14, 2022 in Node-js by Neha
• 9,060 points
710 views
0 votes
1 answer

nodejs mysql Error: Connection lost The server closed the connection

Try to use this code to handle server disconnect: var ...READ MORE

answered Jun 17, 2022 in Node-js by Neha
• 9,060 points
10,327 views
0 votes
0 answers

Knex NodeJS and inserting into the database

Here is my first attempt at setting ...READ MORE

Jun 27, 2022 in Node-js by Vaani
• 7,020 points
306 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,709 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP