Skip to content

The new Option "quoteIdentifiers" (Pull request #651) breaks Raw SQL Queries #693

@cstotzer

Description

@cstotzer

The following code

var Sequelize = require('sequelize')

var sequelize = new Sequelize('postgres', '<userid>', null, {
    host: "127.0.0.1",
    dialect: 'postgres',
    define: { timestamps: true, paranoid: true, underscore: true },
    quoteIdentifiers: false
})

sequelize.query("SELECT NOW() AS t").success(function (myTableRows) {
    console.log(myTableRows)
})

throws this Exception:

Executing: SELECT NOW() AS t

/Users/<userid>/WebstormProjects/playground/node_modules/sequelize/lib/dialects/postgres/query.js:114
          var attrsMap = Utils._.reduce(this.callee.attributes, function(m, v,
                                                   ^
TypeError: Cannot read property 'attributes' of undefined
    at module.exports.onSuccess (/Users/<userid>/WebstormProjects/playground/node_modules/sequelize/lib/dialects/postgres/query.js:114:52)
    at null.<anonymous> (/Users/<userid>/WebstormProjects/playground/node_modules/sequelize/lib/dialects/postgres/query.js:47:17)
    at EventEmitter.emit (events.js:95:17)
    at p.handleReadyForQuery (/Users/<userid>/WebstormProjects/playground/node_modules/pg/lib/query.js:97:8)
    at null.<anonymous> (/Users/<userid>/WebstormProjects/playground/node_modules/pg/lib/client.js:124:24)
    at EventEmitter.emit (events.js:117:20)
    at Socket.<anonymous> (/Users/<userid>/WebstormProjects/playground/node_modules/pg/lib/connection.js:86:12)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:736:14)
    at Socket.EventEmitter.emit (events.js:92:17)

Process finished with exit code 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions