What you are doing?
I have a schema with fields such as 'foo.bar.baz'
Sequelize will generate the correct 'Create Table if not exist' query but will not generate a correct
'SELECT' query with this column name. The SELECT that gets generated from this is " SELECT foo.bar.baz from
where . The SELECT query should be "SELECT
foo.bar.baz. As a result the db responds with an error, (Responding with error. SequelizeBaseError: ER_BAD_FIELD_ERROR: Unknown column 'foo.bar.baz' in 'field list') which is also misleading.
The following model will reproduce with mySQL db
{
id: {
type: sequelize.UUID,
primaryKey: true
},
'foo.bar.baz': sequelize.TEXT
}
model.findAll({ where: {id: 123} }).then(
items => {},
error => {}
);
What do you expect to happen?
SELECT foo.bar.baz, id FROM WHERE id = 123
What is actually happening?
SELECT foo.bar.baz, id FROM WHERE id = 123
Output, either JSON or SQL
Dialect: mysql
Database version: AWS Aurora
Sequelize version: 3.30